History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CCNET-239
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Owen Rogers
Reporter: Mike Roberts
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
CruiseControl .NET

Allow per-project config files

Created: 03/Nov/04 07:32 PM   Updated: 29/Sep/09 02:24 PM
Component/s: Source Control
Affects Version/s: 1.1.1
Fix Version/s: 0.9.1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Zip Archive XmlFileEntities.zip (4 kb)

Environment: Windows 2000


 All   Comments   Work Log   Change History      Sort Order:
You can use an DTD entity in the XML to get this to a limited extent.

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>
  &section1;
</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&lt;/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.

Owen Rogers [17/May/05 08:44 PM]
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

Owen Rogers [19/May/05 01:58 PM]
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.