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

RE: Complete newbie stupid question

Subject: RE: Complete newbie stupid question
From: Jeff Beadle <Jbeadle@xxxxxxxx>
Date: Thu, 1 Aug 2002 14:24:55 -0400
xslt iterator
Hey Sandy,

Your very close, just move the <xsl:apply-templates /> element definition
from your "Head1" template to within the "root" match template.

Like this:
   <xsl:template match="/">
	<xsl:apply-templates />
   </xsl:template>

This guy will be guaranteed to be the first match, but then it stops there.
Once the xslt iterator is inside that element there's nothing inside it
instructing it on what to to-do/look for next.

Try this:
      ...
	<xsl:template match="/">
		<xsl:apply-templates />
	</xsl:template>       
	<xsl:template match="Head1">
		<html>
			<font face="Arial" 
					color="black" 
					size="24" 
					style="bold"/>
			<br/>
		</html>
	</xsl:template>
      ...


I suspect that you still want to process other templates by pattern
matching, but don't have them listed in your snippet.

If that's the case then you may want something like this:
      ...
	<xsl:template match="/">
		<xsl:apply-templates />
	</xsl:template>       
	<xsl:template match="Head1">
		<html>
			<font face="Arial" 
					color="black" 
					size="24" 
					style="bold"/>
			<br/>
			<xsl:apply-templates />
		</html>
	</xsl:template>
      ...

But, then since your generating html you may to do consider something like
this:
      ...
	<xsl:template match="/">
		<html>
			<xsl:apply-templates />
		</html>
	</xsl:template>      
	<xsl:template match="Head1">
		<!-- other stuff here? -->
		<font face="Arial" 
				color="black" 
				size="24" 
				style="bold"/>
		<br/>
		<xsl:apply-templates />
		<!-- other stuff here? -->
	</xsl:template>
      ...

anyway, hope this helps...
Jeff


-----Original Message-----
From: Sandra Mcdonnell [mailto:smcdonnell@xxxxxxxxxxxxxx]
Sent: Thursday, August 01, 2002 1:57 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Complete newbie stupid question


Hi, I'm new to the list, to XML, to XSL, XSLT and pretty much everything 
related.

I am trying to do what seems like a simple operation. I just want a 
stylesheet that calls a template in which nested templates specify 
formatting for specific nodes. Seems simple. Seemed simple for the first 
3 days I tried to make it work. I am now a blithering idiot who can 
hardly spell XML. Can someone please refer me to a good source that can 
help me sort this out? Or better yet, show me an example?

I have been attempting the following:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
    <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/>
   
    <xsl:template match= "/">
    </xsl:template>       
        <xsl:template match="Head1">
                <html>
                    <font face="Arial" color="black" size="24" 
style="bold"/>
                    <br/>
                </html>
        </xsl:template>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

I have tried every variation of this known to man.

Sorry to waste your time and expertise, but I am getting nowhere.

I appreciate your pearls of wisdom.

Sandy


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

 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.