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

AW: Basic Question about Adding Styles to XSL

Subject: AW: Basic Question about Adding Styles to XSL
From: "Huditsch, Roman \(LNG-VIE\)" <Roman.Huditsch@xxxxxxxxxxxxx>
Date: Tue, 11 Jul 2006 16:30:29 +0200
body style of xsl
Hi Michelle,

Sure, you can.
Without knowing your input source, I would do something like:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
	<xsl:template match="/">
		<xsl:apply-templates select="//guest/name"/>
	</xsl:template>

	<xsl:template match="name">
		<html>
		<head>
		<link rel="stylesheet" type="text/css" href="styles.css">
		</head>
		<body>
		<div id="mainright">
		<div class="sidelinks">Name: <xsl:value-of select="."/><br />
	Department:  <xsl:apply-templates select="../location"/><br />
	Website: <xsl:apply-templates select="../website"/><br />
	Email:  <xsl:apply-templates select="../email"/><br />
	Comment:  <xsl:apply-templates select="../comment"/><hr />
	</div>
	</div>
	</body>
	</html>
	</xsl:template>
	</xsl:stylesheet>

hope this helps.


best regards,
Roman


> -----Urspr|ngliche Nachricht-----
> Von: Michelle Tarby [mailto:tarbymm@xxxxxxxxxxx]
> Gesendet: Dienstag, 11. Juli 2006 16:18
> An: XSL-LIST
> Betreff:  Basic Question about Adding Styles to XSL
>
> This is my first attempt at this, so I want to make sure there's not a
> better way to do it. I'm setting up my XSL stylesheet by incorporating
> my css styles right in it. (If I'm not explaining that well, here's a
> snip)
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template match="/">
> <xsl:for-each select="//guest">
> <xsl:apply-templates select="name"/>
> </xsl:for-each>
> </xsl:template>
> <xsl:template match="name">
> <html>
>  <head>
>  <style type="text/css">
> .sidelinks {
> font-size: 8pt;
> color: #AA7700;
> text-decoration: none
> }
> #mainright {
>     position: absolute;
>     left: 300px;
>     top:145px;
>     width:500px;
>     font-weight: bold;
>     line-height:1.25;
>     padding: 10px;
> }
> </style>
>  </head>
>   <body>
>     <div id="mainright">
>     <div class="sidelinks">Name:  <xsl:value-of select='.'/><br />
>     Department:  <xsl:apply-templates select="../location"/><br />
>     Website: <xsl:apply-templates select="../website"/><br />
>     Email:  <xsl:apply-templates select="../email"/><br />
>     Comment:  <xsl:apply-templates select="../comment"/><hr />
>     </div>
>     </div>
>     </body>
>   </html>
>     </xsl:template>
> </xsl:stylesheet>
>
> My question is - is this the best way to do it? Can I add a link to an
> external style sheet in the XSL?
>
> Thanks in advance!
>
> Michelle
>
> --
> "Every worthwhile accomplishment, big or little, has its stages of
> drudgery and triumph; a beginning, a struggle and a victory."
> --Mahatma Gandhi
>
> *****************************
> Michelle Tarby
> Director of Web Services
> Information Technology
> Le Moyne College
> http://www.lemoyne.edu
> tarbymm@xxxxxxxxxxx

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.