views:

172

answers:

4

Hi,

I am using CodeSmith to Generate The Files in my Project. It has functionalities to Merge the C#/VB & SQL files using Insert Region & Preserve Region Strategies.

How Can I extend these to merge the XML files I am creating?.

Thanks

+1  A: 

Actually, CodeSmith supports merging XML files just like it does C# and VB files using regions. You just need to use <!-- region Some Region Name --> and <!-- endregion --> to mark and name your regions of code.

Does that help or do you need more information?

Eric J. Smith
+1  A: 

Hello,

I'm pretty sure you will have to write your own merge strategy for this. Please take a look at the following blog post.

Thanks -Blake Niemyjski

A: 

Whats the syntax for preserve regions for SQL? Is it:

--region Some Region Name
--endregion

Or something else?

Seeriuss
A: 

Hello,

For T-SQL your code would need to look like this:

RegionNameRegex should be set to ^[ \t][ \s]"?(?i:Custom)"?; Language should be set to "T-SQL";

Your regions should look like this:

--region Custom Parameters

--endregion

I have created a sample template located here.

Thanks -Blake Niemyjski

Blake Niemyjski