web services - transforming XML to XSL issue -
i relativity new web services / soap / xml , xslt , close grasping basics of guidance/help stuck @ moment.
i have web service pulls info response (using sharepoint workflow)
response request-
<!-- language: xml --> <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <gethouseholdbyrefresponse xmlns="http://schemas.*****.co.uk/*****/****/**"> <gethouseholdbyrefresult xmlns:i="http://www.w3.org/2001/xmlschema-instance"> <errorcode>0</errorcode> <errormessage i:nil="true" /> <success>true</success> <household> <userfieldlist /> <caseworkercontactname></caseworkercontactname> <caseworkercontacttelno></caseworkercontacttelno> <companycode>001 </companycode> <contactkey>00000</contactkey> <correspondenceaddress /> <correspondencedesignation></correspondencedesignation> <correspondencepostcodevalue i:nil="true" /> <correspondencepreamble></correspondencepreamble> <description>joe bloggs </description> <displaycompanycodes></displaycompanycodes> <emailaddress></emailaddress> <forwardingaddress /> <forwardingdesignation></forwardingdesignation> <forwardingpostcodevalue i:nil="true" /> <forwardingpreamble></forwardingpreamble> <id>000000000</id> <isvulnerable>false</isvulnerable> <nextofkinaddress /> <nextofkindesignation></nextofkindesignation> <nextofkinname></nextofkinname> <nextofkinphone></nextofkinphone> <nextofkinpostcodevalue i:nil="true" /> <nextofkinpreamble></nextofkinpreamble> <numberofchildren>0</numberofchildren> <postcodevalue>ab1 c23 </postcodevalue> <propertyreference i:nil="true" /> <reference>000000000 </reference> <referralcontactname></referralcontactname> <referralcontacttelno></referralcontacttelno> <size>1</size> </household> </gethouseholdbyrefresult> </gethouseholdbyrefresponse> </s:body> </s:envelope>
as can see returns lot of information, don’t need, want pick out element description example
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" encoding="utf- 8" indent="no"/> <xsl:template match="/"> <xsl:value-of select="description"/> </xsl:template> </xsl:stylesheet>
i nil back, there no description. know there description when test next code transforms entire result string, suggests have got of xsl language wrong when trying specify 1 element
<xsl:output method="xml" encoding="utf- 8" indent="no"/> <xsl:template match="/"> <xsl:value-of select="*"/> </xsl:template> </xsl:stylesheet>
any help appreciated
also, if there people out there on subject interested hear if recommend resources larn this. thanks
yes, there is description, (1) not kid of /
root node, , (2) , ancestors have namespaces need define , utilize when addressing them, e.g.:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:x="http://schemas.*****.co.uk/*****/****/**" exclude-result-prefixes="s x"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <output> <xsl:value-of select="s:envelope/s:body/x:gethouseholdbyrefresponse/x:gethouseholdbyrefresult/x:household/x:description"/> </output> </xsl:template> </xsl:stylesheet>
xml web-services xslt soap
No comments:
Post a Comment