Xml Node value needs to extract

  • Thread starter Thread starter Lucky
  • Start date Start date
L

Lucky

Hi guys!
i've made one Regx that extract values from xml nodes. the problem is
with the node that has CDATA.

XML DATA:

<tag1>qfa f453q4tw34656</tag1>
<tag2>vv4642663735673</tag2>
<Text>
<![CDATA[abcdefghidfalknaf afaoifan favnaåo qwf023ru920348292r
qråq9340 urq4r]]>
</Text>


REGULAR EXPRESSION:

<(?<tag>\w*)>(?<text>.*)</\k<tag>>

Current Result:
the nodes with the CDATA are not getting included in the matches.

Expected Result:
i need values of all nodes regardless what kind of values they have.

Tools:
c#.net 2.0 (VS.NET 2005)

please let me know if you need more details on this. and someone knows
some solution of the problem please let me know.

thanks,
Lucky
 
Why are you using a regex to parse the xml? Use the classes in
System.Xml, and your task will be so much easier.

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top