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

Re: Schematron validation based on the contents of another file!

  • From: "Steve Muench" <smuench@u...>
  • To: "Rick Jelliffe" <ricko@a...>
  • Date: Wed, 3 Nov 1999 10:21:35 -0800

iata sql
Another simple corollary is that since:

  document()

can take a uri, that uri can be a URL and that URL
can resolve to a server that delivers schema rules
out of a runtime database dictionary.

The would let you write validations, for example,
in a schema representing an airline reservation
that a <DepartureAirport> must be one of
the 9000+ valid three-letter airport codes, but
no other three-letter combination.

You certainly don't want to parse an XML file
with the 9000 codes in it to find it the airport
code "XML" is a valid one, so you can setup
a server-side, URL-accessible "XML Data Service"
that tells you the answer by looking in a database,
returning the answer to you in a little "datagram"
of XML, via the "document()" function in XSLT.

Here's roughly how you could do it...

By installing the Oracle XSQL Servlet (or similar
server-side assistant for combining SQL/XML/XSLT)
and writing a server-side query like:

  <query rowset-element="AIRPORTS" row-element="AIRPORT">
     SELECT description, code
           FROM all_airport_codes
        WHERE code = UPPER('{@code}'
  </query>

Then a URL like:

    http://iata.org/airport-check.xsql?code=XML

Will return an XML document like:
<?xml version = '1.0'?>
<AIRPORTS>
   <AIRPORT num="1">
      <CODE>XML</CODE>
      <DESCRIPTION>Minlaton, Sa, Australia</DESCRIPTION>
   </AIRPORT>
</AIRPORTS>

You can use the:


select="document(concat('http://iata.org/airport-check.xsql?code=',.)/AIRPOR
TS/AIRPORT"

to check if the code was found...

________________________________________________________
Steve Muench, BC4J Development Team & XML Evangelist
http://technet.oracle.com/tech/java
http://technet.oracle.com/tech/xml
----- Original Message -----
From: Rick Jelliffe <ricko@a...>
To: <xml-dev@i...>
Sent: Wednesday, November 03, 1999 9:51 AM
Subject: Re: Schematron validation based on the contents of another file!


| Wow, that is a great find. I think it allows us to have external
| controlled vocabularies, but ones where we don't care on the DTD that
| that vocabulary is stored in: by having smarter links (i.e, Xpaths) we
| can locate particular fields in the remote document regardless of the
| element names used.
|
| Rick Jelliffe
|
| -----Original Message-----
| From: Miloslav Nic <nicmila@v...>
| To: xsl-list <xsl-list@m...>; xml-dev@i...
| <xml-dev@i...>
| Date: Wednesday, 3 November 1999 21:51
| Subject: Schematron validation based on the contents of another file!
|
|
| >I have added two more examples to Schematron tutorial at:
| >http://zvon.vscht.cz/HTMLonly/SchematronTutorial/General/contents.html
| >
| >I have just realized, that Schematron engines  based on XSLT can use
| >XSLT function: document() to perform this type of validation.
| >
| >Example 18
| >A paragraph in XML 2 can only start with words specified in XML 1 (file
| >source1.xml)
| >
| >Example 17
| >XML 1 (file source1.xml) contains a list of authors. These authors are
| >referred to in XML 2. The Schematron checks if for each referred author
| >in XML 2 exists an entry in XML 1.
| >--
| >***************************************************************
| >Dr. Miloslav Nic                        e-mail: nicmila@v...
| >Department of Organic Chemistry         TEL: +420 2 2435 5012
| >ICT Prague (VSCHT Praha)                     +420 2 2435 4118
| >            FAX: +420 2 2435 4288
| >****************************************************************
| >Support free information exchange: http://zvon.vscht.cz
| >****************************************************************
| >
| >xml-dev: A list for W3C XML Developers. To post,
| mailto:xml-dev@i...
| >Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
| CD-ROM/ISBN 981-02-3594-1
| >To unsubscribe, mailto:majordomo@i... the following message;
| >unsubscribe xml-dev
| >To subscribe to the digests, mailto:majordomo@i... the following
| message;
| >subscribe xml-dev-digest
| >List coordinator, Henry Rzepa (mailto:rzepa@i...)
| >
|
|
| xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
| Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
CD-ROM/ISBN 981-02-3594-1
| To unsubscribe, mailto:majordomo@i... the following message;
| unsubscribe xml-dev
| To subscribe to the digests, mailto:majordomo@i... the following
message;
| subscribe xml-dev-digest
| List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
|


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



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.