You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by bg...@clever-age.com on 2002/12/17 11:02:47 UTC

key and keyref element with namespace declaration xerces 2.20

Hi all,

I have an xml stream with attributes which are validate with key element and
keyref element.

here is an exemple of xml stream:
<?xml version='1.0' encoding='UTF-8'?>
<root>
   <node1 personId='10'>
     <a/><b/>
   </node1>
   <node2 id='1'>
     <c/><d/>
   </node2>
   <node2 id='2'>
     <c/><d/>
   </node2>
</root>

and the keys reference in an external xmlschema:
<xs:key name="id">
 <xs:selector xpath="node2"/>
 <xs:field xpath="@id"/>
</xs:key>
<xs:keyref name="personId" refer="id">
 <xs:selector xpath="node1"/>
 <xs:field xpath="@personId"/>
</xs:keyref>

When I validate using sax whitout namespace using
xmlReader.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
xsd);
The xml is not validate by the parser and it is correct.

But when I include namespace both in XML an XMLSchema and parsing using:
xmlReader.setProperty(
"http://apache.org/xml/properties/schema/external-schemaLocation",
"http://www.namespace.com/names "+xsd);
The XML are valide !! and it is not correct
All other definition are working when I valide the XML all except key and
keyref definition.

When I validate with xmlspy it works, but I don't trust in xmlspy validate
(cf simpleType derivation)

Have you got any ideas about this, or is it a bug?

Thanks for your replies.

Bertrand Goupil




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