469,343 Members | 5,614 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

XML parsing with XSL

Hello,

Iam trying to parse this xml with name space using the xsl file below but i cant get either the reasoncode or

The file to parse:

<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p302:ViewAccountHistoryResponse xmlns:p302="http://www.americafirst.com/STAccountHistoryOutput">
<errors>
<errorMessage>
<responseCode>0</responseCode>
<reasonCode>0</reasonCode>

</errorMessage>
</errors>
<accountHistory>
<accountHistoryRecord>
<creationDate>2007-02-28</creationDate>
<amount>1000000</amount>
<description>Test Account</description>
<folio>folio01</folio>
<branchID>1</branchID>
<tellerID>2</tellerID>
</accountHistoryRecord>
</accountHistory>
</p302:ViewAccountHistoryResponse>
</soapenv:Body>
</soapenv:Envelope>

The file used to parse;

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tns="http://www.americafirst.com/STAccountHistoryOutput">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<vector>
<xsl:call-template name="errorMessage"/>
<xsl:call-template name="accountHistoryRecord"/>
</vector>
</xsl:template>

<xsl:template name="accountHistoryRecord">
<xsl:for-each select="./tns:afcuMessageOutput/accountHistory/accountHistoryRecord">
<com.bankframe.bo.DataPacket>
<RETAIL__ACCOUNT__MOVEMENT>
<NARRATIVE>
<string>
<xsl:value-of select="description"/>
</string>
</NARRATIVE>
<MOVEMENT__AMOUNT>
<string>
<xsl:value-of select="amount"/>
</string>
</MOVEMENT__AMOUNT>
<OTHER__NARRATIVE>
<string>
<xsl:value-of select="folio"/>
</string>
</OTHER__NARRATIVE>
<TRANSACTION__DATE>
<string>
<xsl:value-of select="creationDate"/>
</string>
</TRANSACTION__DATE>
<USER__ID>
<string>
<xsl:value-of select="tellerID"/>
</string>
</USER__ID>
<MOVEMENT__DATE>
<string>
<xsl:value-of select="creationDate"/>
</string>
</MOVEMENT__DATE>
<PK__DATAPACKET>
<com.bankframe.bo.DataPacket>
<RETAIL__ACCOUNT__MOVEMENT__PK>
<USER__ID>
<string>
<xsl:value-of select="tellerID"/>
</string>
</USER__ID>
<COMPANY__CODE>
<string>1234567890</string>
</COMPANY__CODE>
<MOVEMENT__ID>
<string></string>
</MOVEMENT__ID>
<BRANCH__CODE>
<string>
<xsl:value-of select="branchID"/>
</string>
</BRANCH__CODE>
<MOVEMENT__DATE>
<string>
<xsl:value-of select="creationDate"/>
</string>
</MOVEMENT__DATE>
<JOURNAL__START__TIME>
<string>19990101</string>
</JOURNAL__START__TIME>
</RETAIL__ACCOUNT__MOVEMENT__PK>
</com.bankframe.bo.DataPacket>
</PK__DATAPACKET>
</RETAIL__ACCOUNT__MOVEMENT>
</com.bankframe.bo.DataPacket>
</xsl:for-each>
</xsl:template>
<xsl:template name="errorMessage">
<xsl:for-each select="tns:fcuMessageOutput/errors">
<com.bankframe.bo.DataPacket>
<HEADER__OUTPUT>
<ERROR__MESSAGE>
<string>
<xsl:value-of select="errorMessage/reasonCode"/>
</string>
</ERROR__MESSAGE>
<ERROR__SOURCE>
<string>
<xsl:value-of select="errorMessage/responseCode"/>
</string>
</ERROR__SOURCE>
</HEADER__OUTPUT>
</com.bankframe.bo.DataPacket>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Feb 28 '07 #1
2 1999
dorinbogdan
839 Expert 512MB
Compare the spelling of these XSL lines:
[HTML]<xsl:for-each select="./tns:afcuMessageOutput/accountHistory/accountHistoryRecord">
....
<xsl:for-each select="tns:fcuMessageOutput/errors">
[/HTML]

Which is correct?
afcuMessageOutput or fcuMessageOutput?
Mar 1 '07 #2
dorinbogdan
839 Expert 512MB
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Mar 21 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Gerrit Holl | last post: by
16 posts views Thread by Terry | last post: by
9 posts views Thread by ankitdesai | last post: by
5 posts views Thread by randy | last post: by
13 posts views Thread by Chris Carlen | last post: by
7 posts views Thread by Daniel Fetchinson | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.