|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
|
#2
|
|||
|
|||
|
Line number 9, your element is not closed.
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
For me, the easiest way to find out the XML problem is to use the IE Browser and open the XML file.
|
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
||||
|
||||
|
Thanks a lot guys!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > What's invalid about this xml document? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|