Subject: RE: [xsl] how do you determine if a property exists? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 15 Apr 2004 15:04:19 -0400 |
<xsl:template match="/info"> <results> <xsl:for-each select='mytag'> <xsl:element name='myelement'> <xsl:choose> <xsl:when test='@duration != ""'> <xsl:copy-of select='@duration'/> </xsl:when> <xsl:otherwise> <xsl:attribute name='duration'>1</xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:for-each> </results> </xsl:template>
<xsl:template match="/info"> <results> <xsl:for-each select='mytag'> <myelement duration='1'> <xsl:copy-of select='@duration[normalize-space()]'/> </myelement> </xsl:for-each> </results> </xsl:template>
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 do you determine if a, Passin, Tom | Thread | RE: [xsl] how do you determine if a, David Buddrige |
RE: [xsl] Incrementing position in , Andreas L. Delmelle | Date | Re: [xsl] Context Assignment Questi, Wendell Piez |
Month |