[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: node-set in .Net 2.0?
Bryan,
Not that it matters, but why are you binding 'ns' instead of 'msxsl'? Anyway, not important. The following C# will compile to a .NET 2.0 console app: using System; using System.Xml; using System.Xml.Xsl; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load("test.xsl"); xslt.Transform("test.xml", "test.html"); } } } using the following dummy xml saved as test.xml: <?xml version="1.0" encoding="utf-8" ?> <foo> <bar>test</bar> </foo> and the following xsl transformation file saved as test.xsl: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="urn:schemas-microsoft-com:xslt" version="1.0"> <xsl:variable name="list"> <item test="foo">bar</item> <item test="bar">of chocolate</item> </xsl:variable> <xsl:output method="text"/> <xsl:template match="/"> <xsl:apply-templates select="ns:node-set($list)/item" /> </xsl:template> <xsl:template match="item"> <xsl:value-of select="@test"/>:<xsl:value-of select="."/> </xsl:template> </xsl:stylesheet> creates the following output saved as test.html: foo:barbar:of chocolate I'm building against the final .NET 2.0 release so I'm not sure where your problem might be. A sample of your xml and xsl transformation file might help clear things up, but until I see it I can't no this for sure. bryan rasmussen wrote: Hey
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|