error in schematron

This should cover W3C XML Schema, Relax NG and DTD related problems.
touch.rajasekar
Posts: 5

error in schematron

Wed Sep 04, 2013 10:49 am

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
adrian
Posts: 2443

Re: error in schematron

Wed Sep 04, 2013 11:12 am

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
touch.rajasekar
Posts: 5

Re: error in schematron

Wed Sep 04, 2013 11:28 am

Hi Adrian,

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

thanks
Rajasekar
touch.rajasekar
Posts: 5

Re: error in schematron

Wed Sep 04, 2013 12:01 pm

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
adrian
Posts: 2443

Re: error in schematron

Thu Sep 05, 2013 4:40 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
touch.rajasekar
Posts: 5

Re: error in schematron

Thu Sep 05, 2013 4:48 pm

Hi Adrian,

Thanks a lot.

After changed the expression its working fine.

thanks
Rajasekar

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 0 guests