![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello I need some help to read only partial nodes of a xml and store it as a dataset. In my example below, I need only the values within the nodes WorkFlowStepHistory> in a dataset. I'm sure it is pretty simple, but since I'm new to xml not sure how it is done. Say my xml string has nodes like RequestSpecificData OtherNodes ------- /OtherNodes WorkFlowStepHistory WorkFlowStatus>FormSubmitted</WorkFlowStatus WorkFlowStatusDateTime>12/17/2007</ WorkFlowStatusDateTime WorkFlowStepHistory WorkFlowStepHistory WorkFlowStatus>FormApproved</WorkFlowStatus WorkFlowStatusDateTime>12/18/2007</ WorkFlowStatusDateTime WorkFlowStepHistory WorkFlowStepHistory WorkFlowStatus>FormRejected</WorkFlowStatus WorkFlowStatusDateTime>12/18/2007</ WorkFlowStatusDateTime WorkFlowStepHistory OtherNodesXYZ ------- /OtherNodesXYZ /RequestSpecificData |
#3
| |||
| |||
|
|
Sue wrote: Hello I need some help to read only partial nodes of a xml and store it as a dataset. In my example below, I need only the values within the nodes WorkFlowStepHistory> in a dataset. I'm sure it is pretty simple, but since I'm new to xml not sure how it is done. Say my xml string has nodes like RequestSpecificData OtherNodes ------- /OtherNodes WorkFlowStepHistory WorkFlowStatus>FormSubmitted</WorkFlowStatus WorkFlowStatusDateTime>12/17/2007</ WorkFlowStatusDateTime WorkFlowStepHistory WorkFlowStepHistory WorkFlowStatus>FormApproved</WorkFlowStatus WorkFlowStatusDateTime>12/18/2007</ WorkFlowStatusDateTime WorkFlowStepHistory WorkFlowStepHistory WorkFlowStatus>FormRejected</WorkFlowStatus WorkFlowStatusDateTime>12/18/2007</ WorkFlowStatusDateTime WorkFlowStepHistory OtherNodesXYZ ------- /OtherNodesXYZ /RequestSpecificData Well you could load the XML into a System.Xml.XmlDocument, then for that XmlDocument you could remove the nodes you don't want/need in the DataSet, then you could use an XmlNodeReader over the XmlDocument and pass it to the ReadXml method of your DataSet. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
Thank You for the response. Would you kind enought to show me how it's done. Using the SelectNode I read from the xml document the required nodes I need for the dataset. But not sure how to use that "nodelist" with the ReadXML method. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |