PC Review


Reply
Thread Tools Rate Thread

How do I find this piece of xml in a dataset?

 
 
jlp
Guest
Posts: n/a
 
      22nd Nov 2005
Hey all, this may be a noob question but...

I am loading an xml file into a dataset but there is a piece of data in
it that I can not find in the dataset. In the xml there is an element
that looks somthing like this.

<somegroupofpeople>
<persontype>Male
<person>
<fname>John</fname>
<lname>Doe</lname>
</person>
<person>
<fname>Joe</fname>
<lname>Dirt</lname>
</person>
</persontype>
<persontype>Female
<person>
<fname>Jane</fname>
<lname>Doe</lname>
</person>
<person>
<fname>Joe</fname>
<lname>Dirt in drag</lname>
</person>
</persontype>
</somegroupofpeople>
<somegroupofpeople>...

This is just an example. The real data has elements that differ. What I
can't seem to find or navigate to is what would be values "Male" or
"Female" in persontype.

My first impression is that this kind of layout is kind of goofy in that
the sex should be an element or attribute of <person>. However I am no
xml guru and any tool that I run it through tells me that it is well
formed so what do I know.

If I needed to do something for persontype in each group of people
dependent on its value, how do I find this piece of the xml in a
dataset?

I hope this makes sense.

Thanks all.
 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      22nd Nov 2005
jlp,

I don't believe this is a dataset. A dataset has normally not nested three
levels.
Dataset Value Dataset name
DataTable Value table name
DataItems (with there own tagnames and values)

Try to open this in your IDE with the solution explorer. Than the schema
will be showed if this is one.

And if you than have not the answer, reply.

I hope this helps,

Cor



 
Reply With Quote
 
=?Utf-8?B?cm9zc3U=?=
Guest
Posts: n/a
 
      11th Dec 2005
This is not well formed xml.

You can't have something like
<a> data <b>more data</b></a>

The best way to deal with this data is
<Person>
<Sex>Male</Sex>
<fname>John</fname>
<lname>Doe<lname>
<Person>
which would allow you to search on Sex.

The following is legal xml but would make a horrific db to use
<group>
<persontype>make</persontype>
<person>
<fname>John</fname>
<lname>Doe</lname>
</person>
<person>
<fname>Joe</fname>
<lname>Dirt</lname>
</person>
</group>


"jlp" wrote:

> Hey all, this may be a noob question but...
>
> I am loading an xml file into a dataset but there is a piece of data in
> it that I can not find in the dataset. In the xml there is an element
> that looks somthing like this.
>
> <somegroupofpeople>
> <persontype>Male
> <person>
> <fname>John</fname>
> <lname>Doe</lname>
> </person>
> <person>
> <fname>Joe</fname>
> <lname>Dirt</lname>
> </person>
> </persontype>
> <persontype>Female
> <person>
> <fname>Jane</fname>
> <lname>Doe</lname>
> </person>
> <person>
> <fname>Joe</fname>
> <lname>Dirt in drag</lname>
> </person>
> </persontype>
> </somegroupofpeople>
> <somegroupofpeople>...
>
> This is just an example. The real data has elements that differ. What I
> can't seem to find or navigate to is what would be values "Male" or
> "Female" in persontype.
>
> My first impression is that this kind of layout is kind of goofy in that
> the sex should be an element or attribute of <person>. However I am no
> xml guru and any tool that I run it through tells me that it is well
> formed so what do I know.
>
> If I needed to do something for persontype in each group of people
> dependent on its value, how do I find this piece of the xml in a
> dataset?
>
> I hope this makes sense.
>
> Thanks all.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find a record in Access if I only know 1 piece of info? =?Utf-8?B?ZmlvbmE=?= Microsoft Access Getting Started 3 25th Aug 2006 02:41 AM
Find Missing Piece Of Puzzle ChrisIMRIE Security, Spyware and Viruses 5 12th Dec 2005 10:07 AM
after every scan mas find 1 piece joop Spyware Discussion 0 16th May 2005 08:34 PM
how to create a powerpoint with a jigsaw puzzle, piece by piece =?Utf-8?B?TmFsaWNl?= Microsoft Powerpoint 1 11th May 2005 02:29 PM
retrieving a single piece of data from a dataset Mike Fellows Microsoft VB .NET 1 4th Mar 2004 05:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:40 PM.