Res: bug? XML generation - problem with white space
Posted in 2008
Hi TBP,
Exactly !!!
This is a common behave with HTML, but this can't happen with XML....
the W3C (who's specifies XML) rules say:
"An XML processor MUST always pass all characters in a document that are not markup through to the application. A validating XML processor MUST also inform the application which of these characters constitute white space appearing in element content."
The functions what generate XML have the behavior of a HTML output and this is wrong...
Unfortunately I study over IDS Developer version, and is not possible to report this to IBM support....
----- Mensagem original ----
De: TBP <thebigpotato@nothere.co.uk>
Para: informix-list@iiug.org
Enviadas: Sexta-feira, 6 de Junho de 2008 8:08:57
Assunto: Re: bug? XML generation - problem with white space
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)
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
http://br.mail.yahoo.com/