Subject: RE: [xsl] How to prevent copying non-existing elements? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 04 Aug 2009 10:46:47 -0400 |
> 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>
<xsl:for-each select="/moxx:aaa/moxx:bbb"> <moxx:someelement> <xsl:value-of select="."/> </moxx:someelement> </xsl:if>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] How to prevent copying no, Michael Kay | Thread | Re: [xsl] How to prevent copying no, Martin Honnen |
Re: [xsl] How to prevent copying no, Florent Georges | Date | [xsl] Getting sibling nodes from un, Mike Ferrari |
Month |