Le jeudi 10 f�vrier 2005 � 22:59 +0100, Erik Bruchez a �crit :
> Eric van der Vlist wrote:
> > Le jeudi 10 f�vrier 2005 � 22:23 +0100, Erik Bruchez a �crit :
> > 
> >>Eric van der Vlist wrote:
> >>
> >>
> >>>Hmmm... encoding would be equally bad... what about "serialization" ?
> >>
> >>Maybe. What would you say when it's embedded XML?
> > 
> > 
> > The options could be "base64Binary", "text" and "XML".
> > 
> > The name could also be "serialization-type" (more verbose but maybe more
> > explicit).
> 
> I kind of liked using names from XML Schema.

But the xsi:type is really wrong and a XML Schema processor should
report a validation error if it sees:

 <document xsi:type="xs:string" content-type="text/plain">
This is line one of the input document! This is line two of the input
document! This is line three of the input document!
  </document>

Also, using a QName like in "xs:string" means that you must declare the
xs namespace and in principle applications should check against the
namespace URI associated with the prefix and the local name (which is
verbose to do with XSLT 1.0).

Of course , we could use
serialization-type="xs:string/xs:base64Binary/xs:anyType" but I don't
see the benefit.

BTW, speaking of text/plain, I think that this case is much more
troublesome than it appears.

First, a text can contain characters that are not allowed in XML (such
as the characters between 0 and 8.

Second, to serialize the text, you need to change its encoding and that
means that you have no roundtrip and are currently not able to give back
the original text and that can be a problem for many applications.

For instance, in HTML, the description of the encoding in the meta tag
can become incoherent with the actual encoding.

To work around these issues, I think that you should add an attribute to
store the initial encoding, so that you can restore it when you deliver
the text back as text and also find something to "escape" the characters
that are forbidden (maybe empty elements?).

With all these troubles, I wonder if that's not better to serialize
plain text as base64 :-( !

Eric  
> 
-- 
Weblog:
                 http://eric.van-der-vlist.com/blog?t=category&a=English
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to