You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Andy Clark <an...@apache.org> on 2002/08/01 01:52:50 UTC
Re: is full UNICODE input roundtrip possible with Xerces 2?
Aleksander Slominski wrote:
> i would like to round-trip XML document content as UNICODE.
While we designed XNI to pass as much information as
reasonably possible, we don't intend it to be used for
100% round-trip processing.
However, you could do the following:
* before the root element
* print line + '\n'
* in the DTD internal subset
* print " [\n" on startInternalSubset
* print line + '\n' on decls
* print ']' on endInternalSubset
* after the root element
* print '\n' + line
It won't come out exactly as it went in but it's
"pretty" enough for most people to read.
--
Andy Clark * andyc@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
Re: is full UNICODE input roundtrip possible with Xerces 2?
Posted by Petr Kuzel <Pe...@sun.com>.
Andy Clark wrote:
>
> Aleksander Slominski wrote:
> > i would like to round-trip XML document content as UNICODE.
>
> While we designed XNI to pass as much information as
> reasonably possible, we don't intend it to be used for
> 100% round-trip processing.
>
> However, you could do the following:
>
> * before the root element
> * print line + '\n'
> * in the DTD internal subset
> * print " [\n" on startInternalSubset
> * print line + '\n' on decls
> * print ']' on endInternalSubset
> * after the root element
> * print '\n' + line
>
> It won't come out exactly as it went in but it's
> "pretty" enough for most people to read.
You omitted your favorite approach. Alex can write
his own configuration with his scanner that supplies
additional information through private channel/API.
I planned to take this approach for 2-way editor,
however have not realized it yet.
Cc.
--
<address>
<a href="mailto:pkuzel@sun.com">Petr Kuzel</a> at Sun Microsystems
: <a href="http://xml.netbeans.org/">XML module</a> and
: <a href="http://jini.netbeans.org/">Jini</a> developer.</address>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
Re: is full UNICODE input roundtrip possible with Xerces 2?
Posted by Andy Clark <an...@apache.org>.
Aleksander Slominski wrote:
> i think i could do it i.e. to change xerces to do full round tripping as
> new feature for Xerces2 (i have already experimented with something
> similar moths ago by patching support for precise event location)
> however as not many people seems to be interested in it ...
Only a small minority of the XML application developers
really need round-tripping. Most of them are in the XML
editor camp and want the file to stay *exactly* the same
way it was when it was read in.
>>It won't come out exactly as it went in but it's
>>"pretty" enough for most people to read.
>
> so i guess you mean 'pretty printing; i.e. during serialization to call:
> System.out.println()
Yep, I was referring to pretty-printing of the XML to
a stream.
> still what do you mean exactly "line" in "print '\n' + line"?
For example, if you have a comment *before* the root
element, then you serialize the comment and follow it
with a newline. That way you get something like this:
<!-- comment -->
<root/>
instead of this:
<!-- comment --><root/>
And the same is true for comments and processing
instructions appearing after the close of the root
element -- but you would print the newline before
serializing the XML. For example:
<root/>
<?target data?>
<!-- comment -->
instead of:
<root/><?target data?><!-- comment -->
For most people, that's "pretty" enough, I think. :)
--
Andy Clark * andyc@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
Re: is full UNICODE input roundtrip possible with Xerces 2?
Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Andy Clark wrote:
> While we designed XNI to pass as much information as
> reasonably possible, we don't intend it to be used for
> 100% round-trip processing.
hi,
i think i could do it i.e. to change xerces to do full round tripping as
new feature for Xerces2 (i have already experimented with something
similar moths ago by patching support for precise event location)
however as not many people seems to be interested in it ...
> * before the root element
> * print line + '\n'
> * in the DTD internal subset
> * print " [\n" on startInternalSubset
> * print line + '\n' on decls
> * print ']' on endInternalSubset
> * after the root element
> * print '\n' + line
>
> It won't come out exactly as it went in but it's
> "pretty" enough for most people to read.
so i guess you mean 'pretty printing; i.e. during serialization to call:
System.out.println()
still what do you mean exactly "line" in "print '\n' + line"?
thanks,
alek
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org