[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] XSL and XML Help


Subject: [xsl] XSL and XML Help
From: "Cho, Minho" <minho.cho@xxxxxxxxxx>
Date: Fri, 13 Oct 2006 08:07:20 -0400

I have an XSL file that grabs objects to form a table from an XML file. 
However I only want it to grab certain objects with a certain tag on 
them. 
For example: 
XML file has: 
<?xml version="1.0" encoding="UTF-8"?>
<infoObject> 
<infoObjectDetail title='Field'>Test Field</infoObjectDetail> 
<infoObjectDetail title='Description'>Test Desc</infoObjectDetail> 
<infoObjectDetail title='Object'>Test Object</infoObjectDetail> 
<infoObjectDetail title='Source'>Test Source</infoObjectDetail> 
</infoObject> 
XSL file: 
<xsl:for-each select="infoObjectDetail"> 
<td><xsl:value-of select="." /> &#160;</td> 
</xsl:for-each> 
I want it so that it skips over the field of "Description" and moves 
onto the next field.   But because the XML file has infoObjectDetail for all
of them I'm not too sure how to just grab certain objects.
I've tried:
		
 <xsl:for-each select="//infoObject">
    <tr>
      <xsl:for-each select="infoObjectDetail">
        <td>
          <xsl:if test=". != 'Test Field'">
            <xsl:value-of select="." />
          </xsl:if>
          <xsl:text>&#160;</xsl:text>
        </td>
      </xsl:for-each>
    </tr>
  </xsl:for-each>
But that only gets rid of the field containing the data - instead of the
title name.
Any ideas? 



Minho Cho
Software Engineer
Pratt & Whitney - Business Intelligence
860 - 557 - 1509 - Office
Minho.Cho@xxxxxxxxxx


Current Thread
Keywords