[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] evaluation of predicate using | mistyped as ||
I wrote a stylesheet where I wanted to use a template with a match pattern doing a union B <xsl:template match="node()[descendant::foo | self::foo | ancestor::foo]"> B B B <xsl:copy> B B B B B <xsl:apply-templates/> B B B </xsl:copy> B </xsl:template>
B <xsl:template match="node()[descendant::foo | self::foo || ancestor::foo]"> B B B <xsl:copy> B B B B B <xsl:apply-templates/> B B B </xsl:copy> B </xsl:template> Now I wonder on how node()[descendant::foo | self::foo || ancestor::foo] is evaluated but I am not sure. Any idea what is supposed to happen if a union operator | and a concat operator || are used in that way in the same predicate of a pattern? I guess a type error and the pattern matches generating the type error would be ignored. Any idea in which way/order B descendant::foo | self::foo || ancestor::foo would be evaluated? For what it's worth, Saxon 12 for an input like <root> B <div> B B B <foo>a</foo> B B B <bar>1</bar> B B B <foo>b</foo> B B B <baz>2</baz> B </div> </root> and a complete stylesheet like <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" B version="3.0" B xmlns:xs="http://www.w3.org/2001/XMLSchema" B exclude-result-prefixes="#all"> B <xsl:template match="node()[descendant::foo | self::foo || ancestor::foo]"> B B B <xsl:copy> B B B B B <xsl:apply-templates/> B B B </xsl:copy> B </xsl:template> B <xsl:mode on-no-match="shallow-skip"/> </xsl:stylesheet> gives a single warning Warning at char 7 in xsl:template/@match on line 7 column 78 of sheet3.xsl: B XPTY0004B An error occurred matching pattern {node()[descendant::foo | self::foo || B ancestor::foo]}: A sequence of more than one item is not allowed as the first argument of B fn:concat() (<foo>, <foo>)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|