XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 9th, 2002, 07:56 PM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 12
What's invalid about this xml document?

First off, I'm new to xml, so this may be a simple question. I'm being told that the following xml is not well formed, but I don't see it. It's pasted below.

<?xml version="1.0"?>
<response>
<portfolio>
<portID>Test</portID>
<portname>Consors Test Portfolio</portname>
<xloss>-5124.88530628508</xloss>
<riskgrade>129.39826419201</riskgrade>
<value>114260.469443242</value>
<divriskgrade>68.4645462588067<divriskgrade>
<divxloss>-2131.56017715564</divxloss>

<position>
<posID>Bayer</posID>
<xloss>-197.254957013363</xloss>
<riskgrade>148.955450569846</riskgrade>
<value>6138</value>
<riskimpact>-0.00822567904632093</riskimpact>
</position>
<position>
<posID>Bond</posID>
<xloss>-157.580177492695</xloss>
<riskgrade>29.3498701802706</riskgrade>
<value>18922.4694432424</value>
</position>
</portfolio>
</response>
If anybody knows what's wrong with this, could you please let me know? Thanks in advance.

Reply With Quote
  #2  
Old December 9th, 2002, 08:07 PM
MJEggertson MJEggertson is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Seattle WA
Posts: 863 MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level)MJEggertson User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 8
Line number 9, your element is not closed.

Reply With Quote
  #3  
Old December 9th, 2002, 08:35 PM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 12
Thanks for pointing that out. Now here's the question. Would I use an xml parser to pick this out? What if the xml document where 20 pages worth of data. I couldn't even pick out the problem with a couple of lines. I guess as a previous writer wrote, I've read a lot about xml and I still don't have a grasp of it. Again, thanks for the help.

Reply With Quote
  #4  
Old December 10th, 2002, 02:38 AM
sunnychan's Avatar
sunnychan sunnychan is offline
a lazy guy
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Hong Kong
Posts: 99 sunnychan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
For me, the easiest way to find out the XML problem is to use the IE Browser and open the XML file.

Reply With Quote
  #5  
Old December 10th, 2002, 02:53 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
IE is an easy way, Mozilla can also be used to find out the error. It just displays the error and then also displays the exact problem with the line, very helpful. Most XML parsers will tell you what line the error is on. I use PHP and it tells me which line the error is on.

Reply With Quote
  #6  
Old December 10th, 2002, 08:29 AM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 12
Thanks a lot guys!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > What's invalid about this xml document?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway