Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Extra white space escaping to preserve the infoset

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Bradley S. Huffman" <hip AT cs.okstate.edu>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Extra white space escaping to preserve the infoset
  • Date: Mon, 07 Jul 2003 10:48:23 -0500

I'm beginning to wonder if adding the methods appendValue(String value) and
appendEntity(String name) (or maybe just appendCharRef(char ch)) to Attribute
would make life simpler for everyone. This way instead of guessing what the
user want's, they can tell XOM exactly what they want and the serializer is
free to convert all line break to the value of line seperator. Might also
eliminate the need for any automatic escaping of attribute values.

Just a thought.

Brad

Elliotte Rusty Harold writes:

> Everyone seemed to like this idea so I went ahead and added it to my
> tree. It will be in the next d19 release. (FYI, I'm working on
> getting a CVS repository set up through java.net so you won't have to
> wait for releases in the future. However, things seem to be moving
> at a snail's pace over there right now.)
>
> As usual, answering any question opens up two more. In this case here
> are the two:
>
> 1. How should carriage returns and linefeeds in attribute values be
> affected by the serializer's explicitly set line separator? My gut
> says that if the client calls setLineSeparator, then there should be
> no escaping of line breaks of any kind, and all line breaks should be
> converted to whatever string the client passed to setLineSeparator.
>
> 2. Assuming setLineSeparator is not called explicitly, should the
> serializer also escape carriage returns in text nodes with numeric
> character references?
>
> Note that it is simply not possible in XML to preserve carriage
> returns in comments and processing instructions because numeric
> character references are not resolved in those contexts.
>
> --
>
> Elliotte Rusty Harold
> elharo AT metalab.unc.edu
> Processing XML with Java (Addison-Wesley, 2002)
> http://www.cafeconleche.org/books/xmljava
> http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest




Archive powered by MHonArc 2.6.24.

Top of Page