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

Using schema to validate xml file segment

P: n/a
Hello All,

I have a very large XML file that I would like to split up into a few
smaller files, but still use only one schema. I am using Xerces C++

My idea is to have one schema specified in the main file. At some
point in the schema I would add a choice element that would either
have a tag that specifies an external file or a tree of tags. Once
the main xml file is loaded I would search for any instances where the
external file tag was populated and load that external file. I would
then want to use the schema specified in the main file to validate it.
Is there a way to move to a specific section of the schema file
specified in the main file and use that section to validate another
xml file?

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs=""
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="EXAMPLE">
<xs:element name="EXTERNAL_FILE_NAME"/>
<xs:element name="TEST_DATA">
<xs:element name="TEST1"/>
<xs:element name="TEST2"/>

In this case if EXTERNAL_FILE_NAME was populated I would read in that
file and validate it against the schema using the sub tree starting at
<xs:element name="TEST_DATA">.

Any suggestions would be appreciated.

Aaron (ap*******

Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.