[xml] Failing to compile context epression when using xmllint



I'm using xmllint to validate  and xml instance with a schematron schema. I'm getting an error when i use  predicates in the rule element, for the context attribute.

Here's the relevant portion of the schematron schema file:

 <pattern name="Verify that the secondfield tag has only either StartTime or EndTime">
   <rule context="//field[1]">
     <report test="../../@name='StartTime' and not(text() = 'EndTime')">
   Second field is not EndTime..
     </report>
   </rule>


and here's the error:
xmllint -schematron ModuleSchemaSTR.xml  testUserPolicy.xml
ModuleSchemaSTR.xml:38: element rule: Schemas parser error : Failed to compile context _expression_ //field[1]

I checked out the Schematron docs, and they say that we can use an XPath _expression_ for the rule context. What is going wrong here?

Thanks for your help,
-Kiran


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]