hi here is a sample from my xml
I have a code passed in querystring. I need to find the correct node based on the code, but then get the details for other nodes.Code:<jobCodes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <job> <RoomID>1</RoomID> <RoomName>Bathroom / Toilet</RoomName> <ComponentID>2</ComponentID> <Componentname>Bath</Componentname> <Description>Renew white mastic seal around bath</Description> <Code>45</Code> </job> </jobCodes>
Is this the best way to build the xml, or is it better to have code as an attribute at job level?
Currently I do this
This then binds the radiobuttonlist with the Code as text and value.Code:Dim Doc As XPathDocument = New XPathDocument("MYfile.xml") Dim Navigator As XPathNavigator Navigator = Doc.CreateNavigator() Dim Iterator As XPathNodeIterator = Navigator.Select("/jobCodes/job/Code[text()='" & Master.SORcode & "']") While Iterator.MoveNext() rblJobs.Items.Add(New ListItem(Iterator.Current.Value, Iterator.Current.Value)) End While
how would I bind other fields such as description.
First time usign xpath so sorry if this seems stupid




Reply With Quote