tags:

views:

89

answers:

2

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"&gt;
<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>

A: 

Well, the only thing that I see is that you miss the closing element </xsl:stylesheet> in the XSL. Other than that, I think the XSL is OK, and if I use it (from Java code) I get <Invitation><To>KING</To></Invitation>, which is, I presume, what you expect.

MarcoS
A: 

Sorry i undst how this one works.. WHen i viewed the source in IE the expected outcome is achieved. Thanks guys :)

kaniths