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

RE: XSL Formatting Problem

Subject: RE: XSL Formatting Problem
From: "Jack Cane" <jwcane@xxxxxxxxxxx>
Date: Tue, 26 Feb 2002 07:58:49 -0500
miss colonic cane
Bless you, Jeni, it worked! Now, two more questions:

Would like to center some text. Neither of the following works:

	<html:p align="center">
	  <xsl:value-of select="DissTitle"/>
	</html:p>

	<html:p><html:center>
	  <xsl:value-of select="DissTitle"/>
	</html:center></html:p>

The lines,

	<html:title>
	  <xsl:value-of select="DissTitle"/>
	</html:title>

were intended to act as the conventional title tag, which should place the
content in the browser's title bar. Instead, the content is rendered on the
browser content window, and the title bar reflects the path and file name on
the local machine.

-----Original Message-----
From: Jeni Tennison [mailto:jeni@xxxxxxxxxxxxxxxx]
Sent: Tuesday, February 26, 2002 5:52 AM
To: Jack Cane
Cc: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  XSL Formatting Problem


Hi Jack,

> ************************
> The xml file follows
> ************************
>
> <?xml version = "1.0"?>
> <?xml:stylesheet type = "text/xsl" href = "dissertation.xsl"?>

That should be:

<?xml-stylesheet type = "text/xsl" href = "dissertation.xsl"?>
     ^
  hyphen, not colon

> ************************
> The xsl file follows
> ************************
>
> <?xml version = "1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/Transform/1.0"
>                 xmlns:html="http://www/w3.org/TR/REC-hrml40"
>                 result-ns="html">

That should be:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:html="http://www.w3.org/1999/xhtml"
                version="1.0">

Namespaces are one thing that you *cannot* just guess at. Without the
correct namespace for XSLT, a stylesheet won't be recognised as a
stylesheet. If you found the namespace you're using for XSLT in a book
or online, then you should contact the publisher or author to tell
them that it's wrong.

You also need to have a version attribute on the xsl:stylesheet
element. I don't know where the result-ns attribute is coming from -
probably WD-xsl, but it doesn't exist in XSLT.

>         <!-- Sample xml style sheet
>                          Nova Southeastern University
>          -->
>
>         <xsl:template match="TitlePage">
>                 <html:title>
>                         <xsl:value-of select="DissTitle"/>
>                 </html:title>
>                 <html:body bgcolor="#efefef" font="Palatino Linotype"
size="2">
>                         <xsl:value-of select="DissTitle"/>
>                 </html:body>
>         </xsl:template>

For valid XHTML, you should have a html document element and a head
element, and a p element around the text in the body. So you should
have something like:

<xsl:template match="TitlePage">
  <html:html>
    <html:head>
      <html:title>
        <xsl:value-of select="DissTitle"/>
      </html:title>
    </html:head>
    <html:body bgcolor="#efefef" font="Palatino Linotype" size="2">
      <html:p>
        <xsl:value-of select="DissTitle"/>
      </html:p>
    </html:body>
  </html:html>
</xsl:template>

But I doubt that actually makes much difference to how it's displayed.
The namespace is the most important thing.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.