Is it possible to have the href of an <xsl:import> be dynamic?

I have an xml document of data.  This document has a <layout> tag.  I want
to use that value to determine which file is used as the stylesheet.  Is
this possible?  I know my syntax is somewhat right because it works when I
hardcode in a value.  My source is listed below.

Thanks,

Paul


Here is my xml document:

<?xml version="1.0"?>
<page>
        <layout>another-page2html.xsl</layout>
        <title>Simple Layout</title>
  <content>
        <para>This is a document using a simple layout.</para>
  </content>
</page>


Here is my 'dynamic' stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

        <xsl:import href="{//layout}"/>

</xsl:stylesheet>


I've also tried it like this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

        <xsl:import>
          <xsl:attribute name="href">
            <xsl:value-of select="layout">
          </xsl:attribute>
        </xsl:import>

</xsl:stylesheet>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to