This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
please help: why <xsl:foreach select="node()"> not works here?
- To: xsl-list at mulberrytech dot com
- Subject: please help: why <xsl:foreach select="node()"> not works here?
- From: Jia Ming Li <jmingli at ilux dot com>
- Date: Wed, 24 May 2000 20:20:25 -0700
- Reply-To: xsl-list at mulberrytech dot com
My XML has a structure:
Can somebody please help me figure out what was wrong with my XSL
page.
test.xml
----------------------------------------------------------------------------
------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<RESULT>
<DATA>
<ROW>
<A>a1</A>
<B>b1</B>
</ROW>
<ROW>
<A>a2</A>
<B>b2</B>
</ROW>
</DATA>
<DATA>
<ROW>
<D>d1</D>
<E>e1</E>
<F>f1</F>
</ROW>
<ROW>
<D>d2</D>
<E>e2</E>
<F>f2</F>
</ROW>
</DATA>
</RESULT>
----------------------------------------------------------------------------
-------
test.xsl
----------------------------------------------------------------------------
-----
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<HTML>
<BODY>
<xsl:for-each select="RESULT/DATA">
<TABLE BORDER="2">
<xsl:for-each select="ROW">
<TR>
<xsl:for-each select="node()">
<TD><xsl:value-of select="."/></TD>
</xsl:for-each>
</TR>
</xsl:for-each>
</TABLE>
<BR/>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
----------------------------------------------------------------------------
------------------
I want the ouput to be like this.
<TABLE>
<TR><TD>a1</TD><TD>b1</TD></TR>
<TR><TD>a2</TD><TD>b2</TD></TR>
</TABLE>
<TABLE>
<TR><TD>d1</TD><TD>e1</TD>><TD>f1</TD></TR>
<TR><TD>d2</TD><TD>e2</TD>><TD>f2</TD></TR>
</TABLE>
----------------------------------------------------------------------------
-
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list