I am a newby to all this.
I want to retrieve the value of an xsl:for-each element by using XML.
I am writing XML based paging and need these results to later re-load the XML/XSLT with new values.
in older XSL (not xslt) I had:
<xsl:apply-templates select=".//row[index() > 0 $and$ index() < 3]" id='foo'/>
*and then get the value...*
var elem = xslDoc.selectSingleNode("//xsl:apply-templates[@id='foo']"
;
if( elem == null ) return;
var attribs = elem.attributes;
if( attribs == null ) return;
var attr = attribs.getNamedItem('select');
if( attr == null ) return;
var condition = attr.text;
attr.text whould give me " row[index() > 0 $and$ index() < 4] " which is what i'm looking for.
-----------------------------
*Now in XSLT I have...*
<xsl:for-each select=".//row[position() >= 0 and position() < 3]">
...and here I try to retrieve the value of the xsl:for-each:
var elem = xslDoc.selectSingleNode("//xsl:for-each"
;
if( elem == null ) return;
var attribs = elem.attributes;
if( attribs == null ) return;
var attr = attribs.getNamedItem(' Help...');
Even if my code did work it would work on any "xsl:for-each" in the page which is not ideal. this was solved in XSL by putting an ID or "Sort by" in the "xsl:apply-templates", but is seems it can not be done this way in XSLT.
I appreciate any help
Tarabin
tarabin1@yahoo.com
I want to retrieve the value of an xsl:for-each element by using XML.
I am writing XML based paging and need these results to later re-load the XML/XSLT with new values.
in older XSL (not xslt) I had:
<xsl:apply-templates select=".//row[index() > 0 $and$ index() < 3]" id='foo'/>
*and then get the value...*
var elem = xslDoc.selectSingleNode("//xsl:apply-templates[@id='foo']"
if( elem == null ) return;
var attribs = elem.attributes;
if( attribs == null ) return;
var attr = attribs.getNamedItem('select');
if( attr == null ) return;
var condition = attr.text;
attr.text whould give me " row[index() > 0 $and$ index() < 4] " which is what i'm looking for.
-----------------------------
*Now in XSLT I have...*
<xsl:for-each select=".//row[position() >= 0 and position() < 3]">
...and here I try to retrieve the value of the xsl:for-each:
var elem = xslDoc.selectSingleNode("//xsl:for-each"
if( elem == null ) return;
var attribs = elem.attributes;
if( attribs == null ) return;
var attr = attribs.getNamedItem(' Help...');
Even if my code did work it would work on any "xsl:for-each" in the page which is not ideal. this was solved in XSL by putting an ID or "Sort by" in the "xsl:apply-templates", but is seems it can not be done this way in XSLT.
I appreciate any help
Tarabin
tarabin1@yahoo.com