Link to home
Start Free TrialLog in
Avatar of danchristie
danchristie

asked on

xsl variables

I am trying to create an image tag in an xsl stylesheet. It's path will include a variable called sURL which defines whether the server is production or development. This is the line of code as it was in ASP.

"https://<%=sURL%>/images/dotted.gif"

Now I need to do this with xsl.
How do I get it to replace sURL with a value set in an include file on an asp page.

So far my environment is very simple. An xml page with a record, an XSL sheet, and an asp page which loads both, and does the transformnode.

Any ideas?

Thanks in advance

Dan

ASKER CERTIFIED SOLUTION
Avatar of chabaud
chabaud

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vijayneema
vijayneema

Thanks chabaud,

can you tell me how to do the same in JavaScript on Client side.

i am having same type of query i am using XML & XSL in one of my HTML page, and i want this variable to insert at the client side Please help me .... with some example.

bye
Vijay
Here is an example with javascript and "xml data island":

<html><head><title>XSL test</title></head><body>

<!-- ********************* XML ********************* -->

<XML id="oXml">
<X>
<GROUPA>
<A>1</A>
<A>2</A>
<A>3</A>
<A>4</A>
</GROUPA>
<GROUPB>
<A>1</A>
<A>3</A>
</GROUPB>
</X>
</XML>

<!-- ********************* XSL ********************* -->

<XML id="oXSL">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         version="1.0" >

<xsl:output method="html" indent="yes" encoding="UTF-8" version="1.0"/>

<xsl:template match = "/">
A from GROUPA not in GROUPB:<br/>
<xsl:for-each select="//GROUPA/A[ not( .=(//GROUPB/A)) ]">
     <li><xsl:value-of select="."/></li>
</xsl:for-each>

</xsl:template>

</xsl:stylesheet>
</XML>

<!-- ********************* HTML ********************* -->

<div id="DivLookUp" align="center"></div>

<script language="javascript">
    DivLookUp.innerHTML=oXml.transformNode( oXSL.documentElement);
</script>

</body></html>