xsl-list
[Top] [All Lists]

Re: how do you determine if a property exists?

2004-04-15 00:34:13
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(_at_)yahoo(_dot_)com> 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