You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2001/07/27 21:08:55 UTC

Enhancement to jakarta-site2 -- XSLT stylesheet equivalent to "site.vsl"

For those folks who like the idea of using a common stylesheet for
generating documentation and web sites from XML input documents across
multiple Jakarrta projects, but don't necessarily want to be tied to
Anakia, you now have a choice.  I've added an XSLT stylesheet
(xdocs/stylesheets/site.xsl) that is pretty close to functional
equivalence with the "site.vsl" macros used by Anakia.  Remaining TODOs
are listed at the top of the file to finish up, but you can run "ant xslt"
in jakarta-site2 and examine the generated pages to see how close it
already is.  The last few things are relatively minor.

Both approaches can read the same XML input documents, because they use
the same sets of elements to render the same kind of HTML.  The only
important difference when you set things up in Ant relates to the
generation of relative URLs.

* Anakia is typically invoked with an includes attribute like
  "**/*.xml", to recursively process an entire tree of XML sources.
  The Anakia processor creates a "relativePath" variable reflecting
  the location of the current source file in the directory hierarchy,
  so that things like the navigation menu links are calculated
  appropriately.

* To use XSLT, the simplest solution I found was to generate each
  directory's worth of HTML in a separate invocation of the <style>
  tag, and pass a parameter to the XSLT stylesheet telling it what
  the appropriate relative path prefix is.  The jakarta-site2 build.xml
  file illustrates this approach to building the Jakarta web site,
  which has two directory levels (top-level and the "site"
  subdirectory).  There might be some more elegant way to approach
  this, but hey ... it works.

Please help me debug this stylesheet, and improve its compatibility with
site.vsl, by checking out the jakarta-site2 module and running the
"xslt" target.  NOTE:  you will need to make sure that your Ant install
includes the appropriate optional.jar file, and has access to either
JAXP/1.1 (crimson.jar, jaxp.jar, and xalan.jar) or Xerces+Xalan.

Craig McClanahan




---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org


Xerces breaking Stylebook ?

Posted by Vincent Massol <vm...@octo.com>.
Hi,

As this issue is involving several parties, I'm posting here. Hope this is
fine.

Since the 10th of august 2001, GUMP is reporting an error when building the
Cactus web site using stylebook. It was running fine on the 9th. It seems an
error has been introduced by xerces as the xerces version prior to 10th was
working fine and the one after is breaking stylebook. Cactus is using the
latest Xalan2, Xerces, stylebook-1.0-b3_xalan-2.jar

Is anyone else having the same problem (It doesn't seem so as looking at the
GUMP build logs reveal no stylebook problem) ?

The error is quite anonymous :

[stylebook] [StyleBook] Overriding
targetDirectory="/home/rubys/jakarta/jakarta-commons/cactus/out/servlet22/di
st/doc" (Old=".")
[stylebook] [StyleBook] Project URL: "sbk:/sources/book.xml"
[stylebook] [BasicEngine] Initializing
[stylebook] [Loader] Parsing Project file
[stylebook] [Xalan2Processor] Applying XSL sheet
"sbk:/style/stylesheets/book2project.xsl"
[stylebook] [Loader] Caught org.apache.stylebook.CreationException
[stylebook] [StyleBook] Caught org.apache.stylebook.LoadingException
[stylebook] org.apache.stylebook.LoadingException
[stylebook] at org.apache.stylebook.Loader.load(Unknown Source)
[stylebook] at org.apache.stylebook.StyleBook.getProject(Unknown Source)
[stylebook] at org.apache.stylebook.StyleBook.main(Unknown Source)
[stylebook] [StyleBook] Error creating project

Any idea ?
Thanks
-Vincent Massol


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org


Re: Enhancement to jakarta-site2 -- XSLT stylesheet equivalent to "site.vsl"

Posted by Jon Stevens <jo...@latchkey.com>.
This entire email is *exactly* why I push for version numbers in jar files.

