XML-QL (was Re: Whence XQL?)

Roger L. Costello costello at mitre.org
Thu Mar 25 13:47:28 GMT 1999


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 at mitre.org]
> > Sent: Thursday, March 25, 1999 11:58 AM
> > To:   Ed Howland
> > Cc:   'xml-dev at ic.ac.uk'; 'xsl-list at 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 at 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 at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list