Eric van der Vlist wrote:
> But the xsi:type is really wrong and a XML Schema processor should > report a validation error if it sees:
This can be solved by using a different attribute name, as you suggested.
> 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).
Well, XML Schema uses QNames for the types. So if we really are using XML Schema types, then I think using QNames is a good solution.
Now if we don't really need XML Schema types, I would say it's ok to dump the prefix.
> 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.
I didn't know about this.
> 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?).
For this, no problem: the "content-type" attribute may specify the original encoding, e.g.:
content-type="text/plain; charset=iso-8859-1"
Which I think is a good reason to call the attribute "content-type".
So there would just be the issue of those special characters. How can they be escaped?
> With all these troubles, I wonder if that's not better to serialize > plain text as base64 :-( !
I don't think so. At least not yet. It's just so convenient to manipulate text as text in XSLT, for example.
-Erik
------------------------------------------------------- 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_id=6595&alloc_id=14396&op=click _______________________________________________ orbeon-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/orbeon-user
