p:choose or xsl:choose

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

p:choose or xsl:choose

Duane Gran
Is it possible combine XSL and XUpdate logic for conditionals within  
XPL?  I have something like the following:

<xsl:choose>
  <xsl:if when="/a[b='c']">
    <xu:xupdate select="/x/y/z">blah</xu:xupdate>
   </xsl:if>
</xsl:choose>

No matter what conditional I put in the "when" clause, the xu:xupdate  
command is executed.  I've also tried to use XSL "match" with no  
better luck.  I see that there is a p:choose syntax for conditionally  
executing a different processor.  Should I use that instead?

Duane



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: p:choose or xsl:choose

Oliver Charlet
Duane,

you have to use two separate processors (xslt and xupdate) to do that.

If you want to use XUpdate to change the sample document, you can do that like this:
 <xu:if test="/a[b='c']">
   <xu:xupdate select="/x/y/z">blah</xu:xupdate>
  </xu:if>

please note, that your sample xml has errors. there is not xsl:if with a when attribute. You can either use choose / when / otherwise
or the if tag. Both IF and WHEN tags have a TEST attribute for the XPath used as the condition.

:oliver

Duane Gran schrieb:
Is it possible combine XSL and XUpdate logic for conditionals within  XPL?  I have something like the following:

<xsl:choose>
 <xsl:if when="/a[b='c']">
   <xu:xupdate select="/x/y/z">blah</xu:xupdate>
  </xsl:if>
</xsl:choose>

No matter what conditional I put in the "when" clause, the xu:xupdate  command is executed.  I've also tried to use XSL "match" with no  better luck.  I see that there is a p:choose syntax for conditionally  executing a different processor.  Should I use that instead?

Duane


-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

-- 
-----------------------
oliver charlet
software development

11-041 Olsztyn, Poland

[hidden email]
-----------------------


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws