开发者

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">&lt;INVOICE-PARTICULARS&gt;</xsl:text>
<xsl:text disable-output-escaping="yes">&lt;SL-NO&gt;</xsl:text>
<xsl:value-of select="DLINVSR"/>
<xsl:text disable-output-escaping="yes">&lt;/SL-NO&gt;</xsl:text>
<xsl:text disable-output-escaping="yes">&lt;/INVOICE-PARTICULARS&gt;</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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