|
next
|
 Subject: Help creating a comma delimited file Author: Chris Youll Date: 06 May 2009 10:26 PM
|
Hi,
I am trying to create a comma delimited output from a SOAP response using a stylesheet and I am not getting desired results. I have added sample XML input, the XSLT that I created and the output that I am receiving. I am not sure why I am receiving the 0 and X’s as the output. I would appreciate any help solving this.
Thank you,
Chris
-------------------XML File---------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:archns1="archserver.wsdl.dataflux.com"
xmlns:archns2="archserver.xsd.dataflux.com">
<SOAP-ENV:Body>
<archns2:SendArchitectServiceRequest>
<serviceName>ValidateAddressCondense.dmc</serviceName>
<fieldDefinitions>
<fieldName>ID</fieldName>
<fieldType>STRING</fieldType>
<fieldLength>15</fieldLength>
</fieldDefinitions>
<fieldDefinitions>
<fieldType>STRING</fieldType>
<fieldLength>50</fieldLength>
</fieldDefinitions>
<fieldDefinitions>
<fieldName>addr2</fieldName>
<fieldType>STRING</fieldType>
<fieldLength>50</fieldLength>
</fieldDefinitions>
<fieldDefinitions>
<fieldName>city</fieldName>
<fieldType>STRING</fieldType>
<fieldLength>35</fieldLength>
</fieldDefinitions>
<fieldDefinitions>
<fieldName>state</fieldName>
<fieldType>STRING</fieldType>
<fieldLength>28</fieldLength>
</fieldDefinitions>
<fieldDefinitions>
<fieldName>zip</fieldName>
<fieldType>STRING</fieldType>
<fieldLength>10</fieldLength>
</fieldDefinitions>
<dataRows>
<value>99</value>
<value>2530 S FOOTHILL RD</value>
<value></value>
<value>IDAHO FALLS</value>
<value>ID</value>
<value>83401</value>
</dataRows>
</archns2:SendArchitectServiceRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--------------Stylesheet -----------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="fieldDefinitions">
<xsl:for-each select="fieldName">
<xsl:text>x</xsl:text>
</xsl:for-each>
</xsl:template>
<xsl:template match="dataRows">
<xsl:text> </xsl:text>
<xsl:text>"</xsl:text>
<xsl:for-each select="value">
<xsl:value-of select="."/>
<xsl:text>","</xsl:text>
</xsl:for-each>
</xsl:template>
<xsl:template match="varValue">
<xsl:for-each select="varValue">
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:if test="position() = last()">
<xsl:text>"</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
----------------Output ---------------
0
x
x
x
x
x
x
x
x
xxxxx
"99","2530 S FOOTHILL RD","","IDAHO FALLS","ID","83401","2530 S FOOTHILL RD","","AMMON","ID","83401-5937","US","0"," "
|
|
|