Re: Reading Specific Parts of an XML Document

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Cowboy \(Gregory A. Beamer\) (NoSpamMgbworld_at_comcast.netNoSpamM)
Date: 03/11/04


Date: Thu, 11 Mar 2004 10:53:14 -0600

Consider adding the metadata for navigation, if not there already, as nodes.
Then, you can use XPath to prune out the nodes you want. For example:

<SideMenu>
    <LinkName>Policies</LinkName>
    <LinkURL>policies.aspx</LinkURL>
    <Section>Home</Section>
</SideMenu>

NOTE: The XML here is DataSet style, but the principle is still the same.

With XPATH, you can set up a query that only finds those side menu items
that are in section Home. The reason I use DataSet XML for menus is we are
aiming for eventually moving the menus to a database, with an admin utility
for all of our applications. By starting with XML that is DataSet oriented,
I can easily change to the database, when finished, without rewriting the
bind.

-- 
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
**********************************************************************
Think Outside the Box!
**********************************************************************
"Jordan" <jfritts@learn.colostate.edu> wrote in message
news:u7GoQH4BEHA.1220@TK2MSFTNGP10.phx.gbl...
> I'm using an xml document as the source for my site's navigation. I have
it
> working but am curious if I've chosen the best method (performance wise)
of
> reading this xml document. Becuase this xml file has my site's complete
> navigation, I need to "jump around" in it to get to the data I need based
on
> the page. I'm using the Skip() method of the XmlReader class to do this.
>
> Is this the best way to move forward in an xml document?
>
> I also have another question too now that I'm thinking about it - what
would
> be the best way to cache my navigation as it won't change often at all?
>
> tia, j
>
>

Quantcast