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

RE: Heeeeeeeeelp

Subject: RE: Heeeeeeeeelp
From: Ben Robb <Ben@xxxxxxxxxx>
Date: Wed, 2 Aug 2000 15:04:33 +0100
strip out non html
You are misunderstanding the point of XML, I think. If you put HTML like
this into your XML file, you are limiting the number of ways you are able to
display the result. I would leave your XML as it is, and do the following in
my XSL:

<!-- strip out non-HTML bits -->
<xsl:output type="html" />

<xsl:template match="FAQ_LIST">

  <html>
  <body>

<!-- first for the "navigation" type links -->
	<xsl:for-each select="FAQ/QUESTION">
		Q: <a href="#bookmark{@Bookmark}"><xsl:value-of
select="."/></a><br/>
	</xsl:for-each>

<!-- now apply templates as usual -->

	<xsl:apply-templates />


  </body>
  </html>

</xsl:template>

<xsl:template match="FAQ">
	<br/><a name="bookmark{QUESTION/@Bookmark}"></a>
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="QUESTION">
	Q: <xsl:apply-templates /><br/>
</xsl:template>

<xsl:template match="FAQ">
	A: <xsl:apply-templates /><br/>
</xsl:template>


As you can see, I've just taken the HTML we wanted and slotted it into the
XSLT page. As long as it is wellformed XHTML [for example, we have changed
the <br> to <br/>] the stylesheet is still valid. By using the <xsl:output>
element, we are able to ensure that valid HTML is outputted to the browser.

Ben


 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-2011 All Rights Reserved.