[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xom-interest
Subject:    Re: [XOM-interest] XOM enforces whitespace for xpath text()
From:       "Pieper, Aaron" <PieperA () Pragmatics ! com>
Date:       2011-05-23 23:49:55
Message-ID: 39E09524BC114A44BBEBC0A3B49F44A408A213 () pragmail3 ! pragmatics ! com
[Download RAW message or body]

>> <endpoint>
>> 	<service>getData
>> 		<errors/>
>> 	</service>
>> </endpoint>
>>
>> The XPath expression /endpoint/service[text()='getData'] returns a
>> single node in some XML frameworks (like Dom4J)
>
>That's outrageously wrong. Gratuitously removing whitespace in mixed 
>content can have no possible excuse. It's not a violation of the XPath 
>spec, which allows you to construct the input tree any way you like,
but 
>it's totally against the accepted semantics of XML.

That's right. Like I said in my original message, I think XOM is doing
the right thing here. You've added a sprinkling of hyperbole to my
original statement, but we're in agreement.

It sounds like you strongly believe that the idea of normalizing a
document (getting rid of whitespace) is dangerous, and that Xom
shouldn't encourage it. Some other frameworks facilitate this with
methods like Dom4J's builder.setStripWhitespaceText() method, or JDom's
Format.TextMode class, so I was surprised at first when XOM didn't offer
similar out-of-the-box functionality. But, I understand why XOM doesn't
want to go in that direction. It sounds like if someone is writing code
which is dependent on whitespace stripping, they should either avoid
XOM, or they should continue implementing their own NormalizingFactory.

- Aaron
_______________________________________________
XOM-interest mailing list
XOM-interest@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic