Re: XML challenge!
From: Random (cipherlad_at_hotmail.com)
Date: 11/16/04
- Next message: Mike: "UserControl and IDs"
- Previous message: Justin: "Updating Database using a Stored procedure"
- In reply to: Marshal Antony: "Re: XML challenge!"
- Next in thread: Marshal Antony: "Re: XML challenge!"
- Reply: Marshal Antony: "Re: XML challenge!"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 16 Nov 2004 15:00:17 -0800
But if I do this how can I get more than one xml file into the dataset? I
could, I suppose, collect and concatenate all the xml files in the directory
into one master xml document, but then how could I structure the filter to
search in both node and attribute values at the same time?
"Marshal Antony" <dotnetmarshal@hotmail.com> wrote in message
news:eVRbS4CzEHA.352@TK2MSFTNGP14.phx.gbl...
> Hi,
> One easy way is to load your XML file into a dataset and apply your
> filter to the data table.
>
> DataSet ds= new DataSet ( );
>
> // Read your xml file into a dataset
> ds.ReadXml ( Server.MapPath ( "/path/test.xml" ) );
> To do the filtering :
> DataRow[] dataRows =
> ds.Tables[0].Select( select expression);
> then bind to the datagrid
>
> Hope this helps.
> Regards,
> Marshal Antony
> .NET Developer
>
>
>
>
>
> "Random" <cipherlad@hotmail.com> wrote in message
> news:%23Nj3WACzEHA.2788@TK2MSFTNGP15.phx.gbl...
>> Trying to solicit some quick advice on my procedure architecture so I
> don't
>> have to waste too much time with trying different objects. I'm still
>> unfamiliar with a lot of the new XML parsing/manipulation in .NET, so I
>> could really use the help.
>>
>> I have a set of xml files, all in the same directory, adhering to the
>> same
>> schema. I want to implement a keyword search feature, and display the
>> results in a DataGrid control (or GridView, DetailsView, or FormView
> control
>> for .NET 2.0), with the results containing a hyperlink specifying the xml
>> document name and the node name and/or parent node name of the attribute
>> value or node value that matches the keyword(s) being searched (these are
>> the peices of information I need in the query string to parse and display
>> the xml data on another page).
>>
>> To do this, I thought I'd iterate through the files in the directory,
> apply
>> a small set of xpath queries to return an XmlNodeList, that I would then
> add
>> to either a custom business object or xml document, and then DataBind the
>> result to the DataGrid.
>>
>> The sole problem I see with this method is that my XmlNodeList would not
>> contain the info I might require on the parent node, and this would
>> therefore be unavailable for my results.
>>
>> Should I be using something other than a custom xml document, or
>> XmlNodeList? What other methods might work more efficiently?
>>
>>
>
>
- Next message: Mike: "UserControl and IDs"
- Previous message: Justin: "Updating Database using a Stored procedure"
- In reply to: Marshal Antony: "Re: XML challenge!"
- Next in thread: Marshal Antony: "Re: XML challenge!"
- Reply: Marshal Antony: "Re: XML challenge!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|