473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Hierarchical Schema File Organization

Hi, everyone,

I'm designing my first XML-based application and am stuck on an issue that I
presume is pretty simple. I'm trying to write a schema that can be used to
validate my XML file. However, I want to define components of this schema
in different files so that I can do isolated tests on these subsections. As
an example, consider this XML file:

<container>
<name>Me</name>
<object>
...
</object>
</container>

In my program, there is a class for the 'container' type and a class for the
'object' type. I'd like to be able to make a unit test for my 'object' XML
I/O as well as the 'container' XML I/O. However, to do this I need a schema
for both types. Then, to avoid redundancy, I don't want the 'container'
schema to define how the 'object' component will look. I'd prefer to have
the 'container' schema refer to the 'object' schema which will be defined in
another file.

Can this be done? If not, is there a better way to set up unit tests for my
components so that I can verify that they work in isolation before trying to
use the 'object' code in the 'container' code?

Thanks!
Scott

--
Remove .nospam from my e-mail address to mail me.

http://www.e-scott.net
Jul 20 '05 #1
1 1635
"Scott Brady Drummonds" <sc**********************@intel.com> wrote in
message news:cn**********@news01.intel.com...
Hi, everyone,

I'm designing my first XML-based application and am stuck on an issue that I presume is pretty simple. I'm trying to write a schema that can be used to validate my XML file. However, I want to define components of this schema
in different files so that I can do isolated tests on these subsections. As an example, consider this XML file:


A couple of days later I found a book that had my answer. I'm posting a
synopsis here for posterity.

The key here is the use of the <import> tag in the <schema> section. In the
top-level schema file definition, calling <import> on the file that contains
definitions that are needed and specifying the a namespace prefix for the
namespace, definitions in the other file can be referenced through the
<element> tag's "ref" attribute. Therefore definitions in one XML schema
file can be used in another.

Scott
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Leo | last post by:
In my XML file, I have to elements: "person" and "organization", which are exchangable. Since these two elements are nearly identical, I plan to write an abstract element "agent" in my schema and...
1
by: Bruce W.1 | last post by:
I want an XML file to describe hierarchical data where each node is different. Each node will contain different and varied other nodes. Describing this in an XML file would be easy but I'm having...
1
by: Oleg Ogurok | last post by:
Hi all, I'm trying to create a simple XML structure for storing tree-stryle data for a forum-like software, e.g. each post will have a body field, the ID of the user who posted the message, and...
3
by: farseer | last post by:
Hello, i have a schema which also imports the XHTML schema: <xsd:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"/> This...
7
by: Robert Stearns | last post by:
I ran the following bit of SQL and my PRIMARY KEY wound up in schema SYSIBM called SQL.... not schema is3 called primary. The index registation did wind up there. Obviously there's something I...
3
by: MR | last post by:
Is there a way to load an XML schema into a dataset from a resource or other object? I am using ReadXmlSchema(filename) and that works fine. However, I have many XSD files that I would rather not...
1
by: Garris, Nicole | last post by:
We've actually implemented this kind of thing in a different DBMS. The physical design consists of a single "organization" table that's something like: Org_key (primary key) Org_type (group,...
8
by: Phil Lee | last post by:
I'm sure this is possible but I just can't see how to do it. I want to add schemas to my solution and have C# classes automatically generated from them. I can see how to generate typed DataSet's...
4
by: Mike J | last post by:
You can find the Tablane extensions for RSS(draft) at: http://www.tablane.net/schema/tblspec.htm The hierarchical structured information can be carried via RSS feed. We'd like to hear comment....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.