xsl-list
[Top] [All Lists]

Re: [xsl] Code generation template structuring

2016-03-25 17:24:38
Hi Joseph,

That’s how I’d tackle it, too.

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

Gerrit

On 25.03.2016 23:15, Joseph L. Casale jcasale(_at_)activenetwerx(_dot_)com 
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
Geschäftsfü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(_dot_)imsieke(_at_)le-tex(_dot_)de, http://www.le-tex.de

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

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Code generation template structuring, Joseph L. Casale jcasale(_at_)activenetwerx(_dot_)com
    • Re: [xsl] Code generation template structuring, Imsieke, Gerrit, le-tex gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de <=