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

[xsl] Attempting *not* to copy certain nodes


Subject: [xsl] Attempting *not* to copy certain nodes
From: 3rett 3onfield <brett@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 11 Jan 2004 14:36:10 -0500

Hi,

I'm brand new to XSLT but not to XHTML, CSS, etc. So far I'm in love with XSLT's promise, but still pretty confused by its syntax.

I've been using Firebird's built-in XSLT processor:
XSLT Processor VersionVendor: TransformiixVendor
URL: http://www.mozilla.org/projects/xslt/

I'm trying *not* to copy certain nodes in a modified SOAP file:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="RemoveRequestError.xslt"?>
<MapSecuritiesResult>

  <Security>
  <Outcome>RequestError</Outcome>
  <Message>No match found for this security identifier.</Message>
  <Identity>Header</Identity>
  <Delay>7.90625</Delay>
  <Symbol>AA^</Symbol>
  </Security>

  <Security>
  <Outcome>Success</Outcome>
  <Delay>0</Delay>
  <CIK>0001099290</CIK>
  <Cusip>00371F206</Cusip>
  <Symbol>AAC</Symbol>
  <Name>ABLEAUCTIONS COM INC</Name>
  <Market>AMEX</Market>
  <CategoryOrIndustry />
  </Security>

  <Security>
  <Outcome>Success</Outcome>
  <Delay>0</Delay>
  <CIK>0000004611</CIK>
  <Cusip>024591109</Cusip>
  <Symbol>ABL</Symbol>
  <Name>American Biltrite Inc</Name>
  <Market>AMEX</Market>
  <CategoryOrIndustry>Fabricated Plastic &amp; Rubber</CategoryOrIndustry>
  </Security>

...

</MapSecuritiesResult>

I want to copy the <Security> nodes in which the Outcome was Success and want not to copy the ones in which the Outcome was Request Error.

The XSLT file I've used is based on an earlier discussion on this list:
http://www.biglist.com/lists/xsl-list/archives/200307/msg01390.html

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="Root">
<xsl:apply-templates select="MapSecuritiesResult"/>
</xsl:template>


<xsl:template match="Security">
   <xsl:copy>
      <xsl:apply-templates select="Outcome[Success]"/>
   </xsl:copy>
</xsl:template>
</xsl:stylesheet>

Obviously, it's not working or I wouldn't be asking for help. Sorry if I've not searched the FAQ properly. I have attempted to do so, and also to Google to the best of my understanding of the relevant terms.

Brett


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




Current Thread
Keywords