You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Etienne Deleflie <et...@proxima-tech.com> on 2001/07/03 06:21:09 UTC

Transform errors with xsl:include

Hi,

I have created a URIResolver which seems to work fine, but I keep
getting transform errors from the included xsl file (when there should
not be)

The URIResolver is set to the TransformerFactory:-
TransformerFactory factory = TransformerFactory.newInstance();
 factory.setURIResolver(uriResolver);

The URIResolver resolves a StreamSource form a URL object:-
StreamSource myStreamSource = new StreamSource( url.openStream() );

The file is found and the StreamSource is created without problems, but
when I then get a transform error from the included xsl file:-
Transform error: Characters are not allowed at this point in the
document!

The included xsl file is as follows:-
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:attribute-set name="font">
  <xsl:attribute name="font-name">Arial</xsl:attribute>
  <xsl:attribute name="font-size">14px</xsl:attribute>
  <xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>

am I going barmy?

etienne


Re: Transform errors with xsl:include

Posted by Etienne Deleflie <et...@proxima-tech.com>.
Hello again,

The problem is solved. There is no bug involved, just a typo.

<xsl:include href="second.xsl">  instead of  <xsl:include
href="second.xsl"/>

The source of the confusion is that the TransformerConfigurationException
I was getting has no way of telling me which XSL file the problem was in.

I thought I was confirming that it was not in the original xsl file
because removing the include line removed the problem ...........hence
thinking it must be in the include file ............ when, in fact,
removing the include line solved the problem because the typo was in the
include tag!!!

etienne


Etienne Deleflie wrote:

> Hi,
>
> I have created a URIResolver which seems to work fine, but I keep
> getting transform errors from the included xsl file (when there should
> not be)
>
> The URIResolver is set to the TransformerFactory:-
> TransformerFactory factory = TransformerFactory.newInstance();
>  factory.setURIResolver(uriResolver);
>
> The URIResolver resolves a StreamSource form a URL object:-
> StreamSource myStreamSource = new StreamSource( url.openStream() );
>
> The file is found and the StreamSource is created without problems, but
> when I then get a transform error from the included xsl file:-
> Transform error: Characters are not allowed at this point in the
> document!
>
> The included xsl file is as follows:-
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:attribute-set name="font">
>   <xsl:attribute name="font-name">Arial</xsl:attribute>
>   <xsl:attribute name="font-size">14px</xsl:attribute>
>   <xsl:attribute name="font-weight">bold</xsl:attribute>
> </xsl:attribute-set>
> </xsl:stylesheet>
>
> am I going barmy?
>
> etienne