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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -