ORA-31011: XML parsing failed while trying to get XML output

ORA-31011: XML parsing failed while trying to get XML output

When trying to get a value from an CLOB XML column, I get the following error:

When trying to get a value from an CLOB XML column, I get the following error:

ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '/l-analysis/vehicle/odometer-reading/reading value/text()'
31011. 00000 -  "XML parsing failed"
*Cause:    XML parser returned an error while trying to parse the document.
*Action:   Check if the document to be parsed is valid.

I have the following XML output:

<?xml version="1.0" encoding="UTF-8"?>
<l-analysis>
   <vehicle>
      <make>SAAB</make>
      <model>9000 CSI</model>
      <body-style code="SL">Saloon</body-style>
      <vehicle-type code="7">Passenger car/van</vehicle-type>
      <odometer-reading latest="true">
         <reading value="154267213">154267213</reading>
         <reading-date value="2006-07-17">17-Jul-2006</reading-date>
      </odometer-reading>
   </vehicle>
</l-analysis>

When trying to get the reading value value, I am running this query:

select XMLTYPE(xml_data).EXTRACT('/l-analysis/vehicle/odometer-reading/reading value/text()').getStringVal() AS XML FROM lm

I believe the error is due reading value having spaces? 'Cause for another XML column that doesn't have spaces it works.

How could I get this working?

xml oracle

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

5 Steps To Get An Oracle Database Certification

Oracle Online Training & Certification Course; Launch your career by joining India's best Institute to learn 10g 11g and become well-versed oracle professional.

What is Oracle and Its Benefits?

Oracle Online Training & Certification Course; Launch your career by joining India's best Institute to learn 10g 11g and become well-versed oracle professional.

Benefits of Oracle Certification Today for Fresher’s Career Resume!

Oracle Online Training & Certification Course; Launch your career by joining India's best Institute to learn 10g 11g and become well-versed oracle professional.

XML Functionalities in Oracle

There is always an extensive demand for exchanging data between different sources without worrying about how the receiver will use it or how it will be displayed. XML does that thing for us. It’s a W3C(World Wide Web Consortium) initiative that allows information to be encoded in meaningful structure and rules that humans and machines can understand easily.

What is an XML File? How to Open XML Files and the Best XML Viewers

What is an XML File? How to Open XML Files and the Best XML Viewers. XML stands for Extensible Markup Language. Though XML, like HTML, is a human readable markup language, they serve very different purposes. XML provides programs, and more importantly, programmers, a standard, widely accepted format to transmit data across different systems. In that way, XML has more in common with JSON than it does with HTML.