This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Determining if an element exists within any tag of a specified name...


Thanks for the advice Joerg; those links you sent helped.  

However, I have another question that hopefully someone can answer.  The code 
below is part of what is used to construct a table listing the characteristics 
of a bunch of "attrlabl" tags.


<xsl:for-each select="attr[attrlabl != '']">
  <tr>

  ....

  <xsl:choose> 
  <!-- Write the attrtype property if it is defined. -->
  <xsl:when test="current()[(attrtype !='')]"> <xsl:for-each select="attrtype"> 
  <td><font color="#000000" face="Arial, Helvetica, sans-serif" 
size="2"><xsl:value-of select="."/></font></td>
  </xsl:for-each> </xsl:when> <xsl:otherwise> 

  <!-- If the property was not defined, yet the table has the heading "Type" 
because some other
     attribute in the currently selected tag ("current()") has this property 
defined, then write out
     three dashes in the table cell-->
  <xsl:if test="..[($any$ attr/attrtype != '')]"> 
  <td><font color="#000000" face="Arial, Helvetica, sans-serif" size="2">---
</font></td>
  </xsl:if> </xsl:otherwise> </xsl:choose> 

  <!-- Write the atoutwid property-->
  <xsl:choose> <xsl:when test="current()[(atoutwid != '')]"> <xsl:for-each 
select="atoutwid"> 
  <td><font color="#000000" face="Arial, Helvetica, sans-serif" 
size="2"><xsl:value-of select="."/></font></td>
  </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:if test="..[($any$ 
attr/atoutwid != '')]"> 
  <td><font color="#000000" face="Arial, Helvetica, sans-serif" size="2">---
</font></td>
  </xsl:if> </xsl:otherwise> </xsl:choose>

  ....code repeated for all required properties
  
  </tr>
</xsl:for-each>


When I try to load the code in IE6 I get the following message:
> Expected token 'eof' found '['. ..-->[<--($any$ attr/attrtype != '')]

I know that this code is checking to see if the "attrtype" tag exists for any 
of the "attr" elements in the XML file.  However, I suspect that the $any$ 
parameter is not accepted or my syntax is incorrect.  Is there another way to 
do do this?

Thanks in advance for any help.

Mike


---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]