-
Control Break, before group/after groups sub-total logic in XSL
Hi ALL
I need some feed back on creating control break, sub-total logic for reports
with MS XSL implementation that ships with ie5 vs the newer preview release.
& w3c xslt
Assume standard ado xml stream, that is ordered in a sequence suitable for
control break logic
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly' rs:updatable='true'>
<s:AttributeType name='XXX' ..... />
....
</s:ElementType>
</s:Schema>
<rs:data>
<z:row fld1=xxx ...'/>
...
</rs:data>
</xml>
& the a partial XSL fragment
<xsl:template match="xml/rs:data">
<xsl:for-each select='z:row'>
<-- Need a before group break on a given z:row attribute to output of a
<tr>
<xsl:for-each select='@*'>
</xsl:for-each>
<-- Need an after group break on a given z:row attribute to putput a
sub-total
</xsl:for-each>
</xsl:template>
Assume only IE5, how do you check for the control breaks, so far the only
way I seem to handle
this is to escape to script ike
<xsl:for-each select='z:row'>
<xsl:if expr="bfGrp (1, me)">
<tr> <td colspan='6'>
<xsl:value-of select="@XXX" />
</td>
</tr>
</xsl:if>
.......
where bfGrp looks like
Function bfGrp(ID, ByVal oNode)
bfGrp = false
select case ID
case 1
if childnumber(me) > 1 then
if oNode.getAttribute("XXX") <>
oNode.previousSibling.getAttribute("XXX") then
bfGrp = true
end if
end if
else
bfGrp = true
end if
end select
End Function
I assume that when you escape to eval script you get a big performance hit
with large xml doc.
I know for the newer parsers you have access to following-sibling,
preceding-sibling from
the current context in a for-each iteration.
Does any one know with the installed base of ie5 how to just use native xsl
syntax to look
next/previous node using the m$ xml ado stream
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks