Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL request uri

Status
Not open for further replies.

siliond

Programmer
Aug 7, 2003
13
US
How do I obtain a request uri parameter in XSL?

In my XML I want to have different attributes for a few languages.

Example: <entity en=&quot;apple&quot; de=&quot;apfel&quot;>
The example uri is: I want the xsl to display apfel
 
What parser are you using? Server side or client side?

If you are using something like PHP or ASP, you can pass the uri strings in as parameters to your stylesheet

-Rob
 
hi,

The code for extracting the querystring from the url of the page is

<xsl:template match=&quot;//p&quot;>
<script language=&quot;javascript&quot;>

<![CDATA[

function urls()
{

// this is temporary url or take it from the
// url is by var str=window.location;

var str=&quot; var loc=str.indexOf(&quot;?&quot;);
var ln=str.substr(loc + 1, 2);

var m=document.all.tags(&quot;p&quot;);
for(var i=0;i<m.length;i++)
{
m.innerHTML=m.innerHTML + &quot;<entity name='ent' &quot; + ln + &quot;='en'>&quot;;

alert(m.innerHTML);
}



}

]]>

</script>

</xsl:template>
 
The xml contains
<entity en=&quot;apple&quot; de=&quot;apfel&quot;>

I want to generate a html, by XSL.
The page URI is:

I want the html tu contain apfel, this is the target.
I already solved the problem using ActiveXObject. I want it to solve this generating-time, not runtime. To have access to the page uri from xsl, not from generated HTML, so window.location it's wrong.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top