Re: [xsl] how do you determine if a property exists?

Subject: Re: [xsl] how do you determine if a property exists?
From: David Buddrige <dbuddrige@xxxxxxxxx>
Date: Thu, 15 Apr 2004 00:34:13 -0700 (PDT)
Let me try that again (bumped the send button by
mistake)

I have the following code in a template I am working
on:

<xsl:attribute name="parent_id">
  <xsl:choose>
    <xsl:when test="@Predecessors=''">1</xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="@Predecessors"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:attribute>

My problem is that sometimes there is no @Predecessor
property in the source document.  So what I want to do
in that instance is to just create a parent_id with a
value of 1.

I have been looking for a function like
"exists(@Predecessor)", but there does not seem to be
such a function... does anyone know of a function that
will return true if a property exists in a source
document?

thanks heaps

David Buddrige.

--- David Buddrige <dbuddrige@xxxxxxxxx> wrote:
> Hi,
> 
> I have the following code in a template I am working
> on:
> 
> <xsl:choose>
>   <xsl:when test="@Predecessors=''">1</xsl:when>
>   <xsl:otherwise><xsl:value-of
> select="@Predecessors"/>
> </xsl:otherwise>
> 				</xsl:choose>
> 



	
		
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html

Current Thread