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

Reading XML Webpage Without XSLT

i'm trying to programatically read the xml that is used to create a
webpage through xslt transformations.

I can view the XML when i go to "View Source" in internet explorer,
but whenever i try to download the webpage programmatically i can't
ever get the source XML, i always get the transformed html.

Any ideas? I've tried everything i can think of :(

Mar 5 '07 #1
7 5725
dakrin wrote:
i'm trying to programatically read the xml that is used to create a
webpage through xslt transformations.

I can view the XML when i go to "View Source" in internet explorer,
but whenever i try to download the webpage programmatically i can't
ever get the source XML, i always get the transformed html.

Any ideas? I've tried everything i can think of :(
wget or dog does it for me.

///Peter
Mar 5 '07 #2
On Mar 5, 5:01 pm, Peter Flynn <peter.n...@m.silmaril.iewrote:
>
wget or dog does it for me.

///Peter

Well, I'm trying to finding a way to programatically do it using c#.
I've tried using xmlDocument.load(), getresponsestream(),
xmlreader.create(), etc. but they all get the html-output, not the
original xml file.

I downloaded wget for windows just to try it out and it downloaded the
html as well.

The only way I can view the xml is when i go to "View Source" in IE.

Any ideas?

Mar 6 '07 #3
dakrin wrote:
Well, I'm trying to finding a way to programatically do it using c#.
I've tried using xmlDocument.load(), getresponsestream(),
xmlreader.create(), etc. but they all get the html-output, not the
original xml file.

I downloaded wget for windows just to try it out and it downloaded the
html as well.

The only way I can view the xml is when i go to "View Source" in IE.
Please post an example URL you are trying to access, if the server sends
HTML after doing an XSLT transformation on the server then it is usually
not possible to access the XML, unless the server exposes that as well.
And if you really get HTML back then XML tools like the Load method of
XmlDocument or XmlReader will simply abort parsing and tell you the
markup is not well-formed XML.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 6 '07 #4
Please post an example URL you are trying to access, if the server sends
HTML after doing an XSLT transformation on the server then it is usually
not possible to access the XML, unless the server exposes that as well.
And if you really get HTML back then XML tools like the Load method of
XmlDocument or XmlReader will simply abort parsing and tell you the
markup is not well-formed XML.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
When I do "View Source" in Internet Explorer the XML shows up, so I'm
assuming that means its applying the xsl client side.

Here's an example site that does what i'm talking about:

http://armory.worldofwarcraft.com/ar...1&sf=rank&sd=a

Mar 6 '07 #5
dakrin wrote:
When I do "View Source" in Internet Explorer the XML shows up, so I'm
assuming that means its applying the xsl client side.

Here's an example site that does what i'm talking about:

http://armory.worldofwarcraft.com/ar...1&sf=rank&sd=a
The might sniff the user agent server side and depending on that serve
XML or HTML, try it like this

HttpWebRequest httpRequest =
(HttpWebRequest)WebRequest.Create(@"http://armory.worldofwarcraft.com/arena-ladder.xml?b=Stormstrike&ts=3&p=1&sf=rank&sd=a");
httpRequest.UserAgent =
@"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
HttpWebResponse httpResponse =
(HttpWebResponse)httpRequest.GetResponse();
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(httpResponse.GetResponseStream()) ;
httpResponse.Close();
xmlDocument.Save(Console.Out);

that way I get XML starting with

<?xml-stylesheet type="text/xsl" href="/layout/arena-ladder.xsl"?>
<page globalSearch="1" lang="en_us" requestUrl="/arena-ladder.xml">

It might also be necessary or helpful to set the Accept HTTP request
header but that depends on what they are doing on the server, it is not
really an XML problem but rather a HTTP problem.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 6 '07 #6
dakrin wrote:
On Mar 5, 5:01 pm, Peter Flynn <peter.n...@m.silmaril.iewrote:
>wget or dog does it for me.

///Peter


Well, I'm trying to finding a way to programatically do it using c#.
I've tried using xmlDocument.load(), getresponsestream(),
xmlreader.create(), etc. but they all get the html-output, not the
original xml file.

I downloaded wget for windows just to try it out and it downloaded the
html as well.
In that case the transformation must be being done server-side.
AFAIK wget does not contain an XSLT processor.
The only way I can view the xml is when i go to "View Source" in IE.
What's the URI?

///Peter
Mar 6 '07 #7
Martin Honnen wrote:
The might sniff the user agent server side and depending on that server
XML or HTML, try it like this
Yep, that worked. Thanks very much :)

Mar 7 '07 #8

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

Similar topics

2
by: titusjava | last post by:
I am having a XSLT which transforms an input XML to transformed XML. I want to get the count of some nodes in the transformed XML, in the same XSLT. Is it do able?. Is it possible to read Output...
7
by: gino | last post by:
Dear all, My monitor was set to 1600x1200 so the fonts in IE is too small for me even when I set the "View->Text Size->Largest"... I don't have previlage to change the monitor resolution... ...
1
by: Brett | last post by:
I am writing a program that will allow a user to enter a webpage address into a form. Then it will download and display the webpage below the current one. example...
1
by: Miles Cousens II | last post by:
I would like to be able to import the following xml document on a daily basis to get the current exchange rates and then create the same output file so I can use Biztalk 2002 to import that file,...
3
by: GraVity via DotNetMonster.com | last post by:
Hello all I am new to asp.net or web programming I have a requirement, I have to submit a document to another server using my webpage, there is a perticular protocol for doing that. This protocol...
5
by: cybernerdsx2 | last post by:
Hi, I am new to XSLT and I would like to use Java to read up the XSLT content and add in a few tags in into the template below: <xsl:template name="hwSpecs"> <!-- adding new tags into here...
1
by: SteveB | last post by:
I'm porting an application from Apache Xerces to .Net and am having a couple of small problems with deserialization. The XML that I'm reading comes from a variety of sources, and there are two...
11
by: J_Zanetti | last post by:
Hello everybody, In my applications I've a ton of scripts that use remote XML file to fill forms and evaluate contents; In these scripts I always use the method SelectNode (that, with some...
11
by: ianoble | last post by:
I've been trying to piece together various code snippets to create a lookup table inside my xslt without the need for a supplemental xml file. Here is what I have so far. As of now, it does not...
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
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.