11-30-2008 2:40 AM
Hi,
I'm using this function to generate the data to dom.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
NAME = 'ACCESOS'
DATAOBJECT = ACCESOS[]
IMPORTING
DATA_AS_DOM = L_DOM
CHANGING
DOCUMENT = M_DOCUMENT
EXCEPTIONS
ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
My issue is when i'm using this function it will generate the xml in this format
<?xml version="1.0" encoding="utf-8" ?>
- <ACCESOS>
- <item>
- <SOCIO>
<NUMERO>00045050</NUMERO>
<REPOSICION>0</REPOSICION>
<NOMBRE>MOISES MORENO</NOMBRE>
- <TURNOS>
<LU>T1</LU>
<MA>T2</MA>
<MI>T3</MI>
<JU>T4</JU>
<VI>T5</VI>
<SA>T6</SA>
<DO>T7</DO>
</TURNOS>
</SOCIO>
</item>
</ACCESOS>
May I know how could I change the "<item" and "</item>" description to "<testing>" and "</testing>". Kindly help me on this.
Thanks.
11-30-2008 4:10 AM
Hi
Check this link:
Check this link:
http://www.devguru.com/technologies/xmldom/quickref/node_nodeName.html
Regards
Neha
Edited by: Neha Shukla on Nov 30, 2008 9:51 AM
11-30-2008 5:06 PM
Hello
You can do a simple XML-XML transformation using the following XSLT stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
<xsl:template match="*">
<xsl:apply-templates select="self::*" mode="copy"/>
</xsl:template>
<xsl:template match="item">
<xsl:element name="testing">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="*" mode="copy">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
Regards
Uwe