You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Neil Sherman <ns...@aimltd.co.uk> on 2001/12/28 11:09:41 UTC

Strange results with DOMParser

Hi all!

I am experiencing some strange results using the DOMParser.  I am trying to 
validate an XML file which contains multiple registration elements.  Each 
registration element has an attribute called "aim:AIMChgStops", however 
when the file is validated I get the error:


Fatal Error at file S:\Work\Dev\txc\TXCVP\Debug\tmt18.xml, line 3394, char 
2
  Message: The attribute 'aim:AIMChgStops' is already used in element 
'Registrat
ion'

Errors occured, no output available

However if I change the attribute name to "aim:AIMChgStps" everything works 
fine and the file is correctly validated.  The schema used to validate the 
file specifies that anything not found in a different namespace should 
simply be ignored (using the lax operative).

Does anybody know why this is happening ? and why simply changing the name 
slightly seems to fix the problem ?

I also tried the DOMCount example to test if it was my code that was 
causing problems but I get the same problem.

Many thanks for your help and time

Neil

Attached :


tmt18BAD.xml		-	Copy of the XML file that causes the error (i.e. with 
attribute names aim:AIMChgStops)
tmt18GOOD.xml	-	Copy of the XML file that works (i.e. with attribute names 
aim:AIMChgStps)
schema.xsd		- 	Schema used to validate> clean:

Re: Strange results with DOMParser

Posted by Tinny Ng <tn...@ca.ibm.com>.
Neil,

I think there is a bug.  Just check in the fix.  FYI the diff below.

Thanks!

Tinny

cvs diff ComplexTypeInfo.cpp (in directory D:\cvswork\xml-xerces\c\src\validators\schema)

Index: ComplexTypeInfo.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/ComplexTypeInfo.cpp,v
retrieving revision 1.25
diff -r1.25 ComplexTypeInfo.cpp
288c288
<         fAttDefs->put((void*)baseName, uriId, retVal);
---
>         fAttDefs->put((void*)retVal->getAttName()->getLocalPart(), uriId, retVal);

*****CVS exited normally with code 1*****

cvs diff SchemaElementDecl.cpp (in directory
D:\cvswork\xml-xerces\c\src\validators\schema)
Index: SchemaElementDecl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SchemaElementDecl.cpp,v
retrieving revision 1.17
diff -r1.17 SchemaElementDecl.cpp
232c232
<                 fAttDefs->put((void*)baseName, uriId, retVal);
---
>                 fAttDefs->put((void*)retVal->getAttName()->getLocalPart(), uriId,
retVal);

*****CVS exited normally with code 1*****

cvs diff SchemaGrammar.cpp (in directory D:\cvswork\xml-xerces\c\src\validators\schema)
Index: SchemaGrammar.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SchemaGrammar.cpp,v
retrieving revision 1.10
diff -r1.10 SchemaGrammar.cpp
178c178
<         const unsigned int elemId = fElemDeclPool->put((void*)baseName, uriId, scope,
retVal);
---
>         const unsigned int elemId = fElemDeclPool->put((void*)retVal->getBaseName(),
uriId, scope, retVal);
196c196
<     const unsigned int elemId = fElemDeclPool->put((void*)baseName, uriId, scope,
retVal);
---
>     const unsigned int elemId = fElemDeclPool->put((void*)retVal->getBaseName(), uriId,
scope, retVal);

*****CVS exited normally with code 1*****


Neil Sherman wrote:

> Hi all!
>
> I am experiencing some strange results using the DOMParser.  I am trying to
> validate an XML file which contains multiple registration elements.  Each
> registration element has an attribute called "aim:AIMChgStops", however
> when the file is validated I get the error:
>
> Fatal Error at file S:\Work\Dev\txc\TXCVP\Debug\tmt18.xml, line 3394, char
> 2
>   Message: The attribute 'aim:AIMChgStops' is already used in element
> 'Registrat
> ion'
>
> Errors occured, no output available
>
> However if I change the attribute name to "aim:AIMChgStps" everything works
> fine and the file is correctly validated.  The schema used to validate the
> file specifies that anything not found in a different namespace should
> simply be ignored (using the lax operative).
>
> Does anybody know why this is happening ? and why simply changing the name
> slightly seems to fix the problem ?
>
> I also tried the DOMCount example to test if it was my code that was
> causing problems but I get the same problem.
>
> Many thanks for your help and time
>
> Neil
>
> Attached :
>
> tmt18BAD.xml            -       Copy of the XML file that causes the error (i.e. with
> attribute names aim:AIMChgStops)
> tmt18GOOD.xml   -       Copy of the XML file that works (i.e. with attribute names
> aim:AIMChgStps)
> schema.xsd              -       Schema used to validate> clean:
>
>   ------------------------------------------------------------------------
>                Name: code.zip
>    code.zip    Type: Zip Compressed Data (application/x-zip-compressed)
>            Encoding: base64
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org