You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Felix Garcia Romero <fe...@tdi.tudistrito.es> on 2000/12/14 13:11:07 UTC

include,import in XSL

First of all, I want to introduce myself.  My name is Felix and I'm spanish.

I'm new in XSL and XALAN and I have a question.

I have and XSL which include other XSL, the last XSL has a form HTML and
inputs in the form.

When I parse with XALAN and I generate the HTML, the code of form doesn't
appear.
The example brief is:


THE PRINCIPAL XSL
----------------------------------------------

<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:include href="ID.xsl"/>
<xsl:template match="/">
<P><xsl:value-of select="$kontakt_content"/></P>
</xsl:template>
</xsl:stylesheet>



THE FILE ID.xsl
------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:variable name="kontakt_content">
<b>page id.xsl</b>
<FORM ACTION="http://web.gulesider.no/cgi-bin/asendpost.cgi" METHOD="post">

			<input>
				<xsl:attribute name="type">
				<xsl:text>text</xsl:text>
				</xsl:attribute>

				<xsl:attribute name="name">
				<xsl:text>length</xsl:text>
				</xsl:attribute>

				<xsl:attribute name="size">
				<xsl:text>30</xsl:text>
				</xsl:attribute>
			</input>

</FORM>

 </xsl:variable>
</xsl:stylesheet>
------------------------------------
The HTML generated doesn't appear <FORM ACTION..........

Is a problem of Xalan or XSL.


Re: include,import in XSL

Posted by Gary L Peskin <ga...@firstech.com>.
Felix Garcia Romero wrote:
> First of all, I want to introduce myself.  My name is Felix and I'm spanish.

Hi, Felix.

> The HTML generated doesn't appear <FORM ACTION..........
> 
> Is a problem of Xalan or XSL.

This appears to be bug in Xalan.  I've also tried this example in
XalanJ2 and received a DOM006 error which at least lets you know that
there's a problem but it's also a bug in XalanJ2.

It appears that the source of the problem is that you have multiple
elements as children of the xsl:variable element.  In my reading of the
XSLT standard, this should be possible but there seems to be a problem
in Xalan (both versions) somewhere.

I'll have a look and report back.  Thanks for bringing this problem to
everyone's attention.

Gary

Re: include,import in XSL

Posted by Gary L Peskin <ga...@firstech.com>.
Felix Garcia Romero wrote:
> What about this solution?

That looks fine to me.  As Dimitry pointed out, if you change value-of
to copy-of in your original solution that should work fine in XalanJ1
(and will in the next release of XalanJ2 as well).

Gary

RE: include,import in XSL

Posted by Felix Garcia Romero <fe...@tdi.tudistrito.es>.
Thank U for the answers.

I have done other thing which works fine:


 THE PRINCIPAL XSL
 ----------------------------------------------

 <xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

 <xsl:include href="ID.xsl"/>
 <xsl:template match="/">
 <P><xsl:apply-templates select="/" mode="import_id"/></P>
 </xsl:template>
 </xsl:stylesheet>




 THE FILE ID.xsl
 ------------------------------------------------
 <?xml version="1.0"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0">
 <xsl:template match="*" mode="import_id">
 <b>page id.xsl</b>
 <FORM ACTION="http://web.test.es/cgi-bin/asendpost.cgi"
 METHOD="post">

 			<input>
 				<xsl:attribute name="type">
 				<xsl:text>text</xsl:text>
 				</xsl:attribute>

 				<xsl:attribute name="name">
 				<xsl:text>length</xsl:text>
 				</xsl:attribute>

 				<xsl:attribute name="size">
 				<xsl:text>30</xsl:text>
 				</xsl:attribute>
 			</input>

 </FORM>

</xsl:template>
 </xsl:stylesheet>


What about this solution?
Regards




> ------------------------------------>

-----Mensaje original-----
> De: Felix Garcia Romero [mailto:felixgr@tdi.tudistrito.es]
> Enviado el: jueves 14 de diciembre de 2000 13:11
> Para: xalan-dev@xml.apache.org
> Asunto: include,import in XSL
>
>
> First of all, I want to introduce myself.  My name is Felix and
> I'm spanish.
>
> I'm new in XSL and XALAN and I have a question.
>
> I have and XSL which include other XSL, the last XSL has a form HTML and
> inputs in the form.
>
> When I parse with XALAN and I generate the HTML, the code of form doesn't
> appear.
> The example brief is:
>
>
> THE PRINCIPAL XSL
> ----------------------------------------------
>
> <xsl:stylesheet version='1.0'
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
>
> <xsl:include href="ID.xsl"/>
> <xsl:template match="/">
> <P><xsl:value-of select="$kontakt_content"/></P>
> </xsl:template>
> </xsl:stylesheet>
>
>
>
> THE FILE ID.xsl
> ------------------------------------------------
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:variable name="kontakt_content">
> <b>page id.xsl</b>
> <FORM ACTION="http://web.gulesider.no/cgi-bin/asendpost.cgi"
> METHOD="post">
>
> 			<input>
> 				<xsl:attribute name="type">
> 				<xsl:text>text</xsl:text>
> 				</xsl:attribute>
>
> 				<xsl:attribute name="name">
> 				<xsl:text>length</xsl:text>
> 				</xsl:attribute>
>
> 				<xsl:attribute name="size">
> 				<xsl:text>30</xsl:text>
> 				</xsl:attribute>
> 			</input>
>
> </FORM>
>
>  </xsl:variable>
> </xsl:stylesheet>
> ------------------------------------
> The HTML generated doesn't appear <FORM ACTION..........
>
> Is a problem of Xalan or XSL.
>