I have attached a simple example.
Url of mono's bugzilla?

thanks 
ariel



On Thu, 2004-11-25 at 21:12, Atsushi Eno wrote:
> Hi,
> 
> Can you please provide reproducible stylesheet and input document
> as well? If possible, entering a new bug to bugzilla would be nice.
> 
> Atsushi Eno
> 
> Ariel Rios wrote:
> > I have problems using XSLTTransform. I have the following
> > code. I expect to be able to use the var modoAccion inside the
> > xslt but it is null. The code works correctly under .net.
> > 
> > modoAccion="INICIAL";
> > System.Console.WriteLine ("estoy aca" + modoAccion);
> > XsltArgumentList xslArg = new XsltArgumentList();
> > xslArg.AddParam("modoAccion", "", modoAccion);
> > xslt.Transform(doc1, xslArg,Response.OutputStream , null);
> > 
> > thanks
> > ariel
> > _______________________________________________
> > Mono-list maillist  -  [EMAIL PROTECTED]
> > http://lists.ximian.com/mailman/listinfo/mono-list
> > 
> 
<%@ Page Src="Cliente.cs"
        Inherits="Presentacion.Presentacion"
%>
using System;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
using System.Xml.XPath;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace Presentacion {

        public class Presentacion :  Page {
                private const String stylesheet = "Cliente.xsl";
                override protected void OnInit(EventArgs e){
                   this.transforma();
                }
                void transforma(){
                        string xml="";
                        string pagina="hello world";
                        string modoAccion = "INICIAL";
                        int total=0;    

                        Tools objTools = new Tools();
                        string xmlMenu= objTools.xmlMenu(1);
                        
                        XmlDocument doc1 = new XmlDocument();
                        doc1.LoadXml("<Reporte total=\""+ total +"\">" + xml  + 
  xmlMenu +   "</Reporte>");
                        
                        XslTransform xslt = new XslTransform();
                        xslt.Load(stylesheet);


                        System.Console.WriteLine ("modoaccion value" + 
modoAccion);
                        XsltArgumentList xslArg = new XsltArgumentList();

                        xslArg.AddParam("pag", "", pagina);
                        xslArg.AddParam("modoAccion", "", modoAccion);
                        
                        xslt.Transform(doc1, xslArg,Response.OutputStream , 
null);
                                                        
                }
        }



}
<!DOCTYPE html>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
    <xsl:template match="Reporte">
        <xsl:param name="pag" />
        <xsl:param name="modoAccion" />
        <html>
            <head>
                <title>XSLT TEST</title>
                
            </head>
            <body leftmargin="0" topmargin="0"  marginheight="0" 
marginwidth="0" ID="Bdy"> 
                
                The value of the modoAccion var is: <xsl:value-of 
select="$modoAccion"/>
                <br/>
                The value of the pag var is:  <xsl:value-of select="$pag"/>
                <br/>
                Checking if the string has length 0: 
                <xsl:if test="$modoAccion=''">yes</xsl:if>
                <br/>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

Reply via email to