[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Code generation template structuring

Subject: Re: Code generation template structuring
From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Mar 2016 22:24:32 -0000
Re:  Code generation template structuring
Hi Joseph,

Thatbs how Ibd tackle it, too.

Just one hint: donbt call the named template 'left-pad'. Bad karma ;)

Gerrit

On 25.03.2016 23:15, Joseph L. Casale jcasale@xxxxxxxxxxxxxxxxx wrote:
I have some xslt v2 code that I use for a visual studio solution to generate some C# code.
I'd like to refactor out some repetition and reuse some similar templates however they
currently generate code used in different locations and as such the leading empty space
padding differs, for example:

     public void Foo()
     {
         //...
     }

versus

         public void Foo()
         {
             //...
         }

I thought of creating a template that took a padding parameter and built up a sequence
after which it output each element of the sequence prefixed with the padding count and
ending in a linebreak.

Is there a better way for this type of thing?
Thanks,
jlc



-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard VC6ckler

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.