Subject: RE: [xsl] Pop-up window From: "Chris Bayes" <chris@xxxxxxxxxxx> Date: Sat, 1 Sep 2001 01:01:39 +0100 |
Jenny, Have a look at the beer tutorials http://www.bayes.co.uk/xml/index.xml?/xml/tutorial/filtering/filter.xml for a different way of doing this. If you are doing it serverside then change your link to be something like href="www.someplace.com/gimmeonebibitem.asp?id=someid" which would return a single bibitem and an associated stylesheet <?xml version="1.0" ?> <?xml-stylesheet type="text/xsl" title="bibitemStylesheet" href="bibitem.xsl" alternate="no" media="screen"?> <bibitem type="inproceedings"> <author URL="http://www.cs.utah.edu/~whitaker/">R. Whitaker</author> <booktitle>Fifth ... Or do the transform o the server and return the html. Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Jenny Simpson > Sent: 31 August 2001 23:54 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Pop-up window > > > Hi all, > My problem is fairly straight-forward. I have a > bibliography database in xml that is displayed as a list of > publications using xsl. "Abstract" is one of the fields > contained in each entry. Here is a sample entry: > > <bibitem type="inproceedings"> > <author URL="http://www.cs.utah.edu/~whitaker/">R. > Whitaker</author> > <booktitle>Fifth > International Conference on Computer Vision '95</booktitle> > <keywords>Deformable Models</keywords> > <month>June</month> > <note>(full paper, peer review)</note> > <pages>822--827</pages> > <title>Algorithms for implicit deformable models</title> > <year>1995</year> > <abstract><p>This paper presents a framework for > implicit deformable models and a pair of new algorithms for > solving the nonlinear partial differential equations that > result from this framework. Implicit models offer a useful > alternative to parametric models, particularly when dealing > with the deformation of higher-dimensional objects. The basic > expressions for the evolution of implicit models are > relatively straightforward; they follow as a direct > consequence of the chain rule for differentiation. More > challenging, however, is the development of algorithms that > are stable and efficient. > > <p>The first algorithm is a viscosity approximation > which gives solutions over a dense set in the range, > providing a means of calculating the solutions of embedded > families of contours simultaneously. The second algorithm > incorporates sparse solutions for a discrete set of contours. > This sparse-field method requires a fraction of the > computation compared to the first but offers solutions only > for a finite number of contours. Results from 3d medical data > as well as video images are shown. > </abstract> > </bibitem> > > I have the abstract displayed as a link and I want the user > to be able to click on the abstract for any publication and > see a pop-up window containing the abstract and other related > information. > > The problem with using a regular javasript pop-up window is > that I don't want to refer to a different URL; I want to > display the current values in the current node and I would > lose that information if I referred to a new URL. The option > that seems best is the pass the current element values as > parameters to a javascript function, then build the content > for the pop-up window in the javascript itself. The > javascript looks like > this: > > > function subWrite(thisAbstract, author, month, year, title, > journal, editor, volume, number, pages, publisher){ > makeNewWindow(); > newWindow.focus(); > var newContent = "<html><head><title>Abstract</title></head>"; > newContent += "<body><h1>Abstract</h1>"; > newContent += thisAbstract; > newContent += "</body></html>"; > newWindow.document.write(newContent); > newWindow.document.close(); > } > > > The function call in the xsl looks like this: > > <a href="javascript:subWrite('{$thisAbstract}', '{$author}', > '{$month}', '{$year}', '{$title}', '{$journal}', '{$editor}', > '{$volume}', '{$number}', '{$pages}', '{$publisher}')">Abstract</a> > > > This works fine as long as there are no single or double > quotes in the variables being passes as parameters. In other > words, if the abstract contains a quotation mark somewhere > (and many do), the xsl interprets the quote as if it is the > end of the function call instead of just ignoring it as part > of the text. > > Is there a way to pass xsl element values (values which > change depending > on context) to a javascript function without having the xsl > try to parse the values in the process? > > Also, is there a better way to create a pop-up window to > display values from current nodes in xsl? I hope this made > sense. Thanks in advance. > > Jenny Simpson > Sci Institute > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Pop-up window, Jenny Simpson | Thread | [xsl] Re: Grouping headers revisted, Dimitre Novatchev |
[xsl] javascript & XSL, P Vikram | Date | RE: [xsl] javascript & XSL, Chris Bayes |
Month |