RE: [xsl] Attempting *not* to copy certain nodes

Subject: RE: [xsl] Attempting *not* to copy certain nodes
From: 3rett 3onfield <brett@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Jan 2004 21:31:27 -0500
Thank you for the wonderful guidance. I haven't been this pleased with anything programming-related in a very long time.

I've gotten very, very close... I think. I changed the SOAP feed I'd been getting to...

--

?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="CopySuccessSoap.xslt"?>
<soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<soap-env:Body>
<MapSecuritiesResponse
xmlns="http://www.xignite.com/services/";>
<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>


...

         </MapSecuritiesResult>
      </MapSecuritiesResponse>
   </soap-env:Body>
</soap-env:Envelope>

--

...and changed my XSLT to read...

--

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/";
                exclude-result-prefixes="soap-env"
                version="1.0">
<xsl:output method="text" indent="yes" encoding="UTF-8"/>

<xsl:template match="/">
  <xsl:apply-templates select="soap-env:Envelope/soap-env:Body/node()"/>
</xsl:template>

<xsl:template match="*"> <!--synthesize element with the input name-->
  <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

    <xsl:template match="/">
	<xsl:for-each select="MapSecuritiesResult/Security">
		<xsl:if test="Outcome='Success'">
		<xsl:copy-of select="Name"/>, <!--
		--><xsl:copy-of select="Symbol"/>, <!--
		--><xsl:copy-of select="CIK"/>, <!--
		--><xsl:copy-of select="Cusip"/>, <!--
		--><xsl:copy-of select="Market"/>
		<xsl:text>&#13;</xsl:text>
		</xsl:if>
	</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

--

I get no errors in Treebeard (Xalan--thank you for making me look up the difference between Xerxes and Xalan) or Firebird or IE... and also no output. Is it an XPath issue? I've been trying to rule that out, but so far I'm still getting nothing: no errors and no output.

I really appreciate the help. So far I've been working so far through online tutorials, but I think some dead trees would do me good. Should I wait for new editions of the books listed in the FAQ (haven't seen anything in the FAQ or the archives about updates) or head over to the bookstore and buy what's on the shelves?

Brett


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



Current Thread