M
M
Mamol272020-12-21 15:18:41
XPath
Mamol27, 2020-12-21 15:18:41

How to get value from CDATA using xpath?

Hello.
I have an xml file with the following lines

<ROW>
  <COLUMN NAME="STOREDATE"><![CDATA[10.10.19]]></COLUMN>
  <COLUMN NAME="BEGINPROCESSTIME"><![CDATA[19.12.09 13:35:47,000000000]]></COLUMN>
  <COLUMN NAME="PROCESSTIME"><![CDATA[19.12.09 13:35:48,188000000]]></COLUMN>
</ROW>

ROW/COLUMN[@NAME='STOREDATE']Get result using expression
<COLUMN NAME="STOREDATE"><![CDATA[10.10.19]]></COLUMN>

But I need the value inside the CDATA.
I tried ROW/COLUMN[@NAME='STOREDATE']/text()but as a result I got an empty string
Do not tell me if it is possible to get this data and if so, what request should be?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-12-21
@Mamol27

A request with text() at the end to get CDATA is correct. Further, obtaining the value (nodeValue) already depends on the implementation in the language / library. With xpath you are in order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question