OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XML-QL (was Re: Whence XQL?)

[ Lists Home | Date Index | Thread Index ]
  • From: "Roger L. Costello" <costello@mitre.org>
  • To: "Matthew Sergeant (EML)" <Matthew.Sergeant@eml.ericsson.se>
  • Date: Thu, 25 Mar 1999 08:48:07 -0500

Matthew Sergeant (EML) wrote:
> 
> My problem with XML-QL was their use of tag minimisation (their proprietary
> </> syntax) means you can't parse XML-QL with an XML parser. That's foolish
> IMHO - if you're practically using XML already, why not reap the benefits?

Hi Matt,

Not sure that you could do all the things that XML-QL allows you to do
if you stick to the XML syntax.  Example, query the following XML
document for all part names:

<?xml version="1.0"?>
<!DOCTYPE Parts [
<!ELEMENT Parts (part+)>
<!ELEMENT part (name, brand, part*)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT brand (#PCDATA)>
]>
<Parts>
        <part>
                <name>Green Power Juicer</name>
                <brand>Green Power</brand>
        </part>
        <part>
                <name>Toyota Tercel</name>
                <brand>Toyota</brand>
                <part>
                     <name>Sony Stereo X11-3</name>
                     <brand>Sony</brand>
                </part>
        </part>
</Parts>

Note the recursive definition of the part element.  Thus, the part name
can be at any nesting level.  Here's how to do it using XML-QL:

function AllPartNamesQuery () {

// Source: Parts.xml
// Find the names of all the parts

construct  <name>$name</name>
where      <Parts>
               <part*>
                   <name>$name</name>
               </>
           </Parts> IN "Parts.xml"
}

How would you do this using XML syntax?  /Roger


> 
> Anyway, there's an implementation of XML-QL in my directory on CPAN for perl
> users, which needs fixing up a little bit, but it's quite usable (if a
> little slow). It facilitates the use of perl's regexp syntax for queries as
> well as the system used by XML-QL, which makes it nice and powerful...
> 
> Matt.
> --
> http://come.to/fastnet
> Perl on Win32, PerlScript, ASP, Database, XML
> GCS(GAT) d+ s:+ a-- C++ UL++>UL+++$ P++++$ E- W+++ N++ w--@$ O- M-- !V
> !PS !PE Y+ PGP- t+ 5 R tv+ X++ b+ DI++ D G-- e++ h--->z+++ R+++
> 
> > -----Original Message-----
> > From: Roger L. Costello [SMTP:costello@mitre.org]
> > Sent: Thursday, March 25, 1999 11:58 AM
> > To:   Ed Howland
> > Cc:   'xml-dev@ic.ac.uk'; 'xsl-list@mulberrytech.com'
> > Subject:      Re: Whence XQL?
> >
> > Have you looked at XML-QL?  I have been playing around with this XML
> > query tool for a few weeks.  It's quite nice.  It allows you to specify
> > the grammer of extracted data, query multiple XML documents, etc.  See:
> > <http://www.research.att.com/sw/tools/xmlql>  /Roger
> >
> >


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)


  • References:
    • RE: Whence XQL?
      • From: "Matthew Sergeant (EML)" <Matthew.Sergeant@eml.ericsson.se>



 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS