bug? XML generation - problem with white space
Posted in 2008
Topics: Server Administration, Data Types & Schema Design, Migration, Import/Export & Data Conversion
Hi ,
IDS 11.50 UC1 Developer
Linux SuSe 10.2
I have a table with LVARCHAR field and want to generate XML from there.
I already do that successfully, but have one problem with the white spaces and CR+LF .
The white spaces are trimmed.
This table have a column called "resposta" with LVARCHAR(10000)
eg.:
Executing the SQL bellow in dbaccess:
*********************************************
unload to "x.unl"select trim(resposta) from t_resposta_lv
where resposta matches "*B-Tree *"
;
*********************************************
***** This is the result:
*********************************************
Flag:\\
16 0x10 B-Tree Node Page\\
32 0x20 B-Tree Root Node\\
64 0x40 B-Tree Twig Node\\
128 0x80 B-Tree Leaf Node\\
32768 0x8000 B-Tree Leaf Page containing deleted Items\\
\\
Os valores exibidos no oncheck são em HEX:\\
90 = Node + Leaf\\
30 = Note + Root\\
\\
\\
\\
|
*********************************************
***** After the first line all lines have at least 5 spaces character.
***** So, when XML are generate:
*********************************************
select genxmlelemclob(row(resposta),"linha") from t_resposta_lv
where resposta matches "*B-Tree *"
*********************************************
***** The result is:
*********************************************
<linha>
<row>
<resposta> Flag:
16 0x10 B-Tree Node Page
32 0x20 B-Tree Root Node
64 0x40 B-Tree Twig Node
128 0x80 B-Tree Leaf Node
32768 0x8000 B-Tree Leaf Page containing deleted Items
Os valores exibidos no oncheck são em HEX:
90 = Node + Leaf
30 = Note + Root
</resposta>
</row>
</linha>
*********************************************
***** After the first line ("Flag") each line have only ONE space character....
For me this is a bug... or I forgot something???
Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
http://br.mail.yahoo.com/
Cesar Inacio Martins wrote:
> Hi ,
>
> IDS 11.50 UC1 Developer
> Linux SuSe 10.2
>
> I have a table with LVARCHAR field and want to generate XML from there.
>
> I already do that successfully, but have one problem with the white
> spaces and CR+LF .
> The white spaces are trimmed.
>
> This table have a column called "resposta" with LVARCHAR(10000)
> eg.:
>
> Executing the SQL bellow in dbaccess:
> *********************************************
> unload to "x.unl"> select trim(resposta) from t_resposta_lv
> where resposta matches "*B-Tree *"
> ;
>
> *********************************************
> ***** This is the result:
> *********************************************
> Flag:\\
> 16 0x10 B-Tree Node Page\\
> 32 0x20 B-Tree Root Node\\
> 64 0x40 B-Tree Twig Node\\
> 128 0x80 B-Tree Leaf Node\\
> 32768 0x8000 B-Tree Leaf Page containing deleted Items\\
> \\
> Os valores exibidos no oncheck são em HEX:\\
> 90 = Node + Leaf\\
> 30 = Note + Root\\
> \\
> \\
> \\
> |
> *********************************************
> ***** After the first line all lines have at least 5 spaces character.
> ***** So, when XML are generate:
> *********************************************
>
> select genxmlelemclob(row(resposta),"linha") from t_resposta_lv
> where resposta matches "*B-Tree *"
>
> *********************************************
> ***** The result is:
> *********************************************
> <linha>
> <row>
> <resposta> Flag:
> 16 0x10 B-Tree Node Page
> 32 0x20 B-Tree Root Node
> 64 0x40 B-Tree Twig Node
> 128 0x80 B-Tree Leaf Node
> 32768 0x8000 B-Tree Leaf Page containing deleted Items
>
> Os valores exibidos no oncheck são em HEX:
> 90 = Node + Leaf
> 30 = Note + Root
>
>
>
> </resposta>
> </row>
> </linha>
>
> *********************************************
> ***** After the first line ("Flag") each line have only ONE space
> character....
>
>
> For me this is a bug... or I forgot something???
>
>
>
> ------------------------------------------------------------------------
> Abra sua conta no Yahoo! Mail
> <http://br.rd.yahoo.com/mail/taglines/mail/*http://br.mail.yahoo.com/>,
> o único sem limite de espaço para armazenamento!
So, are you saying that :
"genxmlelemclob appears to change multiple spaces to a single space"
i.e. Column a has "The quick brown fox jumped the lazy cat"
but genxmlelemclob will produce :
<row>
<cola>The quick brown fox jumped the lazy cat
</cola>
</row>
In which case, yes I would say that this is a "bug" (or defect)