Michael Ludwig <mil...@gmx.de> wrote on 04/08/2009 02:52:22 PM:

> kesh...@us.ibm.com schrieb am 07.04.2009 um 22:03:16 (-0400):
> > In the DOM, namespace declaration attributes are displayed as real
> > attributes -- but are in fact optional in many cases.
>
> Thanks keshlam, and Nathan, for answering.
>
> > See current version of the DOM spec for discussions of Namespace
> > Well-Formedness, Namespace Normalization, and normalization during
> > serialization.
>
> http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-
> algorithms.html#normalizeDocumentAlgo
>
> I think this refers rather to the question of which namespace
> declaration attributes are required in order for a given document
> to be namespace-well-formed.
>
> > In the XPath data model, namespace declarations are not considered
> > attributes.
>
> Yes. And I was wondering if Xerces had a DOM parser option to not enlist
> namespace declaration attributes among the ordinary attributes as in:
>
>   NamedNodeMap nodeMap = elm.getAttributes();
>
> If so, I haven't found it. Just asking because coming from LibXML2
> (which I'm not saying is the Specification Incarnate), I'm not used
> to finding namespace declaration attributes together with straight
> attributes when using the DOM parser. So maybe there is some switch
> controlling that behaviour in Xerces?

There is one but you need to be using the DOM Level 3 LSParser [1]. Setting
the "namespace-declarations" parameter to false on its DOMConfiguration [2]
should do the trick.

> Michael Ludwig
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org

Thanks.

[1]
http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSParser
[2]
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMConfiguration


Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to