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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

showing xml value in a JS function

Status
Not open for further replies.

yahoo182

Programmer
Jul 5, 2005
70
CA
Hi there,
I need to show an XML element value in a javascript function like so.

Code:
function CreateWindow() {
myWindow = window.open("", "tinyWindow", 'width=600,height=500');
myWindow.document.title="<xsl:valueof select="hotel/Name"/>";
}
But this does not seem to work.
I have also tried
Code:
myWindow.document.title="{hotel/Name}";
but this does not work either.
There is only hone Name element in the hotel root element.

Any help is much appriciated.
thanks :)
 
if ever it is a [red]valueof[/red], it is [blue]value-of[/blue].
 
thanks for pointing that out tsuji,
but the title is still now showing correctly
 
Title may be the problem. It resists change dynamically, probably for security reason.
 
Further note: If you set the title at the title-tag directly, it should work. Something along the line like this?
[tt]
<xsl:template match=...>
<title><xsl:value-of select="hotel/Name"/></title>
</xsl:template>
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top