P
pc.candy
Hi there
I'm having some difficulty with transforming xml data with more than
one namespace defined in the xml.
I'm able to bring back some values of the xml but not others in
another namespace?
For example from the following xml data I can bring bring back the
value for <address> but I can't seem to figure out how to bring back
the <CountryNameCode> which is in another namespace.
I'm not able to manipulate the xml output, but I'm able to customise
the xslt.
Below is the example xml and the xslt I'm trying to use.
/******************* XML data *********************************/
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Response>
<name>ABC Compnay</name>
<Status>
<code>200</code>
<request>geocode</request>
</Status>
<Placemark id="p1">
<address>123 Harris St, Pyrmont, NSW 2009, Australia</address>
<AddressDetails Accuracy="8"
xmlns="urn
asis:names:tc:ciq:xsdschema:xAL:2.0">
<Country>
<CountryNameCode>AU</CountryNameCode>
</Country>
</AddressDetails>
</Placemark>
</Response>
</kml>
/********************************************************/
/**************** XSLT I'm using *********************/
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:asx="http://www.sap.com/abapxml" xmlns:kml="http://
earth.google.com/kml/2.0"
xmlns:AddressDetails="urn
asis:names:tc:ciq:xsdschema:xAL:2.0"
version="1.0">
<xsl:template match="/">
<asx:abap version="1.0">
<asx:values>
<GEOCODE>
<STREET>
<xsl:value-of select="kml:kml/kml:Response/kml
lacemark/
kml:address"/>
</STREET>
<COUNTRY>
<xsl:value-of select="kml:kml/kml:Response/kml
lacemark/
kml:AddressDetails/AddressDetails:Country/
AddressDetails:CountryNameCode"/>
</COUNTRY>
</GEOCODE>
</asx:values>
</asx:abap>
</xsl:template>
</xsl:transform>
/**********************************************************/
Does anyone have any ideas to what I should change in the XSLT??
Thanks.
I'm having some difficulty with transforming xml data with more than
one namespace defined in the xml.
I'm able to bring back some values of the xml but not others in
another namespace?
For example from the following xml data I can bring bring back the
value for <address> but I can't seem to figure out how to bring back
the <CountryNameCode> which is in another namespace.
I'm not able to manipulate the xml output, but I'm able to customise
the xslt.
Below is the example xml and the xslt I'm trying to use.
/******************* XML data *********************************/
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Response>
<name>ABC Compnay</name>
<Status>
<code>200</code>
<request>geocode</request>
</Status>
<Placemark id="p1">
<address>123 Harris St, Pyrmont, NSW 2009, Australia</address>
<AddressDetails Accuracy="8"
xmlns="urn
<Country>
<CountryNameCode>AU</CountryNameCode>
</Country>
</AddressDetails>
</Placemark>
</Response>
</kml>
/********************************************************/
/**************** XSLT I'm using *********************/
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:asx="http://www.sap.com/abapxml" xmlns:kml="http://
earth.google.com/kml/2.0"
xmlns:AddressDetails="urn
version="1.0">
<xsl:template match="/">
<asx:abap version="1.0">
<asx:values>
<GEOCODE>
<STREET>
<xsl:value-of select="kml:kml/kml:Response/kml
kml:address"/>
</STREET>
<COUNTRY>
<xsl:value-of select="kml:kml/kml:Response/kml
kml:AddressDetails/AddressDetails:Country/
AddressDetails:CountryNameCode"/>
</COUNTRY>
</GEOCODE>
</asx:values>
</asx:abap>
</xsl:template>
</xsl:transform>
/**********************************************************/
Does anyone have any ideas to what I should change in the XSLT??
Thanks.