|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Attempting *not* to copy certain nodes
At 2004-01-15 20:20 -0500, 3rett 3onfield wrote:
Date: Thu, 15 Jan 2004 07:07:37 -0500 From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Subject: RE: Attempting *not* to copy certain nodes At 2004-01-14 21:31 -0500, 3rett 3onfield wrote: ... Change the second to match the response element and see what happens. Note that in order to match the response element, and I now see for every other element in your message body, that you'll have to add a namespace prefix. It is a FAQ that unprefixed element and attribute names in XPath only match constructs in no namespace. In your input message you are using a namespace through the default namespace mechanism. XPath 1.0 never uses the default namespace. Below is your example modified with namespace prefixes where required by XPath, being run by Saxon. I hope this helps. ................... Ken
.... </MapSecuritiesResult>
</MapSecuritiesResponse>
</soap-env:Body>
</soap-env:Envelope>t:\ftemp>type brett.xsl
<?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/"
xmlns:svcs="http://www.xignite.com/services/"
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="svcs:MapSecuritiesResponse">
<xsl:for-each select="svcs:MapSecuritiesResult/svcs:Security">
<xsl:if test="svcs:Outcome='Success'">
<xsl:copy-of select="svcs:Name"/>, <!--
--><xsl:copy-of select="svcs:Symbol"/>, <!--
--><xsl:copy-of select="svcs:CIK"/>, <!--
--><xsl:copy-of select="svcs:Cusip"/>, <!--
--><xsl:copy-of select="svcs:Market"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>t:\ftemp>saxon -o brett.txt brett.xml brett.xsl t:\ftemp>type brett.txt ABLEAUCTIONS COM INC, AAC, 0001099290, 00371F206, AMEX t:\ftemp>
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-11-X Practical Formatting Using XSL-FO Member of the XML Guild of Practitioners: http://XMLGuild.info Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








