Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Help displaying poorly formed XML document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TheDude5B - 14 Sep 2007 12:27 GMT
HI,

So I need some help displaying this XML feed using asp.net. Personally
I feel that this XML document is poorly formed but unfortunetaly I do
not have control over it.

the XML document is formed like this

<clubgig>
 <HULL>
   <venue>The Welly</venue>
   <address>105-107 Beverley Road, Hull</address>
   <url />
   <gig>20th September 2007 - The Runners</gig>
   <gig>27th September 2007 - WinterKids</gig>
</HULL>
<LONDON>
   <venue>KOKO</venue>
   <address>1A Camden High Street, London</address>
   <url>http://www.koko.uk.com</url>
   <gig>12th October 2007 - The Alones</gig>
   <gig>19th October 2007 - The Outside Royalty</gig>
   <gig>21st September 2007 - The Dead 60s</gig>
   <gig>21st September 2007 - One Night Only</gig>
   <gig>26th October 2007 - Help She Can&#39;t Swim</gig>
   <gig>28th September 2007 - Remi Nicole</gig>
   <gig>28th September 2007 - The Steers</gig>
   <gig>5th October 2007 - Nine Black Alps</gig>
   <gig>5th October 2007 - The Ads</gig>
 </LONDON>
<LUTON>
   <venue>The Live Room at Charlie Browns</venue>
   <address>114 Midland Road Luton</address>
   <url>http://www.myspace.com/lutonclubnme</url>
   <gig>21st September 2007 - The Teenagers</gig>
   <gig>21st September 2007 - Help She Can't Swim</gig>
</LUTON>
<SHEFFIELD>
   <venue>The Plug</venue>
   <address>14-16 Matilda Street, Sheffield</address>
   <url>http://www.the-plug.com</url>
   <gig>27th September 2007 - Remi Nicole</gig>
   <gig>27th September 2007 - Oh No Ono</gig>
</SHEFFIELD>
<STOKE_ON_TRENT>
   <venue>The Underground</venue>
   <address>The Underground, Morley Street, Hanley</address>
   <url />
   <gig>15th September 2007 - The Tigerpicks</gig>
   <gig>22nd September 2007 - One Night Only</gig>
 </STOKE_ON_TRENT>
 </clubgig>

I am able to play around with XML coding when to document if formed
properly, but when it comes to this I dont have a clue.

Can someone help me out here?

Thanks,
Patrice - 14 Sep 2007 12:37 GMT
Please be more specific about the problem you have. First, does it load
correctly or it is reported as an invalid XML document ?

--
Patrice

> HI,
>
[quoted text clipped - 55 lines]
>
> Thanks,
TheDude5B - 14 Sep 2007 12:46 GMT
> Please be more specific about the problem you have. First, does it load
> correctly or it is reported as an invalid XML document ?
[quoted text clipped - 66 lines]
>
> - Show quoted text -

It does not come up with an error of a poorly formed document, but I
think because the tags within <clubgig> are all different, there is
something wrong.

I have a bit of code:

Dim strURL As String = "http://www.nme.com/clubnmerss"
Dim reader As XmlTextReader = New XmlTextReader(strURL)
Dim ds As New DataSet
ds.ReadXml(reader)
Me.GridView1.DataSource = ds
Me.GridView1.DataBind()

all that out puts is the first venue and address.
Patrice - 14 Sep 2007 13:16 GMT
Ah ok. It's much easier to help when knowing what you try to do ;-)

Your best bet is IMO to take over and create the dataset structure by
yourself by reading this as an XmlDocument and by browsing the nodes.
AFAIKthis document won't ever be able to be processed by the dataset
structure inference rules because of its quite bad structure....

--
Patrice

On 14 Sep, 12:37, "Patrice" <http://www.chez.com/scribe/> wrote:
> Please be more specific about the problem you have. First, does it load
> correctly or it is reported as an invalid XML document ?
[quoted text clipped - 66 lines]
>
> - Show quoted text -

It does not come up with an error of a poorly formed document, but I
think because the tags within <clubgig> are all different, there is
something wrong.

I have a bit of code:

Dim strURL As String = "http://www.nme.com/clubnmerss"
Dim reader As XmlTextReader = New XmlTextReader(strURL)
Dim ds As New DataSet
ds.ReadXml(reader)
Me.GridView1.DataSource = ds
Me.GridView1.DataBind()

all that out puts is the first venue and address.
TheDude5B - 14 Sep 2007 13:45 GMT
> Ah ok. It's much easier to help when knowing what you try to do ;-)
>
[quoted text clipped - 97 lines]
>
> - Show quoted text -

Yeah that is what I was thinking. At least it is not just me then that
thinks the XML document has a bad structure!

I was thinking of using the XmlTextReader and then stepping through
this with the reader.Read() method.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.