473,320 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Xml Node value needs to extract

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

Aug 21 '06 #1
1 2545
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
Lucky wrote:
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
Aug 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andy Fish | last post by:
Hi, I just found this template in someone else's xslt (it's Microsoft's "word2html" stylesheet to convert WordProcessingML to HTML) <xsl:template match="WX:sect"> <xsl:variable...
2
by: RichardHatcher.com | last post by:
I am writing C code using xpath to extract some data from a XML document. The file uses namespaces, but the name spaces are all listed in the root node of the file as attributes. I want to...
16
by: mailforpr | last post by:
How do I do that? The thing is, the only information I have about the iterator is the iterator itself. No container it is belonging to or anything. Like template<Iteratorvoid...
0
by: HP17 | last post by:
Hi all, I am a bit desperate already trying to display a XML file using XSLT. I create a table and use <xsl:for-each> to extract every element node. This is working fine. What I want now is so...
21
by: Mark Cooney | last post by:
Good afternoon, yes i am a newby so pls keep it simple. Yesterday I started a small project where I have to make an API call and receive back from that the long xml transcript down below. Now,...
8
by: nicolas.edel | last post by:
Hi, suppose i get the simple xml sample: <foo> 1 <bar>2</bar> 3 </foo> Now suppose i want to extract all the text of only the 'foo' node, ie
2
by: ofuuzo1 | last post by:
Hei, I have the following xml file and I have tried to write xslt to extract only the values of the first "record" node. It does not work. I need some help. I used ---- to represent indent. ...
4
by: laredotornado | last post by:
Hi, If I have a TD, whose id = "myTd," that only contains text within it,how do extract that text? Thanks, - Dave
3
by: raghudr | last post by:
Hi all, I am parsing a .xml file.My main intention is to retrieve the name value of node "Signal":- "Name Value" which is "rag". i want to store only the <signal"name value" that is only...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.