Click to See Complete Forum and Search --> : XSL and Javascipt help


Seano
11-23-2003, 08:30 PM
Hi, im kinda stuck.
What I have is an XML document which needs to be displayed in a HTML table, which then can be sorted etc.
I have developed a solution using a few XSLT files, cept i now want to do it using only a single file.
Basically the main problem i have is that i dont think it is possible to have something like this is it:


<script language="javascript" type="text/javascript">
<xsl:comment><![CDATA[ // does this cause the problem
...
document.write('<td><xsl:value-of select="company"/></td>')


because my page is displaying the headers, and the selecting works fine, etc, but the XML bits arent being ripped from the XML file.
Does anyone know how i can do something similar to the above

gil davis
11-24-2003, 07:49 AM
I can verify that what you have posted is invalid. You cannot have any HTML tags within a <SCRIPT></SCRIPT>.

So, the only way what you have posted would work is if the XML was parsed at the SERVER.

Khalid Ali
11-24-2003, 06:06 PM
Take a look at this page and browse through all of the links.
All of the links sue some functionality to display XML in browser windowI am sure you will get your answer their

XML/XSL in browser resource link (http://www.webapplikations.com/pages/html_js/xml_js.html?menu_id=Web_sub)

Seano
11-24-2003, 06:12 PM
Im sorry mate but i cant seem to find anything there which might help me.
Ive spent a fair amount of time on this and im sure the problem is because im embedding some XSL processing within the javascript section of the code which is being ignored by the XSLT processor? is this correct?

Khalid Ali
11-24-2003, 06:32 PM
Originally posted by Seano
Im sorry mate but i cant seem to find anything there which might help me.
Ive spent a fair amount of time on this

Hunm..

well unless I am totally doped and could understand your question(its possible ya know..:D )

One of those links is displaying XML document,using an xsl file imported in XML file and in that I have used javascript intensively....

Here try this link (http://www.webapplikations.com/pages/html_js/xmlstuff/DOMXMLParsing.xml) its the last link on the page.

grab the source for the XSL file and see how I have embeded JavaScript in XSL file...

paps
11-26-2003, 06:59 PM
how bout using XMLDOM in the Javascript to do ur XML stuff????