Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:08:13+00:00 2026-05-26T01:08:13+00:00

Does a template/code generator already exist that tracks user changes to it’s output? I’m

  • 0

Does a template/code generator already exist that tracks user changes to it’s output? I’m not even posative this makes sense – but the space cadet in me thinks something like this could be an interesting kind of change tracking that integrates more tightly to the code than SCM…

Data.xml

<Classes>
 <Class>Class1</Class>
</Classes>

Template

<# for(var c in XDocument.Load("Data.xml").Element("Classes").Elements("Class")) { #>
     class <#=c.Value#> {
       public <#=c.Value#>() {
         // <InsertPoint>
         // </InsertPoint>
       }
     }
<# } #>

Output

class Class1 {
  public Class1() {
    // <InsertPoint>
    // </InsertPoint>
  }
}

User Change

class Class1 {
  public Class1() {
    // <InsertPoint>
    System.Console.WriteLine("I am Class1");
    // </InsertPoint>
  }
}

–> The template changes to something like:

<# for(var c in XDocument.Load("Data.xml").Element("Classes").Elements("Class")) { #>
class <#=c.Value#> {
  public <#=c.Value#>() {
  // <UserInsert id="1">
  System.Console.WriteLine("I am Class1");
  // </UserInsert>

  // <InsertPoint>
  // </InsertPoint>
  }
}
<# } #>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:08:13+00:00Added an answer on May 26, 2026 at 1:08 am

    What you have in data.xml is what’s normally called a model. Being done in XML, we could call this a “tree model”. In other words, you are applying (executing) templates according to a pre-defined model.

    Tracking user changes in this case can also be called “round-trip” engineering: a bi-directional change.

    The ABSE project (disclaimer: I am the project lead) defines a model-driven code generation approach that is very close to your request: It uses executable templates and generates code by means of a tree model (but it’s not XML). But instead of detecting your changes in code, you can add your own code directly in the model so that you can skip the “round-trip” step.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Template code is not compiled until the template function is used. But where does
Why this code does not compile (Cygwin)? #include <vector> template <class Ttile> class Tilemap
Why does the following code give me an error (g++ 4.1.2)? template<class A> class
The following code doesn't compile with gcc, but does with Visual Studio: template <typename
For 2 child template files inheriting a block, the {{ block.super }} does not
The type or namespace name 'Resources' does not exist in the namespace 'MyWebProject.Web' (are
Does nettiers available for windows form? it is very good template for codesmith code
does anyone know any tool for 'code generation' using MVC2? I know that ASP
In my project, legacy code generates xml which has following structure : <Output> <Template
I have a JET Template that is meant to generate code for an interface

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.