Welcome Guest, Not a member yet? Register   Sign In
XML syntax help?
#1

[eluser]Zeeshan Rasool[/eluser]
Any body tell me is it fine XML syntax ?
Actually i am generating this XML file and if i open it, it gives error which is

Code:
XML Parsing Error: junk after document element
Location: http://www.mysite.com/myfile.xml
Line Number 14, Column 1:<filePath path="http://www.mysite.com/cms/stuff/gallery/"></filePath>
MY CODE IN XML FILE
Code:
&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
<gallery>
<image picture="2.jpg" thumb="2.jpg" lab=''></image>
<image picture="1.jpg" thumb="1.jpg" lab=''></image>
<image picture="3.jpg" thumb="3.jpg" lab=''></image>
<image picture="4.jpg" thumb="4.jpg" lab=''></image>
<image picture="5.jpg" thumb="5.jpg" lab=''></image>
<image picture="6.jpg" thumb="6.jpg" lab=''></image>
<image picture="8.jpg" thumb="8.jpg" lab=''></image>
<image picture="7.jpg" thumb="7.jpg" lab=''></image>
<image picture="9.jpg" thumb="9.jpg" lab=''></image>
<image picture="10.jpg" thumb="10.jpg" lab=''></image>
</gallery>
<filePath path="http://www.mysite.com/cms/stuff/gallery/"></filePath>
#2

[eluser]John_Betong[/eluser]
&nbsp;
Try this:
Code:
&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
<gallery>
  <image picture="2.jpg" thumb="2.jpg" lab=''></image>
  <image picture="1.jpg" thumb="1.jpg" lab=''></image>
  <image picture="3.jpg" thumb="3.jpg" lab=''></image>
  <image picture="4.jpg" thumb="4.jpg" lab=''></image>
  <image picture="5.jpg" thumb="5.jpg" lab=''></image>
  <image picture="6.jpg" thumb="6.jpg" lab=''></image>
  <image picture="8.jpg" thumb="8.jpg" lab=''></image>
  <image picture="7.jpg" thumb="7.jpg" lab=''></image>
  <image picture="9.jpg" thumb="9.jpg" lab=''></image>
  <image picture="10.jpg" thumb="10.jpg" lab=''></image>

<filePath path="http://www.mysite.com/cms/stuff/gallery/"></filePath>
</gallery>
&nbsp;
&nbsp;
&nbsp;
#3

[eluser]Phil Sturgeon[/eluser]
Also XML supports self closing tags so:

Quote:<image picture="2.jpg" thumb="2.jpg" lab=''></image>

becomes

Quote:<image picture="2.jpg" thumb="2.jpg" lab='' //>
#4

[eluser]Zeeshan Rasool[/eluser]
Ok let me check.. Thank you very much




Theme © iAndrew 2016 - Forum software by © MyBB