Whats wrong with this <xsl:when test="@order='1'">

Whats wrong with this <xsl:when test="@order='1'">

Post by Kim Jakobs » Fri, 21 Jun 2002 04:17:23



Hi All

I have an xsl file where I want to make a condition usen xsl:choose. The
problem was that I could not get the xsl:when part to work.

When I did the following:

I always got an error saying "Unknown char in line..." at some point in the
xml file that was not related to the xsl:when part.

So by pure change I saw an example where someomne wrote

and that made it work for me.

Can anyone tell me the differense between the two ways of make the test in
xsl:when?

Regards
Kim

 
 
 

Whats wrong with this <xsl:when test="@order='1'">

Post by Marro » Fri, 21 Jun 2002 04:45:28


Hi Kim,

Quote:>Can anyone tell me the differense between the two ways of make the test in
>xsl:when?


is an XPath expression and perfectly valid, whereas...


looks very much like an old (obsolete!) XSL Pattern test.

What does your <xsl:stylesheet> look like?...

this...
  <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.veryComputer.com/;>
or this...
  <xsl:stylesheet xmlns:xsl="http://www.veryComputer.com/;>

If it is the latter then you are using the old, MS specific (and obsolete)
XSL-WD (Working Draft) and hence all your tests will have to be XSL Pattern
expressions.
In XSL Pattern there was not concept of booleans, strings, etc. so all test
expressions had to resolve to a node-set - where true was evaluated if the
node-set was not empty.

Hope this helps
Marrow
http://www.veryComputer.com/ - home of Xselerator (XSLT IDE and de*)
http://www.veryComputer.com/


>Hi All

>I have an xsl file where I want to make a condition usen xsl:choose. The
>problem was that I could not get the xsl:when part to work.

>When I did the following:

>I always got an error saying "Unknown char in line..." at some point in the
>xml file that was not related to the xsl:when part.

>So by pure change I saw an example where someomne wrote

>and that made it work for me.

>Can anyone tell me the differense between the two ways of make the test in
>xsl:when?

>Regards
>Kim