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 / .NET Framework / XML / October 2003

Tip: Looking for answers? Try searching our database.

filtering xml

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Broccie - 22 Oct 2003 01:35 GMT
Hi
I'm trying to filter an xml document that contains
products for a CD store (music).
My xml file is fine and displays fine, but I am a little
confused about filtering it now. I want to give the user
the option to choose a different genre of music (such as
rock) and it will only display that particular genre.
I have had a quick look into MSXML2, XPath and so on, but
they are just confusing me more. Can anybody help me??

Broccie
Christoph Schittko [MVP] - 22 Oct 2003 04:02 GMT
Broccie,

When you say filter, do you mean that you want to select elements that meet
certain criteria, for example they all have attributes that match a certain
value?

You're certainly on the right track looking at XPath. XPath is one of the
foundation technologies of XML and the one best suited to solve your
problem. XPath will help you to select XML nodes from an XML document that
meet your filter criteria.

However, you need a vehicle to execute your XPath statements. You can do
this in a number of ways. Which one is thie best one for you depends on what
you are going to do with the results of the filtering.

You can execute the XPath statement either using a DOM based XML Parser such
as XMLDocument in MSXML and XmlDocument in the .NET Framework. The .NET
Framework also introduced a cursor based parser model with the XPathDocument
to select XML.

This approach is well suited if you need to run more code to work with the
results of your filtering.

If you are most interesting to transform the results into another XML format
or into HTML the you can also leverage XPath as a part of an XSL
transformation. However, XSL might be too much for you to tackle if you're
still new to XML at all.

Let me know if this helped clearing things up or if you have further
questions.
Signature

HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

> Hi
> I'm trying to filter an xml document that contains
[quoted text clipped - 7 lines]
>
> Broccie
Broccie - 22 Oct 2003 04:42 GMT
Christoph
Yes, that is what I need for the filter. I just need to
find elements that have particular attributes and then
display only those elements. I am using an xslt document
to display the xml file as a whole (in a table).

Can you tell me more about XPath?

Broccie

>-----Original Message-----
>Broccie,
[quoted text clipped - 40 lines]
>
>.
Christoph Schittko [MVP] - 22 Oct 2003 05:16 GMT
There is quite a bit to tell about XPath, too much to sum it up in a
newsgroup posting. You may want to invest in a good book or start with a
platform independent XSL / XPATH tutorial. Take a look at [0] for example.
Maybe this helps you getting started.

Signature

HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[0] http://www.topxml.com/xsl/default.asp

> Christoph
> Yes, that is what I need for the filter. I just need to
[quoted text clipped - 66 lines]
> >
> >.
Broccie - 22 Oct 2003 13:55 GMT
Thanks Christoph....

Broccie

>-----Original Message-----
>There is quite a bit to tell about XPath, too much to sum it up in a
[quoted text clipped - 74 lines]
>
>.

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.