XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Shalini venkateswaranSubject: Help to group using WYSIWYG
Author: Shalini venkateswaran
Date: 06 Jul 2005 04:56 PM
Need to understand how I can group using wysiwig part of tool if at all.
I have a requirement for this, i saw samples but now gui.
<data>
<record>
<KEY xml:lang="en_US">1</KEY>
<PET xml:lang="en_US">notapuppy</PET>
<ISSUE_DATE xml:lang="en_US">June 29, 2005</ISSUE_DATE>
<FULL_PATH xml:lang="en_US">notapuppy.xls</FULL_PATH>
<ACTIVE xml:lang="en_US">0</ACTIVE>
</record>
<record>
<KEY xml:lang="en_US">3</KEY>
<PET xml:lang="en_US">notapuppy</PET>
<ISSUE_DATE xml:lang="en_US">July 5, 2005</ISSUE_DATE>
<FULL_PATH xml:lang="en_US">filename.xls</FULL_PATH>
<ACTIVE xml:lang="en_US">0</ACTIVE>
</record>
</data>
Needs to show up as

<table>
<tr>
<td>notapuppy<td> <td>
<td>
<table>
<tr>
<td><a href="notapuppy.xls">notapuppy.xls</a><td>
<td>July 5, 2005</td>
</tr>
<tr>
<td><a href="filename.xls">filename.xls</a><td>
<td>June 29, 2005</td>
</tr>
</table>
</td>
</tr>
</table>
Thanks

Postnext
Ivan PedruzziSubject: Help to group using WYSIWYG
Author: Ivan Pedruzzi
Date: 06 Jul 2005 11:24 PM
Hi Shalini,

Here what I did

- drag & drop the element "record" to the canvas and click "Add Table"
- drag & drop the element "PET" into the first cell
- right click in the second cell then click "Insert Table" (1 row 2 columns)
- drag & drop the element "FULL_PATH" in the first cell of the inner table
- drag & drop the element "ISSUE_DATE" in the second cell of the inner table

switch to XSLT source

- define the xsl key to implement the grouping
- add the predicate to the for-each loop to restrict the loop to the group
- add an inner for-each loop to pull the group values

You can see the read solution here

Hope this helps
Ivan Pedruzzi
Stylus Studio Team


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="PET" match="data/record" use="PET"/>

<xsl:output method="html"/>

<xsl:template match="/">
<html><head></head>
<body>
<table width="100%" border="1">
<tbody>
<xsl:for-each select="data/record[generate-id() = generate-id(key('PET',PET)[1])]">
<tr>
<td width="50%">
<xsl:value-of select="PET"/>
</td>
<td width="50%">
<table width="100%" border="1">
<tbody>
<xsl:for-each select="key('PET',PET)">
<tr>
<td width="50%">
<xsl:value-of select="FULL_PATH"/>
</td>
<td width="50%">
<xsl:value-of select="ISSUE_DATE"/>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

Posttop
Shalini venkateswaranSubject: Help to group using WYSIWYG
Author: Shalini venkateswaran
Date: 07 Jul 2005 12:31 PM
Ivan
Thank you very much that helped.
I am sure this was not my last post. Have some many to many grouping problems, where the table column names have to be built dynamically.
I'm trying to figure out if I want to retrieve the data as one big xml (denormalized) or 3 diff ones. Will post something soon
As a famous saying goes,
I'll be back

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.