Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regarding the value from CDATA

Status
Not open for further replies.

psshastri

Programmer
Apr 2, 2005
2
US
Hi,

I have resulting xml document as shown below, and I have to read the value of EXACT_MASS which is 381.1510978 in the CDATA.How should I do this?

<result>
<![CDATA[C1(=CC=C(CCNCCCC2=CC=CS2)C=C1)OC1=NC=C(C=C1)C(N)=O
gYw^K9^ABC6QVzFzEZI44C^tGFLMVgNuid4N9TlYKyBSiMCjWqkG2^mbtoI$zl0qdzgdJsSIeDOh3EITyhQTxK$ofLQRDwoUiS$nVzWqA8e16ta7QaEcgbZ^SVpdp9A3Oys$zCpX4PhBvnJLt5Ode7dLa749QObPxq0RnCqsGOOk4se5Yh^CWOn4pq3FbCoiEBsIyqYv$yCoi5OSQ0RquPLpY8lVrR8WIGK16yeJhBm6mKwHhZUZ17$6a^VJ27MZm6ksxfx34MEFEn$PZ^PCuf^SkSm6pod7XW8dRhHVevPFPlkxPjkh4f^dwirvzGAv7z5LiqKWkqGU3v7upgf5ypYpjnzY7Sq76s0mT$SuWaAeE27s^1WTnG8Lat7m6t32CtwK0aGX3T^nobZcP2XuZmt67pHSOcbKOOH0j$WXznkmPw6LzrsGUd0gm5KbqtYBoSbeLfilZX$qapi505Gb7RR9DNLRxhGtpVLaFJbOVHa0olopikWta2mW78LW2j6jVV7aTrG1TKgc9A1qR5xn1SGdWRUK1J0mii8wmspVmWtk1SWiRjS6Wuq9^N54DPzi01vH61v7^cYGMCA58D\0
EXACT_MASS = 381.1510978\n]]>
</result>
 
Read the contents of the CDATA into a string variable in the programming language you're using (Java, C#, VB6, etc), then use that language's ability to find a substring within a string (indexOf(), IndexOf(), InStr$(), etc).

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top