Heath, Graham wrote: > Greetings, > I am trying to edit an xml file that has an associated xsd schema. > The schema has within it a uniqueness rule, built from an xpath > expression. > > When I use XMLspy to edit the file everything in hunkydory, but XXE > complains that the xpath expression is invalid and will not therefore > load the schema, with the consequent loss of help when adding elements. > > The line in question is as follows (commented out). The uncommented > version works but of course does not "prove" exactly what we need. > <!-- > <xs:selector xpath=".//DataType | > .//ErrorMessages/Group/ErrorClass/* | > .//ErrorMessages/Group/ErrorClass/ErrorDetail/*"/> > --> > <xs:selector xpath=".//DataType"/> > <xs:field xpath="@cname"/> > > The question is this, can we change the XXE validator, improve the xpath > expression or any other ideas?
Your xpath expression is fine. Simply remove the spaces before and after '|' and it will work: --- <xs:selector xpath=".//DataType|.//ErrorMessages/Group/ErrorClass/*|.//ErrorMessages/Group/ErrorClass/ErrorDetail/*"/> --- XXE uses the "Schema for Schemas" (which is normative) as a first pass to validate schemas. And in the *normative* "Schema for Schemas", white spaces are not allowed here. I know, not allowing spaces here seems really stupid (and this is not consistent with the generic XPath spec). I probably forgot to apply some errata. This will be fixed in next release. > Also, where is a button to press that will invoke the validator, is this > possible, or have I overlooked it? XXE is always in validating mode, but if you need extensive diagnostics, you can: * Save the XML document and you'll automatically have the detailed diagnostics. See also Options|Options, Save Tab, "Automatically Show Validity Tool". May be you'll like this option. * OR use Tools|Check Validity (Ctrl+Shift+V) * OR press the small button at the bottom/left of XXE window.