Yes, classpath was empty

Yes, ant 1.3

-jon


on 7/27/01 3:01 PM, "Craig R. McClanahan" <cr...@apache.org> wrote:

> 
> 
> On Fri, 27 Jul 2001, Jon Stevens wrote:
> 
>> on 7/27/01 12:08 PM, "Craig R. McClanahan" <cr...@apache.org> wrote:
>> 
>>> Please help me debug this stylesheet, and improve its compatibility with
>>> site.vsl, by checking out the jakarta-site2 module and running the
>>> "xslt" target.  NOTE:  you will need to make sure that your Ant install
>>> includes the appropriate optional.jar file, and has access to either
>>> JAXP/1.1 (crimson.jar, jaxp.jar, and xalan.jar) or Xerces+Xalan.
>>> 
>>> Craig McClanahan
>> 
>> For the life of me, I can't get the .jar file foo correct...
>> 
> 
> Empty classpath, right?
> 
>> -jon
>> 
>> [204][ ~/checkout/jakarta-site2 ]% ant xslt
>> Buildfile: build.xml
>> 
>> xslt:
>>     [style] Transforming into /Users/jon/checkout/jakarta-site2/xslt
>>     [style] Loading stylesheet
>> /Users/jon/checkout/jakarta-site2/xdocs/stylesheets/site.xsl
>>     [style] Failed to read stylesheet stylesheets/site.xsl
>> 
>> BUILD FAILED
>> 
>> /Users/jon/checkout/jakarta-site2/build.xml:103:
>> javax.xml.transform.TransformerConfigurationException: Namespace not
>> supported by SAXParser
>> --- Nested Exception ---
>> 
>> Total time: 2 seconds
>> 
>> [205][ ~/checkout/jakarta-site2 ]% dir $ANT_HOME/lib/
>> total 1584
> 
> Ant 1.3, right?
> 
>>    0 drwxrwxr-x   9 jon      staff         262 Jul 27 13:49 ./
>>    0 drwxrwxr-x   9 jon      staff         262 Mar 11 13:40 ../
>>    4 -rw-r--r--   1 jon      staff         153 Mar  2 04:46 README
>>  292 -rw-r--r--   1 jon      staff      295934 Mar  2 04:46 ant.jar
>>  184 -rw-rw-r--   1 jon      staff      187246 Mar 23 17:23 crimson.jar
>>  244 -rw-rw-r--   1 jon      staff      247802 Mar 14 07:09
>> jakarta-ant-1.3-optional.jar
>>    8 -rw-r--r--   1 jon      staff        5537 Mar  2 04:46 jaxp.jar
>>  136 -rw-r--r--   1 jon      staff      136198 Mar  2 04:46 parser.jar
>>  716 -rw-r--r--   1 jon      staff      732330 May 23 05:45 xalan.jar
>> 
> 
> In my JAXP/1.1 release (and my $ANT_HOME/lib directory), file sizes are:
> 187162  crimson.jar
>  28404  jaxp.jar
> 801714   xalan.jar
> 
>> [206][ ~/checkout/jakarta-site2 ]% dir lib
>> total 1668
>>    0 drwxrwxr-x   9 jon      staff         262 Jul 27 13:47 ./
>>    0 drwxrwxr-x  18 jon      staff         568 Jul 27 13:43 ../
>>    0 drwxrwxr-x   6 jon      staff         264 Jul 16 16:08 CVS/
>>  292 -rw-rw-r--   1 jon      staff      295934 Mar 11 13:48 ant-1.3.jar
>>  184 -rw-rw-r--   1 jon      staff      187246 Mar 23 17:23 crimson.jar
>>   28 -rw-rw-r--   1 jon      staff       28404 Mar  4 05:35 jaxp.jar
>>   80 -rw-r--r--   1 jon      staff       78541 Feb 14 11:56 jdom-b6.jar
>>  368 -rw-rw-r--   1 jon      staff      373565 Apr 30 13:24
>> velocity-1.0.1.jar
>>  716 -rw-r--r--   1 jon      staff      732330 May 23 05:45 xalan.jar
>> 
> 
> This stuff shouldn't matter when you execute the "ant" script directly,
> instead of through build.sh/build.bat.  The key issue is that
> "ant" resolves to $ANT_HOME/bin/ant for the $ANT_HOME library directory
> you listed above.
> 
> Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org


