[xsl] can't display heading in between fields...pls. help

Subject: [xsl] can't display heading in between fields...pls. help
From: "John Liebermann" <ahsan_hussain@xxxxxxxxxxxxx>
Date: Wed, 16 Jul 2003 14:19:50 -0700
Markus, that didn't change anything for me. I already had those separations
in my code inside where i match <HSDataContainerType>. Thanks for your help
anyways. Atleast it narrowed down the problem in my mind.

Let me explain what i would like to do since i can't attach the full XSL
file. I have a few fields in with parents Inputs and Outputs. The Inputs and
Outputs are of <HSDataContainerType> whereas the fields can be <HSString> or
<HSDecimal> or <HSInteger> etc. First i display them is an indented form
kinda like a tree.
Output HTML looks like this now:
------------------------------
Inputs
	textField1
	integerField1
	DataContainer1
		integerField11
		decimalField11
Outputs
	integerField2
	DataContainer2
		decimalField2
..
	<-----wanna display heading "Input Descriptions"
	   here and link it up to the top 'Input' heading.
textField1
Description: None       <--this is where the descriptions
Required: Yes		 start for each field in the tree up

integerField1
Description: None
Required: Yes

DataContainer1/integerField11
Description: None
Required: No

DataContainer1/decimalField11
Description: None
Required: No
		<-----wanna display heading "Output Descriptions"
		   here and link it up to the top Output heading.
integerField2
Description: None
Required: No

DataContainer2/decimalField2
Description: None
Required: No

..
--------------------------------------------------------------------
All these fields (all those with names ending in 'field') are links to their
descriptions, which i display at the bottom with the field name as heading
and then other info. extracted out of their attributes etc. What i would
like to do is to make links out of Inputs and Outputs and then be able to
link them up to headings(don't exist, would like to put) in between the
descriptions at the bottom (see top output). This would clearly demark the
Inputs from Outputs. So i just need one heading for 'Input Description' and
one heading for 'Output Description' to show the user where they start.

I was using a for-each loop inside my 'HSString' template with ancestor::*
to clearly display the path to each field. This also helped me check for any
fields that had a parent 'Outputs' or 'Inputs'. So i was able to demark and
tell where the Inputs end and Outputs Start but the problem is being able to
put a HEADING in between my descriptions.

I was putting this code inside my <HSString> field:

<xsl:template name="HSLinkerString" match="HSString" mode="target">
		<img src="texticon.gif"><a name="{generate-id(.)}">
		<b><xsl:comment>Accessing the parent nodes...</xsl:comment>

		 <xsl:for-each select="ancestor::*">
			<xsl:choose>
				<xsl:when test="contains(@name, 'Inputs')"></xsl:when>

				<xsl:when test="contains(@name, 'Outputs') and
					not(ancestor::*[contains(@name,'Outputs')])">
				 	<a name="out">Output Description</a>
				</xsl:when>
				<xsl:when test="contains(@name, 'Settings')"></xsl:when>
				<xsl:otherwise>
					<xsl:if test="not(position()='1')">
						<xsl:value-of select="@name" />/
					</xsl:if>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>
		...
</xsl:template>

The highlighted 'Output Description' above is displayed during all times
where there is a <HSString> which has an ancestor 'Output'. I want this to
be displayed ONLY once.

So, what i can't figure out is how to be able to display a heading in
between the descriptions (as marked on the output above). Thank you all for
your help.

Regards,

John


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread