XSD Processor path

Mar 8, 2010 at 8:18 PM

Hi,

 

I have a .tt that use another file (.ttinclude), my XSD is in the same folder as the ttinclude, but not the same as the TT.

For now, it doesnt find the XSD.

I checked your code for XsdProcessor, it support Env. variable and the path of the original TT.

Is there any way to know in which template file you are currently ? (the ttinclude)

Is there any way to call the XSD processor from code instead of from <#@ #> line.

 

PS: Thanks for this great toolkit.

Coordinator
Mar 8, 2010 at 9:18 PM

There is no way that I know of to determine location of the included .tt file from the included file itself.

Regarding your second question... You could run the xsd.exe utility manually, place the code it generates in another .tt file and include that file instead of using the <#@ xsd #> directive.

Mar 8, 2010 at 11:49 PM

I will eventually end up with an installer for these TT and the XSD, I will use Env. variable to resolve it.

I was going to use the manual use of XSD.exe and paste the result at the end of my TT.

But when I discovered your XSD processor, I changed my mind.

I prefer to use it as I dont have to re-run XSD.exe everytime the XSD change.

Thanks for your quick answer.

Coordinator
Mar 9, 2010 at 2:22 PM

I got around this in the generators in T4 toolbox by pushing all code generation parameters, including location of external files up to the top-most .tt file, wrapped in a Visual Studio project item template.

By the way, why not take advantage of the installer infrastructure in T4 toolbox and incorporate your templates in it?