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

Re: XML Schema: Getting lookup tables from DB

load dataset from xml
Hi Craig,

Long, Craig Z wrote:

>I have a schema file that will validate large lookup tables.  I'm wanting to
>include another .XSD in my main .XSD that will grab the lookup table
>information.  For example: States are identified by two characters i.e. HI =
>Hawaii,  instead of enumerating these state codes I want to get them from a
>data base.  The state codes are easy, my issue would be codes that identify
>many organizations that may change often -- can this be done using XML
Interesting question. One answer might be  the  use of URL addressable 
(REST-compatible) web services. You could pick up a dynamically 
generated enum at schema-load time by having, for example,


If you don't want to use enums at all (maybe the dataset is too large) 
then you could use a schematron assertion to individually check fields 
online at runtime, for example:

<sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
    <sch:ns prefix="cdyne" uri="http://ws.cdyne.com/" />
    <sch:title>Schematron Validator for cardlist</sch:title>
    <sch:pattern name="valid card number">
        <sch:rule context="card">
@number))/cdyne:ReturnIndicator/cdyne:CardValid = 'true'">Invalid card 

(this actually works - apologies to cdyne.com if the service starts 
getting hammered)

Obviously the choice between schema build time, schema load time and 
field validation time calls involves performance, server workload and 
versional integrity issues which should be considered carefully.



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.
First Name
Last Name
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.