vb.net - Create XMLElement from partial XML -


first off apologies have never coded xml constructs in .net hope question makes sense.

let me start defining xml:

<msg>    <routing>      ...      ...      ...    </routing>        <payload>            <information>        <elem1>...</elem1>        <elem2>...</elem2>        ..        ..      </information>            <history>        <hist1>...</hist1>        <hist2>...</hist2>      </history>          </payload>      </msg>          

i entire xml string.

i need call function takes custom class argument. custom class has 2 properties: 1 custom class contains routing information , other of type system.xml.xmlelement. signature this:

public class message     public header headerinfo     public payload system.xml.xmlelement end class 

in essence, need convert within <payload> tags type system.xml.xmlelement, maintaining xml structure under payload (i able generate headerinfo class)

the xml schema fixed , have same elements in it.

any ideas on how this? i'm using vb.net on .net 3.5

thanks

you can use xmldocument <payload> element xmlelement without reparsing, example :

dim doc new xmldocument() doc.loadxml("your xml string goes here") dim payload xmlelement = directcast(doc.selectsinglenode("//payload"), xmlelement) 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -