D
David
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/rss.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.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.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.
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/rss.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.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available