By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,088 Members | 1,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,088 IT Pros & Developers. It's quick & easy.

namespaces and validating with heirarchical schemas

P: n/a
I'm a newbie to XML and primarily program in SAS, so even though I've
consulted documentation, I can't translate into language I understand.
I hope I can explain the problem clearly.

The project I'm currently on starts with XML files (say, 10 as an
example) that, after validation, are reconfigured via SAS for Teradata
loading. Since we're in development, the location of needed schemas
isn't fixed, often moving as phases are completed or copied to local
directories. Sometimes both the server and subdirectory name changes
and sometimes the subdirectory name changes but the server doesn't.

The 10 input files validate against 4 schemas and I'm looking for a way
to generalize file paths so I only have to edit as few files as
possible--preferably one--instead of multiple files.
============================================
In the following example the schemas are in the same subdirectories.

The File1.xml header looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Schema_1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="\\Fil-1\User1\Schema_1.xsd "
version="1.0">

The relevant lines in Schemas _1 to _3:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.00"
id="R2006.1">
<xs:include schemaLocation="\\Fil-1\User1\Schema_2.xsd"/>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.00"
id="R2006.1">
<xs:include schemaLocation="\\Fil-1\User1\Schema_3.xsd"/>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.00"
id="R2006.1">
<xs:include schemaLocation="\\Fil-1\User1\Schema_4.xsd"/>

Schema_4 terminates the process.
=========================================

Now, suppose Schema_4 is moved to the Development subdirectory on the
same server,

"\\Fil-1\Development\Schema_4.xsd"/

and since it's used by all input files I have a bunch of files (at
level _3) to modify. If all the Schema_3's move, I have a bunch of
level _2's to modify. If only some files move, I have different
locations for the same schema level.

In SAS I would create a global variable that resolves to the locations
and they would be passed to subsequent programs. I guess I'm looking
for a way to declare the locations in the input file. Or, is there a
way to involve another schema where I can declare the locations?

Apr 19 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.