## error in schematron

This should cover W3C XML Schema, Relax NG and DTD related problems.
touch.rajasekar
Posts: 5
Joined: Tue Sep 03, 2013 5:39 pm

### error in schematron

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.

Rajasekar

Posts: 2551
Joined: Tue May 17, 2005 4:01 pm

### Re: error in schematron

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,
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

touch.rajasekar
Posts: 5
Joined: Tue Sep 03, 2013 5:39 pm

### Re: error in schematron

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

thanks
Rajasekar

touch.rajasekar
Posts: 5
Joined: Tue Sep 03, 2013 5:39 pm

### Re: error in schematron

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>
<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>

Thanks
Rajasekar

Posts: 2551
Joined: Tue May 17, 2005 4:01 pm

### Re: error in schematron

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,
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

touch.rajasekar
Posts: 5
Joined: Tue Sep 03, 2013 5:39 pm