It certainly doesn't look right as Some Text and maybe some more text are
split within the root node by other nodes.

I mean what you get by referencing myObj.root? Would expect both text text
values?




"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Adrian Lynch
To: CF-Talk
Sent: Fri Jun 15 18:12:30 2007
Subject: RE: setting xml encoding

So are you saying that the following is wrong?

<root>
        Some text
        <a-tag/>
        Maybe some more text
        <another-tag/>
</root>

Because it's more or less the same as the following surely?

<root>

        <a-tag/>

        <another-tag/>
</root>

Adrian

-----Original Message-----
From: Brad Wood [mailto:[EMAIL PROTECTED]
Sent: 15 June 2007 18:02
To: CF-Talk
Subject: RE: setting xml encoding


> Have I changed the actual data being transferred one iota?

Yes. The second example has two text nodes within root, and two text
nodes
within book.

I'm not talking about a technical standpoint, I'm talking about from a
practical standpoint.  I still maintain that there is no practical
reason to include the white space in the xml.

> Give me a SINGLE example of an application which should act
> differently based on the second xml string as opposed to the
> first.  Maybe that example exists, and I am more than willing
> to accept it, but I haven't seen it yet.

I gave you an example: haikus and other poems. If you were to write an
application that displays those, it would have to treat whitespace as
meaningful.

A haiku is not XML.  You did not give me an example of an XML string
with white space between the tags in which an application would need it
to handle the data.  (Note, I am not talking about white space between a
corresponding start and end tag as that would actually make sense since
it is part of the data being transferred.  I speak of white space after
one ending tag and before another starting tag)  This discussion is not
about haikus, limericks, or iambic pentameter.  It is about xml as a
means to define and transfer data and the fact that I have seen no
actual, real-life, honest-to-goodness reason whatsoever that would
require an application to be aware of white space between the nodes to
be able to correctly receive, and process the data contained within the
XML.  Let's say I were to store a haiku in an XML string.  Regardless of
whether each line was stored separately, or if it was stored as one
large string, the text would reside in the value of a tag's attribute or
the inner text of one tag.  In both of those scenarios white space IS
significant since it is within a tag.  That is not the scope of this
discussion however.  The white space outside of tags is what we are
talking about.


> How does an XML parser know whether whitespace is significant or not?

Because its an XML PARSER!  By virtue of the fact that xml is the type
of string it is parsing it can be drawn that significant data is NOT
stored outside of tags, and therefore any characters outside of a tag
are one of two things:
1) illegal
2) meaningless.

The two xml strings below are NOT equal in my opinion:

<tag1>
        <tag2 />
        <tag3 />
</tag1>

<tag1><extra_tag_you_dont_want><tag2 /><extra_tag_you_dont_want><tag3
/><extra_tag_you_dont_want></tag1>

That is exactly what Mozilla does. It takes the 2 children of tag1 and
adds three siblings.  That may seem right from some technical,
scientific, sterile point of view, but seems downright wrong to me.

Because we know:
1) The string is xml
2) XLM does not store data OUTSIDE of a tag
3) Elements of an xml document are defined by a "<tagname>" syntax

Why would a parser create elements out of white space?  Strictly
speaking from a practical point of view, when in the history of XML has
someone received a string of text which is known to be xml, and needed
data from outside of the tags?  I don't think that has ever happened.

I guess it should be noted that I am not necessarily arguing about how
XML parsing is currently defined as much as I am how I think it SHOULD
be defined if you were to logically think through how it is used.  I
think the "correct" interpretation that Mozilla conforms to is wrong
because it implicitly creates un-wanted elements out of characters which
are NOT supposed to designate the existence of elements.

~Brad





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281311
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to