You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mary Milne <mm...@cambridge.org> on 2006/05/10 16:25:41 UTC

xslt extension question

hi

i'm trying to run the <xslt> task using saxon.jar - that bits fine ie 
<xslt classpath="${lib}/saxon.jar"..................

the problem is the xslt script has an extension to make the output SGML ie 
<xsl:output method="my.sgml.jar".............

so the question is: how do i pass the location of this jar file to saxon?

i've tried:

1. adding it to the classpath <xslt 
classpath="${lib}/saxon.jar:${lib}/SGMLEmitter.jar"
2. adding a <classpath> element to <xslt>
3. adding it to the ant/lib along with saxon.jar

but.... nothing worked. any ideas greatly appreciated.

cheers mary

Re: xslt extension question

Posted by Dominique Devienne <dd...@gmail.com>.
> sadly i need sgml not html. running the script with saxon on a command
> line is fine
>
> ie java -cp saxon.jar:.:SGMLEmitter.jar icl.org.saxon.StyleSheet xslt
> input out
>
> (sorry haven't got the line at hand but its close enough) but now i want
> to invoke it from ant's xslt task and the doc seems to say the callpath
> att is for the xslt proc - fine - but the proc ie saxon.jar can't find
> SGMLEmitter.jar - hence problem.

I guess it's possible Saxon attempts to load the class from the system
classloader, instead of the context classloader, or the classloader
that loaded Saxon itself.

In this case, try setting the CLASSPATH env. var to include
SGMLEmitter.jar before invoking Ant. If this does indeed solve your
issue, please inform Mr. Kay, so that he may attempt to load custom
emitters in a more Ant-friendly fashion.

Thanks, --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: xslt extension question

Posted by Dominique Devienne <dd...@gmail.com>.
> don't you need something like
>
> xsl:output/@method="myprefix:sgml"
>
> ? I didn't know you could put the jar file there. If you can, then would
> you need the path set correctly? Do you have it in the same directory as
> the XSL?

Yeah, that's a funny syntaxt, isn't it? But note that @method read
"my.sgml.jar", which could be a class or package name in
SGMLEmitter.jar... Just guessing ;-) --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: xslt extension question

Posted by Robert Koberg <ro...@koberg.com>.
Mary Milne wrote:
> hi robert
> 
> sadly i need sgml not html. running the script with saxon on a command 
> line is fine
> 
> ie java -cp saxon.jar:.:SGMLEmitter.jar icl.org.saxon.StyleSheet xslt 
> input out


don't you need something like

xsl:output/@method="myprefix:sgml"

? I didn't know you could put the jar file there. If you can, then would 
you need the path set correctly? Do you have it in the same directory as 
the XSL?

Anyway, you could try to run the build with the -verbose flag to get 
more information.

best,
-Rob



> 
> (sorry haven't got the line at hand but its close enough) but now i want 
> to invoke it from ant's xslt task and the doc seems to say the callpath 
> att is for the xslt proc - fine - but the proc ie saxon.jar can't find 
> SGMLEmitter.jar - hence problem.
> 
> cheers mary
> 
> Robert Koberg <ro...@koberg.com> wrote on 10/05/2006 15:34:58:
> 
>> Mary Milne wrote:
>>> hi
>>>
>>> i'm trying to run the <xslt> task using saxon.jar - that bits fine ie 
>>> <xslt classpath="${lib}/saxon.jar"..................
>>>
>>> the problem is the xslt script has an extension to make the output 
> SGML ie 
>>> <xsl:output method="my.sgml.jar".............
>> This is not valid.
>>
>> Why not just use method="html" with whatever? Also just set 
>> doctype-public and doctype-system to your particular values.
>>
>> best,
>> -Rob
>>
>>
>>> so the question is: how do i pass the location of this jar file to 
> saxon?
>>> i've tried:
>>>
>>> 1. adding it to the classpath <xslt 
>>> classpath="${lib}/saxon.jar:${lib}/SGMLEmitter.jar"
>>> 2. adding a <classpath> element to <xslt>
>>> 3. adding it to the ant/lib along with saxon.jar
>>>
>>> but.... nothing worked. any ideas greatly appreciated.
>>>
>>> cheers mary


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: xslt extension question

Posted by Mary Milne <mm...@cambridge.org>.
hi robert

sadly i need sgml not html. running the script with saxon on a command 
line is fine

ie java -cp saxon.jar:.:SGMLEmitter.jar icl.org.saxon.StyleSheet xslt 
input out

(sorry haven't got the line at hand but its close enough) but now i want 
to invoke it from ant's xslt task and the doc seems to say the callpath 
att is for the xslt proc - fine - but the proc ie saxon.jar can't find 
SGMLEmitter.jar - hence problem.

cheers mary

Robert Koberg <ro...@koberg.com> wrote on 10/05/2006 15:34:58:

> Mary Milne wrote:
> > hi
> > 
> > i'm trying to run the <xslt> task using saxon.jar - that bits fine ie 
> > <xslt classpath="${lib}/saxon.jar"..................
> > 
> > the problem is the xslt script has an extension to make the output 
SGML ie 
> > <xsl:output method="my.sgml.jar".............
> 
> This is not valid.
> 
> Why not just use method="html" with whatever? Also just set 
> doctype-public and doctype-system to your particular values.
> 
> best,
> -Rob
> 
> 
> > 
> > so the question is: how do i pass the location of this jar file to 
saxon?
> > 
> > i've tried:
> > 
> > 1. adding it to the classpath <xslt 
> > classpath="${lib}/saxon.jar:${lib}/SGMLEmitter.jar"
> > 2. adding a <classpath> element to <xslt>
> > 3. adding it to the ant/lib along with saxon.jar
> > 
> > but.... nothing worked. any ideas greatly appreciated.
> > 
> > cheers mary
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Re: xslt extension question

Posted by Robert Koberg <ro...@koberg.com>.
Mary Milne wrote:
> hi
> 
> i'm trying to run the <xslt> task using saxon.jar - that bits fine ie 
> <xslt classpath="${lib}/saxon.jar"..................
> 
> the problem is the xslt script has an extension to make the output SGML ie 
> <xsl:output method="my.sgml.jar".............

This is not valid.

Why not just use method="html" with whatever? Also just set 
doctype-public and doctype-system to your particular values.

best,
-Rob


> 
> so the question is: how do i pass the location of this jar file to saxon?
> 
> i've tried:
> 
> 1. adding it to the classpath <xslt 
> classpath="${lib}/saxon.jar:${lib}/SGMLEmitter.jar"
> 2. adding a <classpath> element to <xslt>
> 3. adding it to the ant/lib along with saxon.jar
> 
> but.... nothing worked. any ideas greatly appreciated.
> 
> cheers mary



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org