Xerces SAX parser ignore the xmlxs:xsi attribute as an attribute of an element
Posted
by
user603301
on Stack Overflow
See other posts from Stack Overflow
or by user603301
Published on 2011-02-04T14:41:03Z
Indexed on
2011/02/04
15:25 UTC
Read the original article
Hit count: 380
Hi,
Using Xerces SAX parser I try to retrieve all elements and their attributes of this XML file:
-------------- Begin XML file to parse ---------------->
<?xml version="1.0" encoding="UTF-8"?>
<invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="my.xsd">
<parties>
(...)
-------------- End XML file to parse ---------------->
When getting the attributes for the element 'invoice', Xerces++ does not insert the 'xmlns:xsi' attribute in the list of 'Attributes' for the element 'invoice'. However, the attribute 'xsi:noNamespaceSchemaLocation' is inserted in the list.
Why? Is there a specific reason from an XML standard point of view ? Is there a way to configure Xerces++ SAX parser so that it inserts this attribute as well? (The documentation on setting the parser properties does not tell how).
Thanks for your help.
© Stack Overflow or respective owner