[ http://nagoya.apache.org/jira/browse/XALANJ-1552?page=history ]
Henry Zongaro updated XALANJ-1552:
----------------------------------
type: New Feature (was: Bug)
Description:
I have a problem with setParameter() with xsltc. Xalan can't pass NodeSet
parameter to my stylesheet.
When
javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
, Xalan pass parameters to the stylesheet.
but when
javax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl
, xalan pass only String parameters.
-------------------------------
TransformerFactory tFactory = TransformerFactory.newInstance();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element root = document.createElement("root");
document.appendChild( root );
Element libelle = document.createElement("libelle");
libelle.appendChild( document.createTextNode("ok") );
Transformer transformer = tFactory.newTransformer(new StreamSource(xslInURI));
transformer.setParameter("param1",document) ;
transformer.transform(new StreamSource(xmlInURI), new StreamResult(System.out));
-----------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:variable name="title" select="concat(todo/@project, ' ',
todo/@major-version)"/>
<xsl:param name="param1" />
<xsl:template match="/">
<HTML>
<BODY>
<xsl:value-of select="$param1"/>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------
console (System.out)
<HTML>
<BODY>[#document: null]</BODY>
</HTML>
was:
I have a problem with setParameter() with xsltc. Xalan can't pass NodeSet
parameter to my stylesheet.
When
javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
, Xalan pass parameters to the stylesheet.
but when
javax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl
, xalan pass only String parameters.
-------------------------------
TransformerFactory tFactory = TransformerFactory.newInstance();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element root = document.createElement("root");
document.appendChild( root );
Element libelle = document.createElement("libelle");
libelle.appendChild( document.createTextNode("ok") );
Transformer transformer = tFactory.newTransformer(new StreamSource(xslInURI));
transformer.setParameter("param1",document) ;
transformer.transform(new StreamSource(xmlInURI), new StreamResult(System.out));
-----------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:variable name="title" select="concat(todo/@project, ' ',
todo/@major-version)"/>
<xsl:param name="param1" />
<xsl:template match="/">
<HTML>
<BODY>
<xsl:value-of select="$param1"/>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------
console (System.out)
<HTML>
<BODY>[#document: null]</BODY>
</HTML>
Environment:
Operating System: Windows NT/2K
Platform: PC
was:
Operating System: Windows NT/2K
Platform: PC
Priority: Major
Bugzilla Id: (was: 20503)
> Xalan can not pass NodeSet parameter with xsltc
> -----------------------------------------------
>
> Key: XALANJ-1552
> URL: http://nagoya.apache.org/jira/browse/XALANJ-1552
> Project: XalanJ2
> Type: New Feature
> Components: XSLTC
> Versions: 2.5
> Environment: Operating System: Windows NT/2K
> Platform: PC
> Reporter: arn44
> Assignee: Arun Yadav
> Attachments: TestParameter.java, test.xsl, todo.xml
>
> I have a problem with setParameter() with xsltc. Xalan can't pass NodeSet
> parameter to my stylesheet.
> When
> javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
> , Xalan pass parameters to the stylesheet.
> but when
> javax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl
> , xalan pass only String parameters.
> -------------------------------
> TransformerFactory tFactory = TransformerFactory.newInstance();
> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
> DocumentBuilder builder = factory.newDocumentBuilder();
> Document document = builder.newDocument();
> Element root = document.createElement("root");
> document.appendChild( root );
> Element libelle = document.createElement("libelle");
> libelle.appendChild( document.createTextNode("ok") );
> Transformer transformer = tFactory.newTransformer(new StreamSource(xslInURI));
> transformer.setParameter("param1",document) ;
> transformer.transform(new StreamSource(xmlInURI), new
> StreamResult(System.out));
> -----------------------------------------
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0" >
> <xsl:variable name="title" select="concat(todo/@project, ' ',
> todo/@major-version)"/>
> <xsl:param name="param1" />
> <xsl:template match="/">
> <HTML>
> <BODY>
> <xsl:value-of select="$param1"/>
> </BODY>
> </HTML>
> </xsl:template>
> </xsl:stylesheet>
> -----------------------------------------
> console (System.out)
> <HTML>
> <BODY>[#document: null]</BODY>
> </HTML>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]