[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML syntax for XPath?

  • From: Ken MacLeod <ken@b...>
  • To: xml-dev@l...
  • Date: Wed, 27 Dec 2000 08:49:13 -0600

xml notations
Sean McGrath <sean.mcgrath@p...> writes:

> At 06:05 PM 12/26/2000 -0500, Jonathan Borden wrote:
> >Simon St.Laurent wrote:
> > >
> > > Yes, but it might be interesting to create an 'XPath parser'
> > > which reads in XPath and spits out SAX events, making these
> > > critters a bit easier to process and transform internally.  Then
> > > maybe an XPath writer which takes those events and reports them
> > > as XPath again.
> >
> >     So what you want is an XPath grove parser.
> 
> What would the grove approach offer that an XML notation approach
> would not?

If you take the simple approach to groves, the advantages are that you
get a really simple set of data objects representing the parsed XPath,
and simple sets of data objects are trivially serialized using any
common format (XP, RDF, etc.).

For a parsed XPath, for example, the result would generally be a list
of steps, each step with an axis, node test, and a list of zero or
more predicates, each predicate an expression tree.

> I like the idea of a blessed XML expression of notations that are
> not natively XML (XPath, SAX events, MP3:-). Blessing XML notation
> for these allows implementers to implement XML import/export and
> allows integrators to join things together using their XML toolbox
> for the glue.

An advantage of unique XML notations per spec is generally terseness
of the resulting XML.  A disadvantage of unique XML notations per spec
is the necessity of implementing readers/writers for each one
individually.

Adopting an "Info Set" approach for notations that are not native XML
would make support in many languages either incredibly simple, or at
least not complex.  In Python, for example, reading and writing XML in
a known format, according to an info set, and converting into and out
of objects is almost a gimme.  In Java, it's not too difficult either,
even if one goes as far as dynamically generating classes to provide
convenient getters and setters for the data model.

An "Info Set" approach can also make non-language support easier too.
The effect of having a generalized format for serialization would make
reusable patterns of XSLT transforms fairly common.

  -- Ken

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.