24.03.2013 Views

OpenEdge Development: Working with XML - Product ...

OpenEdge Development: Working with XML - Product ...

OpenEdge Development: Working with XML - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reading <strong>XML</strong> Documents <strong>with</strong> the Simple API for <strong>XML</strong> (SAX)<br />

3–12<br />

In the SAX2 interface, <strong>XML</strong> namespaces affect the values of the parameters of the<br />

StartElement and EndElement callback procedures, as well as the attribute data in the<br />

attributes parameter of the StartElement callback. There can be slight variations in the way<br />

that the SAX-reader object handles namespace processing, depending on the configuration of<br />

the SAX-reader object.<br />

Affects of namespace processing<br />

In ABL SAX, namespace processing affects the behavior of:<br />

• The StartElement and EndElement callbacks<br />

• Attribute data<br />

Table 3–6 describes the effect of namespace processing on the StartElement and EndElement<br />

callbacks.<br />

Table 3–6: Effect of namespace processing on StartElement and<br />

EndElement<br />

Where namespace processing is<br />

enabled . . .<br />

If an element’s name has a namespace<br />

prefix:<br />

• namespaceURI is the URI associated<br />

<strong>with</strong> the prefix<br />

• localName is the name as given in the<br />

<strong>XML</strong> document, <strong>with</strong>out the prefix<br />

• qName is the name as given in the <strong>XML</strong><br />

document<br />

If an element’s name has no prefix, then:<br />

• namespace URI is empty<br />

• localName is the name as given in the<br />

<strong>XML</strong> document<br />

• qName is the name as given in the <strong>XML</strong><br />

document<br />

If there is a default namespace in effect and<br />

an element name has no prefix, then:<br />

• namespaceURI is the URI of the default<br />

namespace<br />

• localName is the name as given in the<br />

<strong>XML</strong> document<br />

• qName is the name as given in the <strong>XML</strong><br />

document (there is no prefix, since the<br />

default namespace does not specify a<br />

prefix)<br />

Where namespace processing is<br />

suppressed . . .<br />

Whether or not an element’s name has a<br />

namespace prefix:<br />

• namespaceURI is empty<br />

• localName is empty<br />

• qName is the name as given in the <strong>XML</strong><br />

document (including the prefix, if one<br />

exists)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!