[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

DOM / Javascript ans XSL

Subject: DOM / Javascript ans XSL
From: Bertrand Sauviat <bsauviat@xxxxxxxxxxxxxx>
Date: Mon, 26 Apr 2004 11:33:15 +0200
dom javascript
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.