2010 Jul 27 4:40 PM
I am trying the following code...
<xsl:template match="test">
<p>
This is
<xsl:value-of select="test-Name"/>
from
<xsl:value-of select="test-city"/>
</p>
</html>
</xsl:template>
</xsl:transform>
I am expecting the output to be...
This is XYZ (Value in Name) from TEXAS ( value in city)..
however i am getting ...
This is from.
Let me know how to fix the issue?
2010 Jul 27 11:39 PM
You didn't give us neither the source, nor the target, nor how you run the transformation. So I did a test like that, and it works:
ABAP:
DATA l_xml TYPE string.
DATA l_xml2 TYPE string.
l_xml = '<?xml version="1.0" encoding="iso-8859-1"?><test>'
& '<test-Name>Sandra</test-Name><test-city>Paris</test-city></test>'.
CALL TRANSFORMATION zzysro
SOURCE XML l_xml
RESULT XML l_xml2.
write / l_xml2.
Transformation:
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:template match="test"><p>This is <xsl:value-of select="test-Name"/> from
<xsl:value-of select="test-city"/></p></xsl:template>
</xsl:transform>
Displayed Result:
<?xml version="1.0" encoding="iso-8859-1"?>#<p>This is Sandra from Paris</p>