[
Lists Home |
Date Index |
Thread Index
]
> Hi Uche,
>
> > > So how would one "bury a data model" in it even if one wanted to?
> >
> > You do so by adding in an XSD schema location pointer. Then, suddenly, when I
> > run it unsuspectingly through my XPath2 engine, drags in all sorts of unwanted
> > magic into my processing.
>
> What sorts of unwanted magic is draggged in? Going back to my aircraft example:
>
> <aircraft>
> <elevation>12000</elevation>
> </aircraft>
I just have a moment, so I'll offer a weaker and a stronger objection.
Weaker: I would not automatically like <xsl:sort> to assume that this requires
a number sort. This is weaker because I *could* force the issue by always
explicitly saying <xsl:sort datatype="string">. But it is still an objection
because the assumption of datatype="number" is magic, and I don't like magic.
Stronger. If elsewhere I have
<elevation>012000</elevation>
Then when I do a
$ele1 = $ele2
I do not want them to come back equal unless I *tell* the XPath processor to
normalize to number before evaluating, which I do in XPath 1.0 as follows:
number($ele1) = number($ele2)
I would even settle for
xsd-float($ele1) = xsd-float($ele2)
This is a stronger objection because the last time I read it, XPath 2.0
doesn't give me an out form this if a schema is specified.
> Wouldn't it be useful to be able to find that the elevation element contains an
> integer that is restricted to the range 0-20000? Further, if the data model
> provided "aliases" then I might even be able to find that "aircraft" and "plane"
> are synonymous. Isn't this useful information?
>
> I have always thought that the more information that I have, the better decisions I
> can make in processing the data. A data model (whether the data model is an XML
> Schema, or an RDF Schema) provides me with additional data that would be useful in
> processing the data, yes? /Roger
Grr. Do I have to make this a mantra? Do I have to add it to my sig so I
don't have to repeat it daily?
Again, I have no fundamental problem with data types. I also have no problem
with the additional information you trumpet as being available for processing.
My objection is to the way that XPath 2.0 and co bake such facilities into
XPath so that the burden is on me to dodge them when I want to process XML as
text, which is all XML is at its basis.
If users had to write
<xsl:pragma-enable-datatyping/>
in stylesheets where they wanted to use WXS magic, then I would be mostly
satisfied. Yes. That *tiny* little change to XPath 2.0 would go almost all
the way to addressing my concerns.
I don't have a problem with WXS magic. I just don't want it to be embedded
into the core of any specs I use.
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Tour of 4Suite - http://www.xml.com/pub/a/2002/10/16/py-xml.html
Proper XML Output in Python - http://www.xml.com/pub/a/2002/11/13/py-xml.html
RSS for Python - http://www-106.ibm.com/developerworks/webservices/library/ws-p
yth11.html
Debug XSLT on the fly - http://www-106.ibm.com/developerworks/xml/library/x-deb
ugxs.html
|