Subject: RE: [xsl] DOM / Javascript ans XSL From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx> Date: Mon, 26 Apr 2004 10:48:22 -0500 |
Hi Bertrand, > The problem is that the javascript returns the data in block. What does that mean, 'block'? What is exactly your output - could you post it please? > function search() > { > xslProc.addParameter("pourqui", form1.code.value); > xslProc.transform(); > document.body.innerHTML = xslProc.output; > } Q2: When do you call the function 'search'? Cause this is where the transformation occurs. With this information added to what you already have posted we may be able to help you better. <prs/> http://www.pietsieg.com http://www.pietsieg.com/dotnetnuke Contributor on www.ASPToday.com Co-author on "Professional ASP.NET XML with C#", July 2002 by Wrox Press -----Original Message----- From: Bertrand Sauviat [mailto:bsauviat@xxxxxxxxxxxxxx] Sent: Monday, April 26, 2004 4:33 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] DOM / Javascript ans XSL Hi I have a HTML page which call a Javascript. Here is the Javascript : var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); var xmlDoc = new ActiveXObject("Msxml2.DOMDocument"); xslDoc.async = false; xslDoc.load("test.xsl"); xmlDoc.validateOnParse = false; xmlDoc.load("SampleFicheProduit.xml"); var xslt = new ActiveXObject("Msxml2.XSLTemplate"); xslt.stylesheet = xslDoc; var xslProc = xslt.createProcessor(); xslProc.input = xmlDoc; function search() { xslProc.addParameter("pourqui", form1.code.value); xslProc.transform(); document.body.innerHTML = xslProc.output; } The problem is that the javascript returns the data in block. In my XSL, I have a template of selection and I call this template like this : <xsl:param name="pourqui"/> <xsl:template match="document/document-body"> <xsl:variable name="nombre"> <xsl:value-of select="count(//section[@pourqui=$pourqui])"/> </xsl:variable> <xsl:choose> <xsl:when test="$nombre>=1"> <xsl:apply-templates select="//section[@pourqui=$pourqui]"/> </xsl:when> <xsl:otherwise> <div><h1>no response</h1></div> </xsl:otherwise> </xsl:choose> <b><xsl:value-of select="//essai"/></b> </xsl:template> <xsl:template match="/"> <html> <body> <table border="2"> <tr><td> <xsl:apply-templates select="document/document-body"/> </td> </tr> </table> </body> </html> </template> My XML : <document> <document-body> <section pourqui="1"> <paquet1>I am the paquet 1</paquet1> </section> <section pourqui="2"> <paquet2>I am the paquet 2.1</paquet2> <paquet2>I am the paquet 2.2</paquet2> <paquet2>I am the paquet 2.3</paquet2> </section> </document-body> </document> How can I return the paquet 1 in bold for example and the paquet 2 formatting in a list? The .inner.HTML returns always a block and in the XSL, I can't adjust both the return of the Javascript and both the formatting of the node which are returned Help is welcome Thanks
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] DOM / Javascript ans XSL, Bertrand Sauviat | Thread | RE: [xsl]Transforming xsl-fo to HTM, Jarno.Elovirta |
RE: [xsl] html: datetime e bit type, Andrea Racca | Date | Re: [xsl] Sorting in Ancient Greek, Eliot Kimber |
Month |