dunno if anyone else here has any comments on this, but here's a
thought that came to me amidst my thinking about mach-ii (not related
I promise)...

In ColdFusion when you deserialize an xml packet, the CF engine uses
what I believe is a standard Java parser to get the data out of the
packet and then turns that into an xmlNode object that can be
manipulated and generally pretty closely resembles a bunch of nested
structures and arrays.

HTML is (or was) a formatting language. The idea or the purpose behind
HTML initially was to determine formatting, such as fonts and
positioning.

XML is supposed to be a descriptor language. The idea or the purpose
behind XML initially was to _describe_ the content, so to indicate
_what_ the content is, not how the content should look. (Does this
<div> make me look fat?).

So in an XML node, you can have multiple different xml elements in any
order (I have yet to figure out from reading the standard for XSD how
this is accomplished with official XML Schemas, but it seems as though
lots of folks are doing this. My copy of XML Spy tells me it's illegal
and I can't find any info about it in the W3C docs.) So for instance:

<packet>
  <a />
  <b />
  <a />
  <c />
</packet>

Now here's the kicker, (and this is why I was confused about mach-ii's
use of XML). if we're _only_ concerned with _what_ the content is and
not how it's formatted, why does the result from the CFMX parser
(which afaik is a standard Java parser) return a,b,a and c as an array
in that order, instead of a structure with an array of 'a' elements,
an array of b elements (with one item) and an array of c elements? The
order of the content is an element of its packaging/style/display is
it not?

Also -- and this might be confusing for some developers -- if you
attempt to reference a sub-node and the nodes aren't all in order
(like above), without using xmlchildnodes explicitly in the reference,
you'll only get back the first element. So for instance,

<cfdump var="#xml.packet.xmlchildnodes[1]#">

and

<cfdump var="#xml.packet.a#">

are both valid, and they'll both return only the first 'a' element in
that packet, even though there's more than one 'a' element in it.

Has ColdFusion taken more liberty with the standard than simply
allowing it to be case-insensitive? (The standard demands that XML is
_always_ case sensitive. Imho not a bad rule to drop, although I wish
the standard would drop it instead. For elements and attributes if not
for identifiers, since nobody in their right mind would have two
attributes with the same name and different capitalization in the XSD
for a single element. But then this is also part of the reason why I
detest people using mixed-case elements and attributes in their XSD's
-- it's just a big hassle. I'd put one or two mixed case elements in
the XSD for SPEC before I realized it was case-sensitive and made them
all lower case.)

s. isaac dealey                214-823-9345

team macromedia volunteer      http://www.macromedia.com/go/team

chief architect, tapestry cms  http://products.turnkey.to

onTap is open source           http://www.turnkey.to/ontap


-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe: 
   Send UNSUBSCRIBE to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to