XSLT Transformation for ABAP to XML
I am writing XSLT Transformation for converting ABAP data to XML and to your kind knowledge I d开发者_运维技巧on't know XML or XSLT either but still trying.
PROBLEM:
I don't know how to write transformation code for below XML string:
<INVOICE-PARTICULARS SL-NO="1"> <INVOICE-PARTICULARS>
Here "INVOICE-PARTICULARS" is an element, "SL-NO" is a node of "INVOICE-PARTICULARS", and "1" is a value of database field DLINVSR.
I have tried with below mentioned code but failed in getting result I want.
MY-PRESENT CODE:
<xsl:text disable-output-escaping="yes"><INVOICE-PARTICULARS></xsl:text> <xsl:text disable-output-escaping="yes"><SL-NO></xsl:text> <xsl:value-of select="DLINVSR"/> <xsl:text disable-output-escaping="yes"></SL-NO></xsl:text> <xsl:text disable-output-escaping="yes"></INVOICE-PARTICULARS></xsl:text>
<xsl:template match="INVOICE-PARTICULARS">
<xsl:value-of select="@SL-NO" />
</xsl:template>
You prefix @ to the name of the attribute.
XSLT can only process XML data into something else, not the other way around. Therefore, before applying a transformation, you need to actually get XML from the ABAP data.
The second part of this article covers this: http://www.heidoc.net/joomla/content/view/15/1/
精彩评论