|
Subject: RE: [xsl] Grouping into a table (for vertical alignment) From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 27 May 2004 11:58:20 -0400 |
Currently the input XML structure has a <form> tag which can have either:
1) "presentation tags" like <text>, <image>, etc which require to fill the whole width (in the HTML, these are already placed in <div> to get its own line WITHOUT any <table>)
2) "entry tags" like <input>, <password>, <checkbox>, etc which require to be separated into a label and a value (in HTML, I want these to be placed in a <table>, EITHER a new table if the previous tag was a "presentation tag" OR a new row in the previous table if the previous tag was an "entry tag")
The special considerations for this are:
A) there can be any sequence of "presentation tags" and "entry tags"
B) if there are "presentation tags" in-between groups of "entry tags", then each separated group of entry tags will have their own table.
C) I do _not_ want to put "presentation tags" in a table in anyway (eg. use a single column with "colspan=2")
<form>
<name>form</name>
<action>submit.do</action>
<method>post</method>
<content>
<text>
<value>Please enter your Name and Password.</value>
<class>instruction</class>
</text>
<input>
<name>username</name>
<label>Name: </label>
<value></value>
<class>mandatory</class>
</input>
<password>
<name>password</name>
<label>Password :</label>
<value></value>
<class>mandatory</class>
</password>
<text>
<value>All attempts are logged.</value>
<class>warning</class>
</text>
</content>
</form><xsl:template match="password | input">
<xsl:if test="key('inputs-by-handle',generate-id()">
<!-- this test is true only if this password or input is a handle
(that is, is the first in a run of them, even if a run of one only)
since those that are not, will retrieve empty node sets when the
key() is called with their unique IDs -->
<table>
<xsl:apply-templates select="key('inputs-by-handle',generate-id()"
mode="make-row"/>
<!-- match the passwords and inputs again in the 'make-row' mode to
create our table rows -->
</table>
</xsl:if>
</xsl:template>I hope this helps, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Grouping into a table (fo, Daniel Joshua | Thread | RE: [xsl] Grouping into a table (fo, Daniel Joshua |
| RE: [xsl] Performance Question: Exp, M. David Peterson | Date | RE: [xsl] exclude-result-prefixes i, Matt Frank |
| Month |