Scott Brady Drummonds
Usenet Archive
- Joined
- Jul 3, 2003
- Messages
- 37
- Reaction score
- 0
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
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