|
Hi everybody, I'm stuck for a couple of days now to the
following issue, concerning fixed/default attributes and multiple namespaces. Any help would be greatly appreciated... (I'm
using Xerces C++ 2.7.0). Here are two XML Schemas: SCHEMA1.XSD SCHEMA2.XSD And let's consider a simple document: <?xml version="1.0"
encoding="UTF-8"?> I open the document with XercesDOMParser: DOMXMLparser->setValidationScheme(XercesDOMParser::Val_Auto);
and, as expected, there are two
"type" attributes for element "mysubelement". One “type="34"”
with NULL NamespaceURI, which corresponds to the “type” attribute from schema1,
and one “type="simple"” with NamespaceURI="http://schema2", which corresponds
to that defined in the attributeGroup of schema2 (the latter's
value is fixed). Well, now I delete the
type="34" attribute with: DOMNamedNodeMap* atts =
parent->getAttributes(); //
--> parent = mysubelement Xerces deletes the “type="34"”,
but mysubelement still has 2 attributes (!!!) : has "http://schema2" NamespaceURI.
It's like Xerces added an attribute by itself with : In other words, the problem is that Xerces
instantiates an attribute with its fixed value EVEN THOUGH such an attribute
already exists (was never deleted!!!). As a consequence, DOM
ends up with two attributes of the same name, the same value (the fixed one)
and different namespaces (one has NULL, the
other has the correct one). Note that this attribute is defined as
"form="qualified"" in the Schema. Am I missing something? Is this a known
issue?... Thanks in advance... Nicolas |
