Pravesh Kumar
Pravesh Kumar

Reputation: 37

What is the difference between use of , (comma) and use of | (pipe) in 'except' xslt?

  <xsl:apply-templates select="node() except ($Abbr, $PrPostNum, $DocType, $DocSize)"/>
  <xsl:apply-templates select="node() except ($Abbr | $PrPostNum | $DocType | $DocSize)"/>

Want to know the difference between above......

Upvotes: 0

Views: 143

Answers (1)

Michael Kay
Michael Kay

Reputation: 163595

There is no difference. In both cases, all the nodes in $Abbr, $pRPostNum, etc are eliminated from the set of nodes selected by node(). The only difference is that with the union operator |, duplicates in the right-hand side of except() are eliminated first, but such duplicates have no effect on the final result so it doesn't matter whether you do this or not -- except possibly in terms of performance (which, of course, depends entirely on the implementation).

Upvotes: 1

Related Questions