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 Kiran BV <bv...@hotmail.com> on 2004/05/11 21:18:16 UTC

Difference in XercesC and XercesJ implementation

I am posting this question again. I verified this with the XercesJ parser 
and it does NOT complain.
Why is ID handling different for the C++ and Java version. If we look at 
this from the XML angle, the ID should be unique only with the same document 
not across documents. So why is XercesC giving an error.

---------------------------------------------------------------------------------------------------------------

I had a question on  id handling in xerces.

For eg. if I have schema A.xsd

<xsd:schema id="ABC">
  <xsd:include schemaLocation="B.xsd">
  <xsd:element name="x" type="xsd:string">
</xsd:schema>

schema B.xsd

<xsd:schema id="ABC">     //HERE ABC value is repeated as a id
</xsd:schema>

If we look A.xsd as standalone XML having a id attribute it is unique.
However if I parse A.xsd, I get an error in B.xsd saying the id attribute is
duplicated.
Strangely the schema spec is silent on this. Looks like the xerces schema
parser checks ids in totality including 'includes' and 'imports'. What is
the correct behaviour. Should this resort to a single document with an id
like XML or consider the include and import set for id uniqueness.

Appreciate your help
Thanks
Kiran

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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