469,953 Members | 1,936 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

namespaces and validating with heirarchical schemas

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 "

The relevant lines in Schemas _1 to _3:

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

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.00"
<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,


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
0 1231

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by tysontate | last post: by
6 posts views Thread by inerte | last post: by
6 posts views Thread by Iain | last post: by
1 post views Thread by Dan Bass | last post: by
reply views Thread by Patrick Brunmayr | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.