[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Grouping repeating elements within repeating eleme
At 2007-12-06 02:42 -0600, Cynthia.Arangua@xxxxxxxxxxxxxx wrote:
Strike what I had asked for before. I think I got that working. But now, I am running into another issue. I was unable to find how to feed the XML fragment from your earlier post into this transformation while extricating the query code. The code is attached below and I have it commented where a more effective if logic is needed. I feel it is important to point out the poor form in using disable-output-escaping= ... this construct is not used for synthesizing markup ... you should be using proper well-formed XML for all of your markup in your stylesheet. Here is an example where your code can be improved: <xsl:if test="string(heading[$index])"> <xsl:text disable-output-escaping="yes"><![CDATA[<a class='linkMore' href='#' onclick="ContentHiearchy_FAQ(']]></xsl:text> <xsl:value-of select="$generatingHeaderId"/> <xsl:text disable-output-escaping="yes"><![CDATA[')">]]></xsl:text> <xsl:value-of select="concat($indent,heading[$index])"/> <xsl:text disable-output-escaping="yes"><![CDATA[</a><br/> <DIV id="]]></xsl:text> <xsl:value-of select="$generatingHeaderId"/> <xsl:text disable-output-escaping="yes"><![CDATA[" class="content_hiearchy_hidden">]]></xsl:text> <!--determine if there is any information at the next level of depth--> <xsl:call-template name="next-heading"> <xsl:with-param name="index" select="$index + 1"/> <xsl:with-param name="indent" select="concat($indent,'   ')"/> <xsl:with-param name="faqs" select="$faqs[heading[$index]= The above should be written as follows, using attribute value templates, so that all of the constructs in the stylesheet are element nodes and not unescaped text nodes: <xsl:if test="string(heading[$index])"> <a class='linkMore' href='#' onclick="ContentHiearchy_FAQ('{$generatingHeaderId}')"> <xsl:value-of select="concat($indent,heading[$index])"/> </a><br/> <div id="{$generatingHeaderId}" class="content_hiearchy_hidden"> <!--determine if there is any information at the next level of depth--> <xsl:call-template name="next-heading"> <xsl:with-param name="index" select="$index + 1"/> <xsl:with-param name="indent" select="concat($indent,'   ')"/> <xsl:with-param name="faqs" select="$faqs[heading[$index]= current()/heading[$index]]"/> </xsl:call-template> </div> </xsl:if> You should never be using disable-output-escaping= for "building tags" ... XSLT doesn't work with tags, it works with nodes created from the syntactic tags. If you convert your stylesheet to one that works with an XML input file, then perhaps someone on the list will be able to help by running it and analyzing what is happening. I hope this helps. . . . . . . . . . . . . . Ken -- Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008 World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|