on 02-03-2011 4:07 PM
Dear all,
I would like to create a generic XSL mapping
In the target structure I would like to insert the value of DOCNUM
<xsl:template match="DOCNUM">
<xsl:value-of select="/ORDERS/IDOC/EDI_DC40/DOCNUM" />
</xsl:template>
That works.
Now, the mapping should become generic. I would like to use this for ORDERS, DELVRY and so on.
I try tor create it this way.
<xsl:value-of select="/../IDOC/EDI_DC40/DOCNUM" />
<xsl:value-of select="/IDOC/EDI_DC40/DOCNUM" />
<xsl:value-of select="/DOCNUM" />
So I don't want to use ORDERS in the select statement.
How to get this work for all IDOC types?
Regards
Chris
Hi Christian,
I understand you want to refer DOCNUM which is under ORDERS, DELVRY and so on.
Below statement will refer DOCNUM in entire XML (it can be any where).
<xsl:value-of select="//DOCNUM" />
I think, now you want it to be more specific, please refer this [Link1|http://www.zvon.org/xxl/XSLTutorial/Output/example70_ch17.html ], you can help your self.
Regards,
Raghu_Vamsee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just define this
SOURCE
<?xml version="1.0" encoding="UTF-8"?>
<XXXXXXX>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<MANDT>310</MANDT>
<DOCNUM>0000000001021184</DOCNUM>
<DOCREL>XX</DOCREL>
<STATUS>XX</STATUS>
<DIRECT>1</DIRECT>
</EDI_DC40>
</IDOC>
</XXXXXXX>
XLS
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="IDOC">
<DOCNUM>
<xsl:value-of select="EDI_DC40/DOCNUM" />
</DOCNUM>
</xsl:template>
</xsl:stylesheet>
RESULT
<?xml version="1.0" encoding="UTF-8"?>
<DOCNUM>0000000001021184</DOCNUM>
Thanks
Edited by: Rodrigo Alejandro Pertierra on Feb 3, 2011 2:28 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.