Page 1 of 1

Validate XPATH expressions of errourneous XML

Posted: Wed Nov 07, 2018 9:11 am
by mariomueller
Hi,

if a XML is assigned to a XSD and the XML is not valid, it is not possible to check XPATH expressions in the "XPath/XQuery Baumeister".
Let's asume the following case.

You got an expression in the XSD like

Code: Select all

<xsd:assert test="(sum(Z11/S_QTY/C_C186/D_6060 | Z12/S_QTY/C_C186/D_6060 | Z13/S_QTY/C_C186/D_6060 | Z14/S_QTY/C_C186/D_6060 ) = '100') "/>
where you want to check if the sum of this four nodes = 100.
Now let's asmuse you are validating a XML and you get an validation error; but you expected there is NO validation error.
So you have to evaludate some XPATH expressions to find the single nodes (and their values) which are validated in the XSD assert.
But this XPATH evaluation is not possible.

Would you please change this?

Thanks
Regards
Mario

Re: Validate XPATH expressions of errourneous XML

Posted: Fri Nov 09, 2018 9:51 am
by tavy
Hello Mario,

If the XML document is well-formed you should be able to execute an XPath expression. The schema validation errors should not affect the XPath execution.
Can you tell me what is the XPath expression that you want to execute and what is the error that you obtain when you execute it?
Also, it will be easier if you could send (to support at oxygenxml dot com) some sample file to reproduce the problem.

Best Regards,
Octavian