Re: Enhancement to jakarta-site2 -- XSLT stylesheet equivalent to "site.vsl"

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 27 Jul 2001, Jon Stevens wrote:

> on 7/27/01 12:08 PM, "Craig R. McClanahan" <cr...@apache.org> wrote:
> 
> > Please help me debug this stylesheet, and improve its compatibility with
> > site.vsl, by checking out the jakarta-site2 module and running the
> > "xslt" target.  NOTE:  you will need to make sure that your Ant install
> > includes the appropriate optional.jar file, and has access to either
> > JAXP/1.1 (crimson.jar, jaxp.jar, and xalan.jar) or Xerces+Xalan.
> > 
> > Craig McClanahan
> 
> For the life of me, I can't get the .jar file foo correct...
> 

Empty classpath, right?

> -jon
> 
> [204][ ~/checkout/jakarta-site2 ]% ant xslt
> Buildfile: build.xml
> 
> xslt:
>     [style] Transforming into /Users/jon/checkout/jakarta-site2/xslt
>     [style] Loading stylesheet
> /Users/jon/checkout/jakarta-site2/xdocs/stylesheets/site.xsl
>     [style] Failed to read stylesheet stylesheets/site.xsl
> 
> BUILD FAILED
> 
> /Users/jon/checkout/jakarta-site2/build.xml:103:
> javax.xml.transform.TransformerConfigurationException: Namespace not
> supported by SAXParser
> --- Nested Exception ---
> 
> Total time: 2 seconds
> 
> [205][ ~/checkout/jakarta-site2 ]% dir $ANT_HOME/lib/
> total 1584

Ant 1.3, right?

>    0 drwxrwxr-x   9 jon      staff         262 Jul 27 13:49 ./
>    0 drwxrwxr-x   9 jon      staff         262 Mar 11 13:40 ../
>    4 -rw-r--r--   1 jon      staff         153 Mar  2 04:46 README
>  292 -rw-r--r--   1 jon      staff      295934 Mar  2 04:46 ant.jar
>  184 -rw-rw-r--   1 jon      staff      187246 Mar 23 17:23 crimson.jar
>  244 -rw-rw-r--   1 jon      staff      247802 Mar 14 07:09
> jakarta-ant-1.3-optional.jar
>    8 -rw-r--r--   1 jon      staff        5537 Mar  2 04:46 jaxp.jar
>  136 -rw-r--r--   1 jon      staff      136198 Mar  2 04:46 parser.jar
>  716 -rw-r--r--   1 jon      staff      732330 May 23 05:45 xalan.jar
> 

In my JAXP/1.1 release (and my $ANT_HOME/lib directory), file sizes are:
  187162  crimson.jar
   28404  jaxp.jar
 801714   xalan.jar

> [206][ ~/checkout/jakarta-site2 ]% dir lib
> total 1668
>    0 drwxrwxr-x   9 jon      staff         262 Jul 27 13:47 ./
>    0 drwxrwxr-x  18 jon      staff         568 Jul 27 13:43 ../
>    0 drwxrwxr-x   6 jon      staff         264 Jul 16 16:08 CVS/
>  292 -rw-rw-r--   1 jon      staff      295934 Mar 11 13:48 ant-1.3.jar
>  184 -rw-rw-r--   1 jon      staff      187246 Mar 23 17:23 crimson.jar
>   28 -rw-rw-r--   1 jon      staff       28404 Mar  4 05:35 jaxp.jar
>   80 -rw-r--r--   1 jon      staff       78541 Feb 14 11:56 jdom-b6.jar
>  368 -rw-rw-r--   1 jon      staff      373565 Apr 30 13:24
> velocity-1.0.1.jar
>  716 -rw-r--r--   1 jon      staff      732330 May 23 05:45 xalan.jar
> 

