Click here to Skip to main content
       

XML / XSL

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionXML , XSL and JavaScript [modified]memberrajats8716 Sep '12 - 20:57 
i have one xml and xsl and i am using javascript in xsl to load xml values like
 
<script type="text/javascript">
chars="<xsl:value-of select="//system-params/login/forbiddenChars" disable-output-escaping="yes" />;
Length = <xsl:value-of select="//system-params/login/Digits" disable-output-escaping="yes"/>;            
</script>
 
and now i do not want to write above javaScript code in XSL and only want to include javascript by creating seperate file for javascript.
 
provide answers with exapmle by defining three (3) seperate file. i am begineer in this language.

modified 17 Sep '12 - 3:10.

AnswerRe: XML , XSL and JavaScript Pinmemberh4ckjr17 Sep '12 - 15:38 
May be it can help you
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="//system-params">
        <html>
            <head>
                <script type="text/javascript" src="YourJSfile.js" />
            </head>
<!-- Another template code here -->
        </html>
    </xsl:template>

GeneralRe: XML , XSL and JavaScript Pinmemberrajats8718 Sep '12 - 2:07 
Actually i want to do like this as you mention in your answer but i am loadind XML values in javascript and this script is in XSL.
If i write above code in javascript file then i can not load xml values because these values dynamically loaded at the time of HTML generation.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid