HELP with XML to XML transformation using XSLT.

Posted by kaniths on Stack Overflow See other posts from Stack Overflow or by kaniths
Published on 2010-06-15T10:14:53Z Indexed on 2010/06/15 12:52 UTC
Read the original article Hit count: 389

Filed under:
|
|

Am a rookie trying XSLT and XML tranformations for the first time. To start off, i tried a simple sample programs.

I expected the Output in Tree format (maintaining the hierarchy) instead i just get " KING" in single line...

What could be the problem? PS: I use XMLSpy.

Any guideline would be great full. Thanks :)

Input XML:

<ROWSET>
    <ROW>
        <EMPNO>7839</EMPNO>
        <ENAME>KING</ENAME>
    </ROW>
</ROWSET>

XSL used for transformation:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
<xsl:template match="/">
    <Invitation>
        <To>
            <xsl:value-of select="ROWSET/ROW/ENAME"/>
        </To>
    </Invitation>
</xsl:template>

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt