Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XML_Schema: problem with [Thread Next] Re: XML_Schema: problem with To: NULL Date: 1/15/2007 12:10:00 PM Thanks a lot -- "Arndt Jonasson" <arndt.jonasson@g...> ???? news:1168420837.952863.181220@i...... > You need to specify the namespace in the XPath expression, otherwise > "element1" is taken to be in "no namespace", which is not the case. > That would work if there were no namespace involved at all. Here is the > modified start of your schema: > > <?xml version="1.0" encoding="UTF-8"?> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns="http://www.aray.com" targetNamespace="http://www.aray.com" > xmlns:ns="http://www.aray.com" > elementFormDefault="qualified"> > > <xs:element name="root" type="rootType"> > <xs:unique name="PK_element1"> > <xs:selector xpath="./ns:element1"></xs:selector> > <xs:field xpath="."></xs:field> > </xs:unique> > </xs:element> > ... > > $ xmllint --noout --schema test.xsd test.xml > test.xml:9: element element1: Schemas validity error : Element > '{http://www.aray.com}element1': Duplicate key-sequence ['1']. > test.xml fails to validate > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
