I have the following xml and I would like to unwrap the ph element which is greater than 2.
Input:(xml)
<ul>
<li>
<ph>123</ph>
</li>
<li>
<ph>456</ph>
</li>
<li>
<ph>abc</ph>
</li>
<li>
<ph>xyz</ph>
</li>
</ul>
O/P:
<ul>
<li>
<ph>123</ph>
</li>
<li>
<ph>456</ph>
</li>
<li>
abc
</li>
<li>
xyz
</li>
</ul>
and the below code doesn't work to get the desired output
<sch:pattern>
<sch:rule context="*/ph" role="error">
<sch:assert test="not(node()>2)" sqf:fix="unwrap"><sch:name/> element not
allowed</sch:assert>
<sqf:fix id="unwrap">
<sqf:description>
<sqf:title>unwrap <sch:name/> element</sqf:title>
</sqf:description>
<sqf:replace select="node()"></sqf:replace>
</sqf:fix>
</sch:rule>
Regards, Shil
abcwhich should not compared with a number. - Nico Kutscherauer