dmarston 01/08/01 11:46:20 Modified: test/tests/conf/match match08.xsl match08.xml Added: test/tests/conf/match match17.xml match17.xsl match18.xml match18.xsl match19.xml match19.xsl match20.xml match20.xsl match21.xml match21.xsl match22.xml match22.xsl match23.xml match23.xsl match24.xml match24.xsl match25.xml match25.xsl match26.xml match26.xsl Log: Substantial expansion of coverage of predicates in match patterns, especially involving position tests. Revision Changes Path 1.2 +3 -3 xml-xalan/test/tests/conf/match/match08.xsl Index: match08.xsl =================================================================== RCS file: /home/cvs/xml-xalan/test/tests/conf/match/match08.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- match08.xsl 2000/12/15 19:28:19 1.1 +++ match08.xsl 2001/08/01 18:46:19 1.2 @@ -2,9 +2,9 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH08 --> - <!-- Document: http://www.w3.org/TR/xpath --> + <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> - <!-- Section: 2.1 --> + <!-- Section: 5.2 --> <!-- Creator: David Marston --> <!-- Purpose: Test of 2 predicates. --> @@ -15,7 +15,7 @@ </xsl:template> <xsl:template match="foo[@att1='b'][@att2='ok']"> - <xsl:value-of select="name(.)"/> + <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> 1.2 +17 -12 xml-xalan/test/tests/conf/match/match08.xml Index: match08.xml =================================================================== RCS file: /home/cvs/xml-xalan/test/tests/conf/match/match08.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- match08.xml 2000/12/15 19:28:19 1.1 +++ match08.xml 2001/08/01 18:46:19 1.2 @@ -1,21 +1,26 @@ <?xml version="1.0"?> <doc> - <foo att1="c" att2="ok"> - <foo att1="b" att2="ok"> - <foo att1="a" att2="no"> - <baz att1="wrong"/> + <foo att1="c" att2="ok" spot="1"> + <foo att1="b" att2="ok" spot="11"> + <foo att1="a" att2="no" spot="111"> + <baz att1="wrong" spot="1110"/> </foo> + <foo att1="c" att2="no" spot="112"> + <baz att1="wrong" spot="1120"/> + </foo> </foo> - <foo att1="d" att2="ok"> - <foo att1="b" att2="ok"> - <baz att1="wrong"/> + <foo att1="d" att2="ok" spot="12"> + <foo att1="b" att2="ok" spot="121"> + <baz att1="wrong" spot="1210"/> </foo> </foo> - <foo att1="b" att2="no"> - <foo att1="ok" att2="b"> - <baz att1="wrong"/> + <foo att1="b" att2="no" spot="13"> + <foo att1="ok" att2="b" spot="131"> + <baz att1="wrong" spot="1310"/> + </foo> + <foo att1="c" att2="ok" spot="132"> + <baz att1="wrong" spot="1320"/> </foo> </foo> </foo> -</doc> - \ No newline at end of file +</doc> \ No newline at end of file 1.1 xml-xalan/test/tests/conf/match/match17.xml Index: match17.xml =================================================================== <?xml version="1.0"?> <doc> <foo att1="c" att2="ok" spot="1"> <foo att1="b" att2="ok" spot="11"> <foo att1="a" att2="no" spot="111"> <baz att1="wrong" spot="1110"/> </foo> <foo att1="c" att2="no" spot="112"> <baz att1="wrong" spot="1120"/> </foo> </foo> <foo att1="d" att2="ok" spot="12"> <foo att1="b" att2="ok" spot="121"> <baz att1="wrong" spot="1210"/> </foo> </foo> <foo att1="b" att2="no" spot="13"> <foo att1="ok" att2="b" spot="131"> <baz att1="wrong" spot="1310"/> </foo> <foo att1="c" att2="ok" spot="132"> <baz att1="wrong" spot="1320"/> </foo> </foo> </foo> </doc> 1.1 xml-xalan/test/tests/conf/match/match17.xsl Index: match17.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH17 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: David Marston --> <!-- Purpose: Test of 2 predicates, first one being positional. --> <xsl:template match="doc"> <out> <xsl:apply-templates/> </out> </xsl:template> <xsl:template match="foo[2][@att2='ok']"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="text()"/><!-- suppress built-in template for text --> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match18.xml Index: match18.xml =================================================================== <?xml version="1.0"?> <doc> <foo att1="c" att2="ok" spot="1"> <foo att1="b" att2="ok" spot="11"> <foo att1="a" att2="no" spot="111"> <baz att1="wrong" spot="1110"/> </foo> <foo att1="c" att2="no" spot="112"> <baz att1="wrong" spot="1120"/> </foo> </foo> <foo att1="d" att2="ok" spot="12"> <foo att1="b" att2="ok" spot="121"> <baz att1="wrong" spot="1210"/> </foo> </foo> <foo att1="b" att2="no" spot="13"> <foo att1="ok" att2="b" spot="131"> <baz att1="wrong" spot="1310"/> </foo> <foo att1="c" att2="ok" spot="132"> <baz att1="wrong" spot="1320"/> </foo> </foo> </foo> </doc> 1.1 xml-xalan/test/tests/conf/match/match18.xsl Index: match18.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH18 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: David Marston --> <!-- Purpose: Test of predicate with two conditions, one positional. --> <xsl:template match="doc"> <out> <xsl:apply-templates/> </out> </xsl:template> <xsl:template match="foo[position()=2 and @att2='ok']"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="text()"/><!-- suppress built-in template for text --> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match19.xml Index: match19.xml =================================================================== <?xml version="1.0"?> <doc> <foo att1="c" att2="ok" spot="1"> <foo att1="b" att2="ok" spot="11"> <foo att1="c" att2="no" spot="111"> <baz att1="wrong" spot="1110"/> </foo> <foo att1="c" att2="no" spot="112"> <baz att1="wrong" spot="1120"/> </foo> </foo> <foo att1="c" att2="ok" spot="12"> <foo att1="b" att2="ok" spot="121"> <baz att1="wrong" spot="1210"/> </foo> </foo> <foo att1="c" att2="no" spot="13"> <foo att1="ok" att2="b" spot="131"> <baz att1="wrong" spot="1310"/> </foo> <foo att1="c" att2="ok" spot="132"> <baz att1="wrong" spot="1320"/> </foo> </foo> </foo> </doc> 1.1 xml-xalan/test/tests/conf/match/match19.xsl Index: match19.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH19 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: David Marston --> <!-- Purpose: Test of two predicates, second one being positional. --> <xsl:template match="doc"> <out> <xsl:apply-templates/> </out> </xsl:template> <xsl:template match="foo[@att1='c'][2]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="text()"/><!-- suppress built-in template for text --> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match20.xml Index: match20.xml =================================================================== <?xml version="1.0"?> <root> <x spot="a" num="1"/> <x spot="b" num="2"/> <x spot="c" num="3"/> <x spot="d" num="4"/> <x spot="e" num="5"/> <x spot="f" num="6"/> <x spot="g" num="7"/> <x spot="h" num="8"/> <x spot="i" num="9"/> <x spot="j" num="10"/> <x spot="k" num="11"/> <x spot="l" num="12"/> </root> 1.1 xml-xalan/test/tests/conf/match/match20.xsl Index: match20.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH20 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: Scott Boag --> <!-- Purpose: Test of two predicates, both being positional. First predicate reduces the set to {a,c,e,g,i,k}. --> <xsl:template match="/"> <out> <xsl:apply-templates select="root/x"/> </out> </xsl:template> <xsl:template match="x[(position() mod 2)=1][position() > 3]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match21.xml Index: match21.xml =================================================================== <?xml version="1.0"?> <root> <x spot="a" num="1"/> <x spot="b" num="2"/> <x spot="c" num="3"/> <x spot="d" num="4"/> <x spot="e" num="5"/> <x spot="f" num="6"/> <x spot="g" num="7"/> <x spot="h" num="8"/> <x spot="i" num="9"/> <x spot="j" num="10"/> <x spot="k" num="11"/> <x spot="l" num="12"/> </root> 1.1 xml-xalan/test/tests/conf/match/match21.xsl Index: match21.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH21 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: Scott Boag --> <!-- Purpose: Test of three predicates, all being positional. First predicate reduces the set to {a,c,e,g,i,k}. --> <xsl:template match="/"> <out> <xsl:apply-templates select="root/x"/> </out> </xsl:template> <xsl:template match="x[(position() mod 2)=1][position() > 3][position()=2]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match22.xml Index: match22.xml =================================================================== <?xml version="1.0"?> <root> <x spot="a" num="1"/> <x spot="b" num="2"/> <x spot="c" num="3"/> <x spot="d" num="4"/> <x spot="e" num="5"/> <x spot="f" num="6"/> <x spot="g" num="7"/> <x spot="h" num="8"/> <x spot="i" num="9"/> <x spot="j" num="10"/> <x spot="k" num="11"/> <x spot="l" num="12"/> </root> 1.1 xml-xalan/test/tests/conf/match/match22.xsl Index: match22.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH22 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: Scott Boag --> <!-- Purpose: Test of three predicates, all being positional. Different notation. First predicate reduces the set to {a,c,e,g,i,k}. --> <xsl:template match="/"> <out> <xsl:apply-templates select="root/x"/> </out> </xsl:template> <xsl:template match="x[(position() mod 2) > 0][position() > 3][2]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match23.xml Index: match23.xml =================================================================== <?xml version="1.0"?> <root> <x spot="a" num="1"/> <x spot="b" num="2"/> <x spot="c" num="3"/> <x spot="d" num="4"/> <x spot="e" num="5"/> <x spot="f" num="6"/> <x spot="g" num="7"/> <x spot="h" num="8"/> <x spot="i" num="9"/> <x spot="j" num="10"/> <x spot="k" num="11"/> <x spot="l" num="12"/> </root> 1.1 xml-xalan/test/tests/conf/match/match23.xsl Index: match23.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH23 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: Scott Boag --> <!-- Purpose: Test of three predicates, all being positional. Use last() for one. First predicate reduces the set to {a,c,e,g,i,k}. --> <xsl:template match="/"> <out> <xsl:apply-templates select="root/x"/> </out> </xsl:template> <xsl:template match="x[(position() mod 2)=1][position() > 3][last()]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match24.xml Index: match24.xml =================================================================== <?xml version="1.0"?> <root> <x spot="a" num="1"/> <x spot="b" num="2"/> <x spot="c" num="3"/> <x spot="d" num="4"/> <x spot="e" num="5"/> <x spot="f" num="6"/> <x spot="g" num="7"/> <x spot="h" num="8"/> <x spot="i" num="9"/> <x spot="j" num="10"/> <x spot="k" num="11"/> <x spot="l" num="12"/> </root> 1.1 xml-xalan/test/tests/conf/match/match24.xsl Index: match24.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH24 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: David Marston --> <!-- Purpose: Test of three predicates, two being positional. Use last() for one. First predicate reduces the set to {a,c,e,g,i,k}. Second predicate, taken alone, reduces the set to {f,g,h,i,j,k,l}. --> <xsl:template match="/"> <out> <xsl:apply-templates select="root/x"/> </out> </xsl:template> <xsl:template match="x[(position() mod 2)=1][@num > 5][last()]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match25.xml Index: match25.xml =================================================================== <?xml version="1.0"?> <root> <x spot="a" num="1"/> <x spot="b" num="2"/> <x spot="c" num="3"/> <x spot="d" num="4"/> <x spot="e" num="5"/> <x spot="f" num="6"/> <x spot="g" num="7"/> <x spot="h" num="8"/> <x spot="i" num="9"/> <x spot="j" num="10"/> <x spot="k" num="11"/> <x spot="l" num="12"/> </root> 1.1 xml-xalan/test/tests/conf/match/match25.xsl Index: match25.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH25 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: David Marston --> <!-- Purpose: Test of three predicates, two being positional. Use last() for one. First predicate reduces the set to {b,e,h,k}. Second predicate further reduces the set to {h,k}. --> <xsl:template match="/"> <out> <xsl:apply-templates select="root/x"/> </out> </xsl:template> <xsl:template match="x[(@num mod 3)=2][position() > 2][last()]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/match/match26.xml Index: match26.xml =================================================================== <?xml version="1.0"?> <root> <x spot="a" num="1"/> <x spot="b" num="2"/> <x spot="c" num="3"/> <x spot="d" num="4"/> <x spot="e" num="5"/> <x spot="f" num="6"/> <x spot="g" num="7"/> <x spot="h" num="8"/> <x spot="i" num="9"/> <x spot="j" num="10"/> <x spot="k" num="11"/> <x spot="l" num="12"/> </root> 1.1 xml-xalan/test/tests/conf/match/match26.xsl Index: match26.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: MATCH26 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.2 --> <!-- Creator: David Marston --> <!-- Purpose: Test of three predicates, two being positional. First predicate reduces the set to {a,c,e,g,i,k}. Second predicate further reduces the set to {c}. Third predicate, taken alone, reduces the set to {a,b,c,d,e,f,g,h,i}. --> <xsl:template match="/"> <out> <xsl:apply-templates select="root/x"/> </out> </xsl:template> <xsl:template match="x[(position() mod 2)=1][2][@num < 10]"> <xsl:value-of select="@spot"/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]