473,385 Members | 1,396 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,385 software developers and data experts.

ASP querystring and XML

Don
Hi:

If somebody just gives me and asp page that returns XML, how do I consume
that?
Such as news.asp?page=id. This returns a page of XML in IE. What objects
and properties in .NET should I research?

Thanks,

Do
Nov 12 '05 #1
5 1398


Don wrote:

If somebody just gives me and asp page that returns XML, how do I consume
that?
Such as news.asp?page=id. This returns a page of XML in IE. What objects
and properties in .NET should I research?


If you want an XML DOM document object which models the whole XML
document as a tree of node objects then you need in C#

using System.Xml;

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load("http://example.com/news.asp?page=id");

But .NET has lots of ways depending on what you want to do with the XML,
you can simply read through the XML pulling out node by node to extract
the data that is relevant for you using XmlTextReader, you can validate
against a schema or DTD using XmlValidatingReader, you can use a schema
for the XML to create a .NET class which you can then instantiate from
an XML instance document.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
What I want to do is a couple of things.

1) I will use it with an XSL for transformation to display on a page.
2) I will cache it. What caching mechanisms from the .NET infrastructure
can I use to save the doc until I pull a newer one.

Thanks,

Don
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:uB**************@TK2MSFTNGP10.phx.gbl...


Don wrote:

If somebody just gives me and asp page that returns XML, how do I
consume
that?
Such as news.asp?page=id. This returns a page of XML in IE. What
objects
and properties in .NET should I research?


If you want an XML DOM document object which models the whole XML document
as a tree of node objects then you need in C#

using System.Xml;

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load("http://example.com/news.asp?page=id");

But .NET has lots of ways depending on what you want to do with the XML,
you can simply read through the XML pulling out node by node to extract
the data that is relevant for you using XmlTextReader, you can validate
against a schema or DTD using XmlValidatingReader, you can use a schema
for the XML to create a .NET class which you can then instantiate from an
XML instance document.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3


news.microsoft.com wrote:
1) I will use it with an XSL for transformation to display on a page.
Then usually an XPathDocument suffices as that provides optimized read
access for XSLT/XPath while not having the overhead XmlDocument has to
allow manipulating the document:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXPathXPathDocumentClassTopic.asp>
2) I will cache it. What caching mechanisms from the .NET infrastructure
can I use to save the doc until I pull a newer one.


That depends on the type of .NET application you are developing, whether
it is a Win application or an ASP.NET application for instance.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #4
It is for an ASP.NET application. Basically, I have a service that I would
like to call, once the page for day is cached, I will use it for the day
until the next page is pulled the following day.

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:uJ**************@TK2MSFTNGP14.phx.gbl...


news.microsoft.com wrote:
1) I will use it with an XSL for transformation to display on a page.


Then usually an XPathDocument suffices as that provides optimized read
access for XSLT/XPath while not having the overhead XmlDocument has to
allow manipulating the document:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXPathXPathDocumentClassTopic.asp>
2) I will cache it. What caching mechanisms from the .NET infrastructure
can I use to save the doc until I pull a newer one.


That depends on the type of .NET application you are developing, whether
it is a Win application or an ASP.NET application for instance.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #5


news.microsoft.com wrote:
It is for an ASP.NET application. Basically, I have a service that I would
like to call, once the page for day is cached, I will use it for the day
until the next page is pulled the following day.


ASP.NET can store objects application wide, see
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIPageMembersTopic.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpapplicationstateclasstopic.asp>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #6

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

Similar topics

3
by: Arpan | last post by:
A link has the following URL: <a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%= Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2") %>&cplace=<%=...
2
by: Mikael | last post by:
Hi All! I have a problem here and i can't see what it is... My parameters (value) are shopped off. exampe "Hello world" will end up like "hello" How should i adjust the syntax to get a whole...
1
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string:...
5
by: David | last post by:
Hello I need to take some values and place them in a string in the format of a querystring. Lets say I have: string State = "ACT"; string SearchString = "Tax"; int MinRelevance = 50;
4
by: Raterus | last post by:
Howdy, Simple question, but I can't figure out how to do it. I have a a page which is called initially with a querystring. After I get the querystring values, I don't need the querystring to...
12
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... ...
3
by: Dan Sikorsky | last post by:
How can I get the Querystring passed to the Referring Page from its referrer? I don't want the querystring coming to my current page. I want the querystring that came to the referring page, so...
1
by: beebee | last post by:
Hi all. I am having a bit of difficulty: Here is what is happening: I have an application that spits out a thankyou.aspx page and i would like to pass it the querystring values it had collected...
4
by: =?Utf-8?B?RVcgTmV3Ymll?= | last post by:
My apologies in advance if there is a better forum for this question. Given the following snippet: <script type="text/c#" runat="server"> protected void Page_Load(Object Sender, EventArgs e)...
3
by: pingsheng | last post by:
Dear all, I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.