Page 1 of 1

error in schematron

Posted: Wed Sep 04, 2013 10:49 am
by touch.rajasekar
Hi Team,

when i try to validate the my xml into schematron. It's throw the following error.

"The value is not a node-set"

It's validate against the DTD and other schematron validation also succeed.

I am not sure what error i did in my xml.

please help me to sort the problem.

Thanks in Advance
Rajasekar

Re: error in schematron

Posted: Wed Sep 04, 2013 11:12 am
by adrian
Hello,
"The value is not a node-set"
This is a generic error that is usually reported when the result of an XPath is an atomic value instead of the node-set expected in that context.

You'll have to provide more details about the context of the error.

Regards,
Adrian

Re: error in schematron

Posted: Wed Sep 04, 2013 11:28 am
by touch.rajasekar
Hi Adrian,

Thanks for your reply. i will check my file and get back.

thanks
Rajasekar

Re: error in schematron

Posted: Wed Sep 04, 2013 12:01 pm
by touch.rajasekar
Hi Adrian,

While checking my schematron, i found that the following syntax have error. If i remove the below coding from schema. The xml has validated successfully.

SCHEMATRON:
<pattern id="disp-formula">
<rule context="//disp-formula">
<assert test="@content-type='numbered' | @content-type='unnumbered'">FATAL WARNING!!!! Display formulae must be either numbered or unnumbered.</assert>
</rule>
</pattern>

XML
<disp-formula id="M0001" content-type="numbered">
<label>1</label>
<alternatives>
<graphic xlink:href="Math/M0001.jpg"/>
<mml:math display="block">
<mml:mrow>
<mml:mi>P</mml:mi>
<mml:mo>&#x003D;</mml:mo>
<mml:mn>0.5</mml:mn>
<mml:mo>&#x00B7;</mml:mo>
<mml:mi>&#x03C1;</mml:mi>
<mml:mo>&#x00B7;</mml:mo>
</mml:mrow>
</mml:math>
<tex-math notation="LaTeX" version="MathJax">
<![CDATA[
\usepackage\{}
\begin{document}
[\[ P=0.5\middot \rho \middot \]]
\end{document}
]]>
</tex-math>
</alternatives>
</disp-formula>

Could you please help me any error in the syntax?

Thanks
Rajasekar

Re: error in schematron

Posted: Thu Sep 05, 2013 4:40 pm
by adrian
Hi,

I don't have your full context, so this may be different for you, but when I tested this, I got an error because of the assert expression:

Code: Select all

XPTY0004: Required item type of first operand of '|' is node(); supplied value has item type xs:string
I replaced in the assert expression the '|' character with a logical 'or' and then it worked fine:

Code: Select all

<assert test="@content-type='numbered' or @content-type='unnumbered'">FATAL WARNING!!!! Display formulae must be either numbered or unnumbered.</assert>
'|' composes a single node-set from two nodes or node-sets, but this is not what the expression from this assert was supposed to do.

Regards,
Adrian

Re: error in schematron

Posted: Thu Sep 05, 2013 4:48 pm
by touch.rajasekar
Hi Adrian,

Thanks a lot.

After changed the expression its working fine.

thanks
Rajasekar