xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: xsl:output, xsl:include, xsl:import support and file base
Date Sat, 08 Jan 2000 00:13:41 GMT
Scott Boag/CAM/Lotus wrote:
> 
> Sorry, I must have missed the original message.
> 
> > (StylesheetHandler) Imports can only occur as the first elements in the
> > stylesheet!
> 
> This is a valid error.  The stylesheet is not compliant with the standard.
> Import needs to be the first elements, according to the standard.
> 
>      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>           <xsl:import href="file:/usr/local/fusion3/root/bug/include.xsl"/>
>           <xsl:output method="html"/>
>      </xsl:stylesheet>
> 
> > org.apache.xerces.dom.DOMExceptionImpl: HIERARCHY_REQUEST_ERR
> 
> Strange.  This looks like something is trying to add a text node to the DOM
> root node, and it doesn't like it.  Ted, does this seem right?
> 
> > but what if i want relative path like xcv/index.xsl ?
> 
> Aside from the proper relative URL, you should be able to just use
> <xsl:include href="category.xsl"/>.
> 
> > > > second thing, in cocoon, if i include a xsl in another xsl with
> > <xsl:include
> > > > href="category.xsl"/> (because the included xsl is in the same
> directory),
> 
> This should work fine from the standpoint of Xalan.
> 
> The Cocoon code needs to do something along the lines of the following:
> 
>     public Document transform(Document in, String inBaseID, Document sheet,
> String sheetBaseID, Document out)
>      throws Exception {
>         XSLTInputSource i = new XSLTInputSource(in);
>         i.setSystemId (inBaseID);  // Make it so Xerces can find relative
> entities and DTDs
>         XSLTInputSource s = new XSLTInputSource(sheet);
>         i.setSystemId (sheetBaseID);  // Make it so Xalan can find relative
> xsl:include and xsl:import
>         XSLTResultTarget o = new XSLTResultTarget(out);
>         processor.process(i, s, o);
>         return out;
>     }
> 
> Stefano, does this make sense?

It sure does.

> Is it doable?

I'll try to make it work but I don't assure anything... Xalan from the
command line has a very easy way to understand where the "./" directory
is, in Cocoon, well, that's may not be that easy/portable.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------


Mime
View raw message