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

Re: [newbie]   in xslt-file

Subject: Re: [newbie]   in xslt-file
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 1 Nov 2000 18:20:01 -0400 (EST)
xslt nbsp
Vincent De Baere wrote:
> [cut-'n-no-paste]
> <xsl:template match="article/b2/tekst">
> <tr><td>&nbsp;&nbsp;&nbsp;</td>
> <td><xsl:value-of select="./@author"/></td>
> <td>&nbsp;&nbsp;&nbsp;</td></tr>
> </xsl:template>
> [cut-'n-no-paste]
> 
> However, this does not work. The parser (msxml3.dll) gives an error ("the
> stylesheet does not contain a document element. 

There should at least be an xsl:stylesheet element enclosing the template,
where you declare the binding of the xsl prefix to the appropriate
namespace for XSLT 1.0, and include the appropriate version attribute.

There should also be a prolog where you declare that the document is in
the XML 1.0 syntax, in a particular encoding.

> I tought the &nbsp; entity was predefined in xml. 

It is not predefined. Only &lt; &gt; &amp; &quot; &apos; are predefined.
You can either use &#160; or &#xA0;, or you can define an entity like nbsp
for the same.

Try:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:template match="article/b2/tekst">
    <tr>
      <td>&nbsp;&nbsp;&nbsp;</td>
      <td>
        <xsl:value-of select="./@author"/>
      </td>
      <td>&nbsp;&nbsp;&nbsp;</td>
    </tr>
  </xsl:template>
</xsl:stylesheet>


See also the FAQs at

http://www.netcrucible.com/xslt/msxml-faq.htm

and.. er.. it seems the other XSL FAQ has disappeared.

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/




 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.