Adding an attribute to elements of a dynamic result-set 2007-08-10 - By Raymond
Hello All,
I'm wondering if there is anyway to achieve something like this:
<xsl:variable name="category_defs"> <xsl:for-each select="$category_defs1" > <xsl:copy> <xsl:attribute name="mode">1</xsl:attribute> </xsl:copy> </xsl:for-each> <xsl:for-each select="$category_defs2" > <xsl:copy> <xsl:attribute name="mode">2</xsl:attribute> </xsl:copy> </xsl:for-each> </xsl:variable>
Essentially, what I'm trying to do is merge the two result sets into one interleaved set, while maintaining the distinction between the two by applying a "mode" attribute.
Realizing that there is a mutability issue somewhere in here, I tried the copy, but no dice. Is this possible in anyway?
Currently I get a
SystemId Unknown; Line #19; Column #38; Can not convert #RTREEFRAG to a NodeList!
message or stderr.
Thanks in advance,
Raymond Auge <rauge@(protected)> Software Engineer Liferay, Inc. Enterprise. Open Source. For Life.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"> <META NAME="GENERATOR" CONTENT="GtkHTML/3.14.1"> </HEAD> <BODY> Hello All,<BR> <BR> I'm wondering if there is anyway to achieve something like this:<BR> <BR> <PRE> <FONT SIZE="2"><xsl:variable name="category_defs"></FONT> <FONT SIZE="2"> <xsl:for-each select="$category_defs1" ></FONT> <FONT SIZE="2"> <xsl:copy></FONT> <FONT SIZE="2"> <xsl:attribute name="mode">1</xsl :attribute></FONT> <FONT SIZE="2"> </xsl:copy></FONT> <FONT SIZE="2"> </xsl:for-each></FONT> <FONT SIZE="2"> <xsl:for-each select="$category_defs2" ></FONT> <FONT SIZE="2"> <xsl:copy></FONT> <FONT SIZE="2"> <xsl:attribute name="mode">2</xsl :attribute></FONT> <FONT SIZE="2"> </xsl:copy></FONT> <FONT SIZE="2"> </xsl:for-each></FONT> <FONT SIZE="2"></xsl:variable></FONT>
</PRE> Essentially, what I'm trying to do is merge the two result sets into one interleaved set, while maintaining the distinction between the two by applying a "mode" attribute.<BR> <BR> Realizing that there is a mutability issue somewhere in here, I tried the copy, but no dice. Is this possible in anyway?<BR> <BR> Currently I get a<BR> <BR> SystemId Unknown; Line #19; Column #38; Can not convert #RTREEFRAG to a NodeList!<BR> <BR> message or stderr.<BR> <BR> <BR> Thanks in advance,<BR> <BR> <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%"> <TR> <TD> Raymond Auge <rauge@(protected)><BR> Software Engineer<BR> <A HREF="http://www.liferay.com">Liferay, Inc.</A><BR> Enterprise. Open Source. For Life.<BR> <BR> <BR> </TD> </TR> </TABLE> </BODY> </HTML>
|
|