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

Re: viewing details of selected item

Subject: Re: viewing details of selected item
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 7 Nov 2000 10:12:40 +0000
xsltprocessor.input
Keith,

> I am using an xsl list page to show the POCs for either.  Now, because I am
> not doing another hit to the server and the POCs details are in the original
> xml data, I need to transform the viewed page into a POCDetails page for
> editing.  I have tried using several methods, none of which are working.
> I tried..
> <input type="button">
>         <xsl:attribute name="onclick">javascript:GetDetails(<xsl:value-of
select="@pocID"/>>)</xsl:attribute</input>
[snip]
>
> these both carry the pocID attribute to the function call, but when the
> POCDetails.xsl is loaded, ALL POCs are listed in editable fashion.
>
> I have been looking at, and working with,
> <xsl:call-template><xsl:with-param> as well as <xsl:call-template>
> <xsl:variable>, and set up the POCdetails style sheet inside the POC
> list stylesheet, but nothing seems to work correctly.

It's a little hard to tell exactly what's going wrong because you
haven't included the script that you're using, but I suspect that
you're not using global (stylesheet) parameters, which you need to do
in order to pass information into the stylesheet and thus alter how
it's processed.

It's possible that you *are*, but that the way you're passing the
value into the javascript function isn't constructed properly.  You
may need to put quotes around the value being passed to the function:

<input type="button">
  <xsl:attribute name="onclick">
    <xsl:text>javascript:GetDetails('</xsl:text>
    <xsl:value-of select="@pocID" />')<xsl:text />
  </xsl:attribute>
</input>

or (shorter):

<input type="button" onclick="javascript:GetDetails('{@pocID}') />

Within the javascript function, you should have something like:

function GetDetails(id) {
  ...
  XSLStylesheet = new ActiveXObject('Msxml2.XSLTemplate');
  XSLStylesheet.stylesheet = XSLTDOM;
  XSLTProcessor = XSLStylesheet.createProcessor();

  XSLTProcessor.input = XMLDOM;
  XSLTProcessor.addParameter('show', id);
  XSLTProcessor.transform();
  ...
}

This passes the value of the @pocID that you want to show as a
parameter named 'show' in the stylesheet.  In the stylesheet itself,
you then need to declare that parameter at the top level of the
stylesheet (right under the xsl:stylesheet element):

<xsl:param name="show" />

and then use the value of that parameter to determine which POCs to
show details for.  For example, you might only apply templates to
those with a matching ID:

  <xsl:apply-templates select="POC[@pocID = $show]" mode="details" />

I hope that this helps: do post more details of the javascript and/or
XSLT stylesheet if you need more help with it.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.