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?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Parsing XML with JavaScript

In this post, we discuss how to parse a string to XML and XML to string using the JavaScript

JSON vs XML: How Do They Compare?

In this article, we will outline what’s going on, and what you need to know about JSON and XML.

An Introduction to Oracle SQL

An Introduction to Oracle SQL: A quick tour of the six principal clauses of the SELECT statement.