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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]
  • From: "Steve Muench" <smuench@us.oracle.com>
  • To: "Rick Jelliffe" <ricko@allette.com.au>
  • Date: Wed, 3 Nov 1999 10:21:35 -0800

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@allette.com.au>
To: <xml-dev@ic.ac.uk>
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@vscht.cz>
| To: xsl-list <xsl-list@mulberrytech.com>; xml-dev@ic.ac.uk
| <xml-dev@ic.ac.uk>
| 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@vscht.cz
| >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@ic.ac.uk
| >Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
| CD-ROM/ISBN 981-02-3594-1
| >To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
| >unsubscribe 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)
| >
|
|
| 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 unsubscribe, mailto:majordomo@ic.ac.uk the following message;
| unsubscribe 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)
|
|


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 unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe 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)






 

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

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