Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Basic question (I think!) >Thread Next - Re: Basic question (I think!) Re: Basic question (I think!)To: NULL Date: 10/1/2004 11:27:00 AM Hi Alex,
> <xsl:for-each select="NewDataSet/Table">
But there are no <NewDataSet> or <Table> elements in your XML??
Anyway, you have a default namespace in your XML - so you will need to
declare that in your stylesheet with an arbitrary namespace prefix so that
you can match/select against that namespace, e.g. with your example XML you
will need something like...
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:in="http://www.tempuri.org/Test.xsd">
<xsl:template match="/">
<HTML>
<HEAD>
<STYLE>
<xsl:text>.HDR {
background-color:bisque;font-weight:bold }</xsl:text>
</STYLE>
</HEAD>
<BODY>
<TABLE>
<COLGROUP WIDTH="100" ALIGN="LEFT"></COLGROUP>
<TD CLASS="HDR">TestID</TD>
<xsl:for-each select="in:DSTest/in:Test">
<TR>
<TD>
<xsl:value-of select="in:TestID"/>
</TD>
</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
HTH
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator
"Alex Shirley" <postings@a...> wrote in message
news:e9704b08.0410010211.dcdac08@p......
> Hi
>
> Sorry for the basic question. I'm trying to work out here what I'm
> doing wrong. If I open the XML file (below) with the stylesheet
> (below) all I can see is the header (TestID) but no value (26).
>
> Where am I going wrong? I tried changing the select value of
> "<xsl:for-each select="NewDataSet/Table">", but could not get
> anywhere.
>
> Can someone please help? I'm sure it's something dumb (code below).
>
> Many thanks!!
>
> Alex!
>
>
> XSL style sheet------------>
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template match="/">
> <HTML>
> <HEAD>
> <STYLE>
> .HDR { background-color:bisque;font-weight:bold }
> </STYLE>
> </HEAD>
> <BODY>
> <TABLE>
> <COLGROUP WIDTH="100" ALIGN="LEFT"></COLGROUP>
> <TD CLASS="HDR">TestID</TD>
> <xsl:for-each select="NewDataSet/Table">
> <TR>
> <TD><xsl:value-of select="TestID"/></TD>
> </TR>
> </xsl:for-each>
> </TABLE>
> </BODY>
> </HTML>
> </xsl:template>
> </xsl:stylesheet>
>
> XML File---------->
>
> <?xml version='1.0'?><?xml-stylesheet type='text/xsl'
> href='Test.xsl'?>
> <DSTest xmlns="http://www.tempuri.org/Test.xsd">
> <Test>
> <TestID>26</TestID>
> </Test>
> </DSTest>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
