473,322 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

XML and XSL translation

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
Feb 24 '07 #1
2 2486
David wrote:
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>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Feb 25 '07 #2
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. :-)

--
Best regards,
Dave Colliver.
http://www.AberdeenFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

"Martin Honnen" <ma*******@yahoo.dewrote in message
news:e3*************@TK2MSFTNGP02.phx.gbl...
David wrote:
>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>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Feb 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt | last post by:
Short Description: The Translation Hub is not picking up the TNS names file. I'm using Oracle 9ids. It doesn't work for any users and it has never worked since it's been installed. Long...
40
by: Chiwa | last post by:
Hey, Expression: Math.floor(x * 100) / 100 x= 4.1 gives 4.09, why in gods name? While other values for x don't give a problem. Thx in advance
5
by: Haines Brown | last post by:
I suspect this is a FAQ, but as a guide to my further investigation, I wondered what the options are for providing readers of my web pages with the ability to translate the pages into their own...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
7
by: Peter Eisentraut | last post by:
Greetings. The official PostgreSQL documentation has been translated to German and has been published as a book by verlag moderne industrie/mitp ("PostgreSQL: Das offizielle Handbuch", ISBN...
4
by: Chris Croughton | last post by:
Does a translation unit have to have at least one externally visible declaration or function definition to be valid? As I read the standard, it doesn't: it must have at least one declaration or...
2
by: James | last post by:
In oracle I can do the following: select CONVERT(COLUMNOFNAMES,'US7ASCII') from mytable -- It will take a name like Albrecht Dürer and change it into Albrecht Durer and is useful in where...
1
by: dilabox | last post by:
Hello, I have overloaded the global new, delete, new and delete operators inside a "static library". The library uses private memory allocation routines that must not be accessible from other...
4
by: Tomás Ó hÉilidhe | last post by:
I have a translation unit which defines a global object: BEGIN "yellow.c" int i = 7; END I want this object to be accessible from other translation units, so I give it external linkage....
0
by: Stef Mientki | last post by:
hello, I've build a translation tool, to translate all strings in a python source file. As a extra gadget I added translation through Babel Fish, using beautifulsoup. Although it works...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.