Resolved UDF:data unable to read by c#

Dharamart

Member
Joined
Jun 25, 2022
Messages
10
Programming Experience
10+
I just wanted to read or ignore the <UDF:data>test</UDF:data> from XML in c#. C# read everything from XML except <UDF:data>. please help me this one much needed.
 
Which node do you consider a corrupted node?
 
this node i consider a corrupted node.
C#:
<UDF:VATDEALERNATURE.LIST DESC="`VATDealerNature`" ISLIST="YES" TYPE="String" INDEX="10031">
                        <UDF:VATDEALERNATURE DESC="`VATDealerNature`">Regular</UDF:VATDEALERNATURE>
                    </UDF:VATDEALERNATURE.LIST>

I just wanted to remove all node which started with UDF: is it possible.
 
Last edited by a moderator:
You can replace the root element in string representing xml to add the missing namespace declaration, then you can proceed to work with the xml.
 
Do a simple string replace for root node <ENVELOPE> with <ENVELOPE xmlns:UDF="null"> to declare the UDF namespace prefix. After that the xml is valid and can be treated as such. Then you can for example use xpath lookup for //UDF:* nodes and remove each from the document.
 
The point of this forum is to help the community learn from each other. Please share how you are removing the UDF from the XML.
 
Back
Top Bottom