Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: An easy one for an expert...

From: Martin Honnen <mahotrash@-----.-->
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent