[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

getting javascript into an xsl variable

Subject: getting javascript into an xsl variable
From: dan haig <haig@xxxxxxx>
Date: Tue, 28 May 2013 16:14:27 -0400
 getting javascript into an xsl variable
G'day,

I am trying to get my XTF to read a bit of javascript into an XSL
variable. I know the drill about msxml and all that, not going there
obviously, but I wonder why this seemingly is impossible.

So, given a url:

http://127.0.0.1:8090/xtf/view?docId=eliot_p/eliot_p.01.xml;chunk.id=eliot_p.volume01.chapter10.pdf;toc.depth=1;toc.id=;page=69;brand=default#page/68/mode/2up

...I want to be able to work with the post-hash stuff,
page/68/mode/2up in this case. I can get it to display inline with the
text via this:

<script type="text/javascript">document.write(window.location.hash);</script>


...and, failing elsewhere and grasping at straws, have at least
managed to make this also work to display inline and was hoping I
could then get at the element thru some bizarre circuitous route, as
one often must do with xslt:


 <xsl:element name="posthash"><script
type="text/javascript">document.write(window.location.hash);</script></xsl:element>


...but I can't do anything with the string, can't get it into a
variable, can't manipulate it to construct a new URL (the bookreader
viewer depends on the posthash page and mode values which change as
the user reads, and I don't want them to lose state if they, for
instance, click a 'clear search hits' link). copy-of also worked to
render the string inline, but you can't make a variable out of that or
put it thru functions either it seems.

All the ink I've seen spilled out there declares it impossible to pull
javascript into an XSL variable save thru msxml. Is this still true?

Thanks,
Dan

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.