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

AW: can't display heading in between fields...pls. hel

Subject: AW: can't display heading in between fields...pls. help
From: Markus Abt <abt@xxxxxxxx>
Date: Fri, 18 Jul 2003 01:10:24 +0200
bill template
John,

this are my changes to your stylesheet (see comments marked with "MARKUS:").
-  I have changed the first template (HSContract)
-  I have added 2 new templates.
   Since you already work with modes, I picked this up.
   mode="target" produces the descriptions in the second part of the resulting HTML.



<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="HSContract">
    <html>
      <head>
        <title/>
      </head>
      <body>
      	<!--<p><a href="#desc"><b>Contract Name: </b><xsl:value-of select="@contractName"/><br /></a>-->
		<p><b>Contract Name: </b><xsl:value-of select="@contractName"/><br />
		<b>ID: </b><xsl:value-of select="@id"/><br />
		<b>Start Date: </b><xsl:value-of select="@startDate"/><br /></p>
		<xsl:apply-templates select="HSDataContainerType[@name='Inputs']"/>
		<xsl:apply-templates select="HSDataContainerType[@name='Outputs']"/>
		<xsl:apply-templates select="HSDocumentation"/>

		<!-- MARKUS: the next two lines are new -->
		<xsl:apply-templates select="HSDataContainerType[@name='Inputs']" mode="target"/>
		<xsl:apply-templates select="HSDataContainerType[@name='Outputs']" mode="target"/>

		<!-- MARKUS: this is now done in the following two templates
		<xsl:apply-templates select="//HSString | //HSDouble | //HSInteger" mode="target" />
		-->
	  </body>
    </html>
  </xsl:template>

  <!-- MARKUS: This template generates the list of input fields -->
  <xsl:template match="HSDataContainerType[@name='Inputs']" mode="target">
	<p><b><a name="in">Input Descriptions</a></b></p>
  	<xsl:apply-templates select=".//HSString | .//HSDouble | .//HSInteger" mode="target" />
  </xsl:template>

  <!-- MARKUS: This template generates the list of output fields -->
  <xsl:template match="HSDataContainerType[@name='Outputs']" mode="target">
	<p><b><a name="out">Output Descriptions</a></b></p>
  	<xsl:apply-templates select=".//HSString | .//HSDouble | .//HSInteger" mode="target" />
  </xsl:template>

  <!-- MARKUS: Delete all <a name="in"> and <a name="out"> in the rest of the stylesheet -->

  <!-- if @name = Inputs, make it a link -->
  <xsl:template match="HSDataContainerType[contains(@name, 'Inputs')]">
  [...take the rest from your stylesheet...]





Notes:
-  you can use [contains(@name, 'Inputs'] instead of [@name='inputs'],
   if the name attribute may contain something like 'MyInputsVariant' in
   some of your XML data.
   Otherwise the latter is preferable.

-  // in match attributes is not needed.
   Use match="HSString" instead of match="//HSString"

-  You don't use <xsl:call-template ...> in your stylesheet, so you don't
   need name attributes in your templates (debugging stuff?).


Regards,
Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de


 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.