Altova Mailing List Archives


Re: [xml-dev] MicroXPath proposal

From: Michael Kay <mike@--------.--->
To: xml-dev@-----.---.---
Date: 1/13/2011 9:49:00 AM
Oh dear, yet another XPath subset. And they're all different. And most 
of them aren't subsets - few can resist adding something, though most 
people have the decency to do it by adding functions rather than new syntax.

Please, why is this needed? And what were your criteria for deciding, 
say, that "|" or ">" aren't needed?

Michael Kay
Saxonica

On 13/01/2011 06:12, John Cowan wrote:
> I've been thinking a lot about MicroXML, MicroXSD, MicroRNG, etc., and
> I thought I'd take a stab at a MicroXPath.  This is intended to be,
> like the others, the simplest thing that could possibly work.
> However, I'm not a frequent XPath user, so I may have put together
> something that is *too* simple to work.  So I'm posting here for
> comments.  (I'm using this address because xml-dev drops posting from
> my permanent cowan@c... address on the floor, for some reason).
>
> One principle is that since elements are the only kind of node in the
> MicroXPath data model, XPath expressions return only lists of
> elements.  Another is that 100% compatibility with XPath 1.0 isn't
> essential, since most XPath expressions are fairly transient compared
> to XML documents or schemas.
>
> So here's what I've got.  The only kind of expression is a location
> path.  Location paths can be absolute or relative, and their steps can
> be separated by either / or //.  A path step is an element name, star,
> dot, or dot-dot.
>
> Only one predicate is allowed per step, and it has to take one of
> these eight forms:
>
> 1)      a literal number
>
> 2)      last()
>
> 3)      location-path="string"
>
> 4)      @name="string"
>
> 5)      location-path/@name="string"
>
> 6)      @@name="string"
>
> 7)      location-path/@@name="string"
>
> 8)      function(.)
>
> @@ means "inheritable attribute", and is provided for brevity and
> convenience.  In form 8, the function name is provided externally to
> XPath (there are no built-in functions except last()), and accepts the
> current element node and returns a boolean value.  This is the
> programmatic escape from MicroXPath that allows complex predicates.
>
> What's missing?  What can I take out?  Comments solicited.
>
> --
> John Cowan       http://www.ccil.org/~cowan<cowan@c...>
>         You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
>         You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
>                 Clear all so!  `Tis a Jute.... (Finnegans Wake 16.5)
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@l...
> subscribe: xml-dev-subscribe@l...
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.