This stuff shouldn't matter when you execute the "ant" script directly,
instead of through build.sh/build.bat.  The key issue is that
"ant" resolves to $ANT_HOME/bin/ant for the $ANT_HOME library directory
you listed above.

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org


Re: Enhancement to jakarta-site2 -- XSLT stylesheet equivalent to "site.vsl"

Posted by Jon Stevens <jo...@latchkey.com>.
on 7/27/01 12:08 PM, "Craig R. McClanahan" <cr...@apache.org> wrote:

> Please help me debug this stylesheet, and improve its compatibility with
> site.vsl, by checking out the jakarta-site2 module and running the
> "xslt" target.  NOTE:  you will need to make sure that your Ant install
> includes the appropriate optional.jar file, and has access to either
> JAXP/1.1 (crimson.jar, jaxp.jar, and xalan.jar) or Xerces+Xalan.
> 
> Craig McClanahan

For the life of me, I can't get the .jar file foo correct...

-jon

[204][ ~/checkout/jakarta-site2 ]% ant xslt
Buildfile: build.xml

xslt:
    [style] Transforming into /Users/jon/checkout/jakarta-site2/xslt
    [style] Loading stylesheet
/Users/jon/checkout/jakarta-site2/xdocs/stylesheets/site.xsl
    [style] Failed to read stylesheet stylesheets/site.xsl

BUILD FAILED

/Users/jon/checkout/jakarta-site2/build.xml:103:
javax.xml.transform.TransformerConfigurationException: Namespace not
supported by SAXParser
--- Nested Exception ---

Total time: 2 seconds

[205][ ~/checkout/jakarta-site2 ]% dir $ANT_HOME/lib/
total 1584
   0 drwxrwxr-x   9 jon      staff         262 Jul 27 13:49 ./
   0 drwxrwxr-x   9 jon      staff         262 Mar 11 13:40 ../
   4 -rw-r--r--   1 jon      staff         153 Mar  2 04:46 README
 292 -rw-r--r--   1 jon      staff      295934 Mar  2 04:46 ant.jar
 184 -rw-rw-r--   1 jon      staff      187246 Mar 23 17:23 crimson.jar
 244 -rw-rw-r--   1 jon      staff      247802 Mar 14 07:09
jakarta-ant-1.3-optional.jar
   8 -rw-r--r--   1 jon      staff        5537 Mar  2 04:46 jaxp.jar
 136 -rw-r--r--   1 jon      staff      136198 Mar  2 04:46 parser.jar
 716 -rw-r--r--   1 jon      staff      732330 May 23 05:45 xalan.jar

[206][ ~/checkout/jakarta-site2 ]% dir lib
total 1668
   0 drwxrwxr-x   9 jon      staff         262 Jul 27 13:47 ./
   0 drwxrwxr-x  18 jon      staff         568 Jul 27 13:43 ../
   0 drwxrwxr-x   6 jon      staff         264 Jul 16 16:08 CVS/
 292 -rw-rw-r--   1 jon      staff      295934 Mar 11 13:48 ant-1.3.jar
 184 -rw-rw-r--   1 jon      staff      187246 Mar 23 17:23 crimson.jar
  28 -rw-rw-r--   1 jon      staff       28404 Mar  4 05:35 jaxp.jar
  80 -rw-r--r--   1 jon      staff       78541 Feb 14 11:56 jdom-b6.jar
 368 -rw-rw-r--   1 jon      staff      373565 Apr 30 13:24
velocity-1.0.1.jar
 716 -rw-r--r--   1 jon      staff      732330 May 23 05:45 xalan.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org