You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Chris Glynne <cg...@home.com> on 2000/09/26 05:22:24 UTC

Issue with the and

We are doing some development of a web portal musing XML and we are planning
to use Apache Xerces and Xalan java implementations for the transformation
to HTML.

We have come up with a process that makes site maintenance very easy, but
are having an issue implementing it to the fullest extent.
The issue is as follows:

- We have three files. Template.XSL, File.XML, File_Content.XSL
- The File.XML has a tag that contains the filename and path of the
File_Content.XSL
- The Template.XSL contains an include that is intended to call the tag that
is referenced in the File.XML.
- In order to use the filename as it appears in the XML file, the include
must be tailored with the <xsl:attribute> tag for the HREF of the include.

This is where we run into problems.  When running the files through the
Xalan transform with the attribute tags, the compiler chokes saying that the
include does not have an HREF attribute.

The code sample is something like this and it does not work. (please forgive
syntax errors)

<xsl:include>
<xsl:attribute name="HREF"><xsl:value-of
select="PARENT/NODE/NODE"/><xsl:attribute/>
<xsl:include/>

If I write it this way, it works. (please forgive syntax errors)

<xsl:include href="File_Content.xsl"/>

I have used the <xsl:attribute> option elsewhere in the code and it works
just fine.  At this point, it appears that this seems to affect only the
<xsl:include> and the <xsl:import>.

Any help with this issue would be greatly appreciated

Please respond to mailto:cglynne@NO+SPAM.bigfoot.com (remove NOSPAM before
sending)





Re: Issue with the and

Posted by Gary L Peskin <ga...@firstech.com>.
Chris Glynne wrote:
> 
> [snip]
> The code sample is something like this and it does not work. (please forgive
> syntax errors)
> 
> <xsl:include>
> <xsl:attribute name="HREF"><xsl:value-of
> select="PARENT/NODE/NODE"/><xsl:attribute/>
> <xsl:include/>
> 
> If I write it this way, it works. (please forgive syntax errors)
> 
> <xsl:include href="File_Content.xsl"/>
> 
> I have used the <xsl:attribute> option elsewhere in the code and it works
> just fine.  At this point, it appears that this seems to affect only the
> <xsl:include> and the <xsl:import>.

Chris --

<xsl:attribute> is used to add attributes to _result elements_ (XSLT
section 7.1.3).  It cannot be used to add attributes at run time to
stylesheet elements.  The xsl:include and xsl:import elements may not
have any element content -- nothing can be between the start and end
tag.  The uri-reference for the href element must be specified in the
stylesheet itself.

xsl:import and xsl:include are compile time processes, like #include in
c.

HTH,
Gary