validating xml with schema and libxml - expression could not be compiled
by Martin J. Evans other posts by this author
Jul 13 2006 5:53AM messages near this date
view in the new Beta List Site
XML::DOM2
|
Re: validating xml with schema and libxml - expression could not be compiled
& XSLT Hi,
I am attempting to validate an XML file with a schema using XML::LibXML.
A portion of the XML looks like this:
<event name="name" type="type" timestamp="2006-05-19T17:25:00">
<entrants>
<entrant external_id="1" status_id="1"> fred</entrant>
<entrant external_id="2" status_id="1"> fred2</entrant>
<entrant external_id="3" status_id="1"> fred3</entrant>
<entrant external_id="4" status_id="1"> fred4</entrant>
<entrant external_id="5" status_id="1"> fred5</entrant>
</entrants>
</event>
and all the entrant element text should be unique so the xsd says:
<xs:key name="entrantcontent">
<xs:selector xpath="./entrants/entrant"/>
<xs:field xpath="text()"/>
</xs:key>
but I cannot get XML::LibXML to accept the field xpath expression as it always
reports:
Element '{http://www.w3.org/2001/XMLSchema}field', attribute 'xpath': The XPath
expression 'text()' could not be compiled.
As each entrant has attributes and content I only wanted to pick the content as
having to be unique. Is my xpath expression wrong or perhaps text() is not
supported?
Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Martin J. Evans
Petr Pajas
Martin J. Evans
|