groovyでXSLTを動かす
groovy で実行できるかちょっと調べる。
>copy %ANT_HOME%\lib\ant-trax.jar %GROOVY_HOME%\lib groovy> new AntBuilder().xslt(in:"groovy.xml", out:"groovy.kwd" ,style:"groovy.xsl") Discarding invalid text: groovysh script: 1: could not use 'in' at 1:23; not valid as an identifier in this context new AntBuilder().xslt(in:"groovy.xml", out:"groovy.kwd" ,style:"groovy.xsl") groovy>
build.xml と同じ形式だと in がキーワードなのでうまくうごかず、ちょっと悩むがなんとかできた。
in を使う書き方と in 自体を使わない書き方の二つ。
groovy> new AntBuilder().xslt(["in":"groovy.xml", "out":"groovy.kwd" ,"style":"groovy.xsl"]) groovy> go [xslt] Processing E:\temp\groovy.xml to E:\temp\groovy.kwd [xslt] Loading stylesheet E:\temp\groovy.xsl >groovysh groovy> new AntBuilder().xslt(destdir:'.', includes:'groovy.xml', style:'groovy.xsl', out:"groovy.kwd", extension:'.kwd') groovy> go [xslt] Transforming into E:\temp [xslt] Processing E:\temp\groovy.xml to E:\temp\groovy.kwd [xslt] Loading stylesheet E:\temp\groovy.xsl groovy>