[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

inconsistent results from stylesheet

Subject: inconsistent results from stylesheet
From: Bob White <milkchaser@xxxxxxxxx>
Date: Mon, 17 Apr 2000 14:53:14 -0700 (PDT)
rowset for insert
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.