[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: [relax-ng-comment] Re: Mixing patterns and (empty) tags
"Embedded Schematron Rules in RELAX-NG" was supported by VBRELAXNG. http://www.geocities.co.jp/SiliconValley-Bay/4639/vbrelaxng/vbrelaxng.html Since it is mounting on a still easy level, at least the following description can be tried. > <element name="example" xmlns="http://relaxng.org/ns/structure/1.0"> > <sch:pattern name="Check the text content" > xmlns:sch="http://www.ascc.net/xml/schematron"> > <sch:rule context="example"> > <sch:assert test="text()[1] = 'The quick '" >The first text > node must be 'The quick '.</sch:assert> > <sch:assert test="text()[2] = ' brown fox '" >The second > text node must be ' brown fox '.</sch:assert> > <sch:assert test="text()[3] = ' jumped over the lazy dog 5 >times.'">The third text node must be ' jumped over the lazy dog 5 >times.'.</sch:assert> > <sch:assert test="normalize-space(.) = 'The quick brown fox >jumped over the lazy dog 5 times.'">The whole text must be 'The quick >brown fox jumped over the lazy dog 5 times.'.</sch:assert> > </sch:rule> > </sch:pattern> > <interleave> > <text/> > <element name="a"><empty/></element> > <element name="b"><empty/></element> > <element name="c"><empty/></element> > </interleave> ></element> However, the following corrections are required in VBRELAXNG. <sch:rule context="example"> --> <sch:rule context="self::node()"> The relative path which made the present node to be examined the current node is specified to be a context attribute.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC