Hi,
I am trying to do an XML translation. I have not done much with XML apart
from generating a few RSS feeds or saving from datasets.
I have found numerous example on the net about it, all of them very similar.
However, when I use them, they go into response.output rather than a label
or literal. I am trying to drop the output into a literal.
Here is the code I have...
try
{
XPathDocument _SourceXml = new
XPathDocument("http://www.nationalgrid.com/uk/Interconnectors/France/Results/Weekend+Auctions/r
ss.htm");
// Load the XSL stylesheet
XslTransform _Transform = new XslTransform();
_Transform.Load("http://www.nationalgrid.com/static/xsl/ngcomrss.xsl");
// Write output to the screen.
//TextReader tr = new TextReader();
//StreamReader sr = new StreamReader();
_Transform.Transform(_SourceXml, null, Response.Output);
//_Transform.Transform(_SourceXml, null, tr);
//XMLDisplay.Text = tr.ReadToEnd();
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
As you can see, I have tried setting up a stream to drop the output into,
but the compiler is complaining at the "new" word.
As it is, it drops the text at the top of the page. I want to control where
it sits, so I want to drop it in a literal instead. How can I do that?
Thanks.

Signature
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Martin Honnen - 25 Feb 2007 16:56 GMT
> I am trying to do an XML translation. I have not done much with XML apart
> from generating a few RSS feeds or saving from datasets.
>
> I have found numerous example on the net about it, all of them very similar.
> However, when I use them, they go into response.output rather than a label
> or literal. I am trying to drop the output into a literal.
Do you want to use XSLT in an ASP.NET page? Then consider using the Xml
control
<http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.xml.aspx>
For ASP.NET 2.0 there is the eXml control which uses XslCompiledTransform:
<http://www.xmllab.net/Products/eXml/tabid/174/Default.aspx>

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
David - 25 Feb 2007 22:45 GMT
Hi,
Thank you.
This works excellent, plus I also have a fix someone else supplied for my
existing code as well. I have both options available to me now. :-)

Signature
Best regards,
Dave Colliver.
http://www.AberdeenFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
>> I am trying to do an XML translation. I have not done much with XML apart
>> from generating a few RSS feeds or saving from datasets.
[quoted text clipped - 10 lines]
> For ASP.NET 2.0 there is the eXml control which uses XslCompiledTransform:
> <http://www.xmllab.net/Products/eXml/tabid/174/Default.aspx>