Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2005, 11:45 AM
Authorized User
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default Consuming and displaying XML

I am working on a project with which we are getting an xml page from the internet, and I need to display the data in a grid.

I am having several problems doing this and being that I am unfamiliar with XML, it is not helping any.

Every attempt to bind the data from the xml is returned with errors because of the way it is formed.

Here is an example of the xml:
<?xml version="1.0" standalone="no" ?>
  <!DOCTYPE ALLQUOTEREQUEST (View Source for full doctype...)>
- <ALLQUOTEREQUEST xmlns="http://www.aghost.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.aghost.net allquoteRequest.xsd">
- <ALLQUOTEREQUEST_ROW>
  <LAST>109.750000</LAST>
  <CHG>-0.375</CHG>
  <OPENINT>13703</OPENINT>
  <CLOSE>0.000000</CLOSE>
  <VOLUME>3054</VOLUME>
  <DESC>Feeder Cattle</DESC>
  <SYM>FC5Q</SYM>
  </ALLQUOTEREQUEST_ROW>

It doesn't like the first two lines at all, and the little dashes make it error also. When I take out the first two lines, remove everything after the "<ALLQUOTEREQUEST" in the third line, and remove the dashes it databinds great. Any suggestions?
 
Old July 12th, 2005, 12:00 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can't view or consume XML unless it's XML. This isn't XML, it's something else, so no XML tools are going to be any use until you get it fixed.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 12th, 2005, 12:03 PM
Authorized User
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I figured something was wrong with it, and that is why it didn't work. Is this just bad XML, or nothing like xml at all?

 
Old July 12th, 2005, 12:04 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Actually, I suspect that what you are doing is trying to copy and paste what the browser is displaying. The browser isn't showing you the actual file, it's showing a visual representation of the file intended for human consumption. If you do what it suggests, and View Source, you will probably get the real XML. Better still, rather than screen-scraping off the browser, just tell your XSLT processor to read from the URL directly.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 12th, 2005, 12:04 PM
Authorized User
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also, I DID NOT generate this. This is what is sent back to use after submitting our authentication information.

 
Old July 12th, 2005, 12:08 PM
Authorized User
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

See, I new you were the MAN. You are exactly right. I don't know how to do what you are suggesting, because we have to submit our info via a submit button with hidden form elements in it to get this.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying XML format on ASP page GS ASP.NET 2.0 Basics 1 August 31st, 2007 08:33 PM
Displaying, reading & writing to xml Meitoosh VB.NET 0 July 24th, 2007 05:21 AM
Reg: displaying datase in xml format asp.net 2.0 sadiashoiab ADO.NET 0 April 19th, 2007 03:17 PM
Displaying your source xml filename Chamkaur XSLT 2 March 12th, 2007 04:32 AM
displaying XML forlorn Classic ASP XML 0 August 19th, 2005 03:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.