Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - An easy one for an expert... >Thread Next - Re: An easy one for an expert... Re: An easy one for an expert...To: NULL Date: 5/5/2009 3:29:00 PM gizmo wrote:
> What am i doing wrong? I'm creating a test xsl as a proof of concept,
> to generate some html from an xml string representing a dataset. When
> I look at the xml this is what I have:
>
> <MyTypedDataSet xmlns=\"http://tempuri.org/MyTypedDataSet.xsd\">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
XML does not allow a backslash there so unless you have posted some
escaped .NET string you should fix that.
> <MultiplicationTable>
> <Number1>3</Number1>
> <Number2>1</Number2>
> <Result>3</Result>
> </MultiplicationTable>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
> Transform" xmlns:pf1="http://tempuri.org/MyTypedDataSet.xsd">
> <xsl:output method="html">
> </xsl:output>
> <xsl:template match="pf1">
I think you simply want
<xsl:template match="/">
or maybe
<xsl:template match="/pf1:MyTypedDataSet">
> <xsl:for-each select="MyTypedDataSet/
> MultiplicationTable">
If you have match="/" above, then here use
<xsl:for-each
select="pf1:MyTypedDataSet/pf1:MultiplicationTable">
> <xsl:value-of select="Number1">
You need to qualify all element names with the prefix e.g.
<xsl:value-of select="pf1:Number1"/>
> </xsl:value-of>
> </td>
> <td>
> <xsl:value-of select="Number2">
> </xsl:value-of>
> </td>
> <td>
> <xsl:value-of select="Result">
> </xsl:value-of>
The same for the other select expressions, qualify element names with
the prefix you have bound to the namespace URI.
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
