|
|
|
Ben Lowery wrote:
I just wrote up some code [1] to figure this out. It appears that the XmlValidatingReader can resolve entities, so this should work. However, you probably want to specify the ValidationType on the reader explicitly if it's not already being done; if the reader sees a DTD, it will most likely switch to DTD-based validation. So, in theory, it's possible. I don't have my CCNET instance readily available, so I can't test to see if CCNET current supports it. It would be super easy to test if it did though. Also, Mike, here's the full URL that worked for me: http://peeps.dallas.focus-technologies.com/roller/page/nithy/20040128#using_the_entity_includes_in fixed in build 934. as suggested i set the ValidationType to None. this disallows schema validation and i needed to change some tests that were using the ccnet.xsd. i wrote a test to verify that this works together with NetReflector.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This link explains XML entities in detail:
http://tech.irt.org/articles/js212/
You declare an external entity like this:
<!ENTITY section1 SYSTEM "path/to/section_1.xml">
And you use it like this:
<document>
§ion1;
</document>
So for cruise control, for example, you can do:
<!ENTITY project1 SYSTEM "project1.xml">
<!ENTITY project2 SYSTEM "project2.xml">
<!ENTITY project3 SYSTEM "project3.xml">
<cruisecontrol>
&project1;
&project2;
&project3;
</cruisecontrol>
Further, in each project you could take common settings and break them out as well:
<!EMTITY schedule SYSTEM "schedule.xml">
<!ENTITY sourcecontrol SYSTEM "sourcecontrol.xml">
<!ENTITY buildnant SYSTEM "buildnant.xml">
<!ENTITY standardtasks SYSTEM "stdtasks.xml">
<!ENTITY publishers SYSTEM "publishers.xml">
<project name="project1">
<webURL>http://localhost/iis/ccweb</webURL>
&schedule;
&sourcecontrol;
&buildnant;
&stdtasks;
&publishers;
<modificationDelaySeconds>10</modificationDelaySeconds>
</project>
This should work with any XML application. It's part of the standard, and entities are used heavily by XHTML. Unfortunately, a lot of people "wrote their own XML parser" for their application, and when you have to deal with the full XML feature set, these usually fail miserably to handle fundamental XML features such as external entities.