|
Subject: [xsl] Re: Could the value of the select attribute of a xsl:param element be redefined? From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> Date: Mon, 22 Jan 2001 21:11:23 -0800 (PST) |
>
> However; when returing to xsl file, the select value is shown
> unchanged,i.e.,1 ,why?
>
1. You've made a very basic error -- this dom manipulation must be
carried out ***before*** you invoke transformNode()
>From the above citation it seems obvious that you're calling this
script from within the stylesheet -- this is wrong -- you're performing
the changes on another, newly created instance of your parsed
stylesheet -- when the script returns it dies away.
2. You haven't provided any details of your code -- nobody can even
guess what you were actually doing.
Remember the recommendation, that in your case a simple xsl:choose
element is the best solution.
Dimitre.
--- SFYang@xxxxxxxxxxxxx wrote:
> Mr. Novatchev
>
> Thanks for your suggestions.
>
> As the matter of fact, using msxml3 I have tried the following two
> DOM approaches
> in writing the javascript. But none seems workable for me, I need
> your further directions. Thanks.
>
> 1. Jeni Tennison suggestions for Bharat dot Chintapally on Nov 18,
> 2000,
>
> function gotoprev()
> {
> var XMLDOM = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
>
> XMLDOM.async = false;
> XMLDOM.load("test.xsl");
>
> // <===Suggested by Jeni
> var s
> =XMLDOM.selectSingleNode("//xsl:param[@name='pageno']/@select");
>
> // s.setAttribute("@select",'3');
>
> alert(s.value);//<=== verify that select value =1
> s.value=2; //<== manually defined value =2
> alert(s.value); //<== verify the select value=2
> alert(XMLDOM.xml); //== verify the complete xsl:param
> in the xsl file}
>
> However; when returing to xsl file, the select value is shown
> unchanged,i.e.,1 ,why?
>
>
> 2. Then I used the tip you responded to S.Fitzpatrick on
> Jan/19/01,to use the setAtrribute method.
> by adding s.setAttribute("@select",'3'); to the above
> function.
> But I get the error message of " this property or method is not
> supported".
>
> Do I miss something important in using these DOM approaches?
>
>
>
>
> ~
> eMail : SFYang@xxxxxxxxxxxxx
>
> UniSVR Global Information Technology Corporation,
>
>
>
> -----ì©l¸ê°T-----
> ±q: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
> ¶Ç°e: Sun, 21 Jan 2001 21:17:24 -0800 (PST)
> ¦¬¥ó¤H: "SFYang@xxxxxxxxxxxxx" <SFYang@xxxxxxxxxxxxx>
> §Û°e: "xsl-list@xxxxxxxxxxxxxxxxxxxxxx"
> <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> ¥DÃD: Re: Could the value of the select attribute of a xsl:param
> element be redefined?
>
> SFYang at unisvr dot net dot tw wrote:
>
> > If so, how to do it? Be more specific, how to get
> > <xsl:param name="line" select="1"/> to <xsl:param name="line"
> > select="2"/>
>
>
> You can manipulate your stylesheet after loading it (but before
> applying the transformation) as any other xml document -- using DOM.
> Any attribute value can be modified in this way, including the value
> of
> the select attribute of the element in question.
>
> Or,
>
> the named template may be called with different xsl:with-param 's as
> determined dynamically within a <xsl:choose> element.
>
> Dimitre Novatchev.
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Any suggestions for using XSL, Kevin Duffey | Thread | [xsl] "Improve your XSLT coding fiv, Michael . Rohde |
| Re: [xsl] newbie questions (calcula, David Carlisle | Date | [xsl] Any suggestions for using XSL, Kevin Duffey |
| Month |