You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Alex Moffat <aj...@zanthan.com> on 2002/11/03 22:01:27 UTC

[PATCH] Patch for TraXLiaison to allow for easier overriding

I maintain XSLTXT which is a compact form for encoding xslt stylesheets 
(http://www.zanthan.com/ajm/xsltxt/). I want to extend the ant "style" 
task so that it can use stylesheets encoded in xsltxt. The easiest way 
for me to do this is to override and extend TraXLiaison and use the 
processor attribute on the style task to point to my extended class. 
However, I can currently do this as the fucntionality I need is embedded 
in private methods. The attached patch adds two new methods 
getXSLTXTSource, that returns the Source for the stylesheet, and 
makeFactory, that constructs the TransformerFactory. I've run the 
appropriate tests and they all pass.

Hopefully this patch is suitable for inclusion in the ant sources.

Thanks
Alex

Re: [PATCH] Patch for TraXLiaison to allow for easier overriding

Posted by Alex Moffat <aj...@zanthan.com>.
Christian Wolfgang Hujer wrote:

> Hello Alex,
>
>
> Am Sonntag, 3. November 2002 22:01 schrieb Alex Moffat:
>
> >I maintain XSLTXT which is a compact form for encoding xslt stylesheets
> >(http://www.zanthan.com/ajm/xsltxt/). I want to extend the ant "style"

[cut]

> But: How das XSLTXT detect the end of the para, the otherwise and the 
> choose
> section? By indention? Geee! People already hate make!

But people love Python :) Make's indentation is mainly hated because of 
the fact that it's the special invisible indentation of the tab 
character that's important.

> I'd rather like to write:
>
[cut]

> Use {} for blocks and indention doesn't matter.

Discussions of indentation vs {} for marking blocks can go on for ever, 
some like python style and some like perl

> Using ; as simple statement delimiters allows to even omit {} if a block
> contains only one statement. This shortens further.
>
> "" would not have been neccessary, for what distinction? From Vars? 
> They are
> preceeded with $count already.

>
> So use "" only for strings as such, like "'blabla'" and  in XSLT or
> for literal result text nodes.
>
> whenever if has an else, choose when otherwise is used instead of if.
> test is always used for when or if, so it is superflous.
>
> Colon for parameters? Usually always = is used for assignment, and : is
> associated with namespaces.

Most of the decisions were made because of the desire to keep things as 
simple as possible for the implementation, and to require as little 
translation in going from xsltxt to xsl and vice versa as possible. 
Certainly other choices could have been made but they would have 
complicated the lexer beyond what I wanted to deal with. For my purposes 
what I have works reasonable well, perhaps I'll revisit the syntax in 
the future and make some of the changes you suggest.

>
> Anyway I can't use XSLTXT because I already use XSLT 2.0 (saxon 7.2).

I'll probably look at xslt 2.0 in the future.

>
>
> But the idea is great.
>
>
> Bye




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] Patch for TraXLiaison to allow for easier overriding

Posted by Christian Wolfgang Hujer <Ch...@itcqis.com>.
Hello Alex,


Am Sonntag, 3. November 2002 22:01 schrieb Alex Moffat:
> I maintain XSLTXT which is a compact form for encoding xslt stylesheets
> (http://www.zanthan.com/ajm/xsltxt/). I want to extend the ant "style"
I have taken a look at the site you cited.

choose
  when .test "$count > 1"
    call "by-columns" ("column-count":"$count")
  otherwise
    <para>
      "No columns"

Basically, the idea is great.
I see fewer sources for typos and not-wellformedness.

But: How das XSLTXT detect the end of the para, the otherwise and the choose 
section? By indention? Geee! People already hate make!

I'd rather like to write:

if ($count > 1) {
  call by-columns(column-count=$count);
} else {
  <para> {
    "No columns";
  }
}

or:

if ($count > 1)
  call by-columns(column-count=$count);
else
  <para>"No columns";


Use {} for blocks and indention doesn't matter.

Using ; as simple statement delimiters allows to even omit {} if a block 
contains only one statement. This shortens further.

"" would not have been neccessary, for what distinction? From Vars? They are 
preceeded with $count already.
So use "" only for strings as such, like "'blabla'" and <xsl:text/> in XSLT or 
for literal result text nodes.

whenever if has an else, choose when otherwise is used instead of if.
test is always used for when or if, so it is superflous.

Colon for parameters? Usually always = is used for assignment, and : is 
associated with namespaces.

Anyway I can't use XSLTXT because I already use XSLT 2.0 (saxon 7.2).

But the idea is great.


Bye
-- 
ITCQIS GmbH
Christian Wolfgang Hujer
Geschäftsführender Gesellschafter
Telefon: +49  (0)89  27 37 04 37
Telefax: +49  (0)89  27 37 04 39
E-Mail: Christian.Hujer@itcqis.com
WWW: http://www.itcqis.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>