Home » SQL & PL/SQL » SQL & PL/SQL » preserve whitespaces in xml
preserve whitespaces in xml [message #250353] Mon, 09 July 2007 14:05 Go to next message
yerics
Messages: 89
Registered: August 2006
Member
I have a table that contains character data containing multiple whitespaces.
For eg a varchar2 column named RESOURCE_ENTITY containing data * *.
(lot of whiteSpaces between 2 stars).

When I use XMLAGG(XMLFOREST(Resource_entity as "ResourceEntity") in my sql query, the whitespaces are removed and the XML is displayed as
<ResourceEntity>* *</ResourceEntity>
instead of
<ResourceEntity>* *</ResourceEntity>

Any idea how to preserve the whitespaces.
Re: preserve whitespaces in xml [message #250354 is a reply to message #250353] Mon, 09 July 2007 14:09 Go to previous messageGo to next message
Michel Cadot
Messages: 65155
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I can't see any difference between your 2 lines.
Maybe if you read and follow How to format your posts we can see it.
And maybe this is the same reason there is no difference in XML. Wink

Regards
Michel

[Updated on: Mon, 09 July 2007 14:09]

Report message to a moderator

Re: preserve whitespaces in xml [message #250356 is a reply to message #250353] Mon, 09 July 2007 14:19 Go to previous message
yerics
Messages: 89
Registered: August 2006
Member
Sorry for the post, xmlagg does seem to preserve whitespaces, but when I write it to a file using utl_file, it trims them. I will do some more research on this. Please ignore the query.
Previous Topic: What Privilege are Recd
Next Topic: Generate triggers on multiple tables (Merged)
Goto Forum:
  


Current Time: Wed Aug 23 22:12:17 CDT 2017

Total time taken to generate the page: 0.01509 seconds