xsl-list
[Top] [All Lists]

[xsl] XSL and XML Help

2006-10-13 05:07:43
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(_dot_)Cho(_at_)pw(_dot_)utc(_dot_)com



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>