xsl-list
[Top] [All Lists]

RE: [xsl] How to prevent copying non-existing elements?

2009-08-04 09:04:04

In pseudo code I need something like

<xsl:template match="/">
   ....
  "if /moxx:aaa/moxx:bbb exists" then (
  <moxx:someelement>
      <xsl:value-of select="/moxx:aaa/moxx:bbb"/>
  </moxx:someelement>)
  ....

How can I code this in XSLT ?


   <xsl:if test="/moxx:aaa/moxx:bbb">
     <moxx:someelement>
       <xsl:value-of select="/moxx:aaa/moxx:bbb"/>
     </moxx:someelement>
   </xsl:if>

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--