[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] inconsistent results from stylesheet
I am using the Oracle XSLT processor to translate XML into HTML. My XML is pulled from an Oracle DB as a DOM document, then I apply my parsed XSL stylesheet. Works fine the first time. When the user requests that the results be sorted, I apply a second stylesheet with little more than an xsl:sort command to sort the data section of my document (all other nodes are simply copied from the source tree to the result tree). The sort operation leaves me with a document-fragment. I find the node in my original XML DOM document that matches the root of the sorted document-fragment and I replace that node with the sorted data. Then I re-apply my XML-to-HTML stylesheet again to the sorted data. But the second time I apply my stylesheet, it does not work. My XML looks like this: <RESULTSET> <COLUMNLIST>...</COLUMNLIST> <ROWSET> <ROW> <C1>...</C1> <C2>...</C2> <C3>...</C3> </ROW> ... </ROWSET> </RESULTSET> What could be simpler? I have a template for the data section that matches on the <ROWSET> tag. <xsl:template match="ROWSET"> <xsl:message> Inside ROWSET template... </xsl:message> <xsl:for-each select="ROW[position() = ($SkipRows+1)]"> ... </xsl:for-each> </xsl:template> The first time I apply my stylesheet, I see this message and I know that the template is being applied as expected. But the second time I apply this stylesheet, this template does not fire. Instead, I see the default template fire for the <ROWSET> node: <xsl:template match="*|/"> <xsl:message> Applying templates from default "*|/" template, node:<xsl:value-of select="name()" />!! </xsl:message> ... </xsl:template> This puts a console message of: Applying templates from default "*|/" template, node:ROWSET!! I have worked around this problem by naming my "ROWSET" template and explicitly calling my ROWSET template from the "*|/" template as follows: <xsl:if test="name()='ROWSET'"> <xsl:call-template name="insert-rowset"/> </xsl:if> This works, but shouldn't the template fire based on the match="ROWSET" attribute? <xsl:template match="ROWSET" name="insert-rowset"> ... </xsl:template> Is this a bug in the Oracle processor? ..Bob. ===== -- Bob White -- See photos of Oxana, my beautiful bride! http://milkchaser.tripod.com 203-926-1888 x3287 "Make it legal" -- www.norml.org __________________________________________________ Do You Yahoo!? Send online invitations with Yahoo! Invites. http://invites.yahoo.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|