XML Database (MOSC)

MOSC Banner

data lost in xml after transformation

edited Apr 28, 2024 2:55PM in XML Database (MOSC) Question

Using Oracle Database version 19.16 (but problem also identified in 21).

I'm encountering a problem that whitespace-only text nodes are lost after a transformation with xquery/xslt. Even while de xml contains xml:space="preserve" and the transformation doesnt touch the concerning text nodes.

Steps to reproduce:

  1. Store xml (with whitespace-only text nodes) as xmltype (binary) in a table
    E.g. <p xml:space="preserve">This <b>is</b> <i>a</i> test.</p>
    (Note the space between "is" and "a".)
  2. Retrieve the xml from the table
  3. Transform the retrieved xml
    select xmlquery('
    copy $tmp := .
    modify ()
    return $tmp
    ' passing v_xmldata returning content

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center