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

entities and unwanted namespace information

Subject: entities and unwanted namespace information
From: "Tracey Zellmann" <tracey.zellmann@xxxxxxxxxxx>
Date: Tue, 11 Jul 2006 20:53:06 -0400
random character b xslt
Regarding my two questions, here is a more appropriate subject line.

Thanks for your response. The copyright now works perfectly. It will take me a little while to digest your other answer, but I am sure I will.

----- Original Message ----- From: "David Carlisle" <davidc@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, July 11, 2006 8:37 PM
Subject: Re: Two questions

It also is
preceded by another character -  B  The web page then displays B)

It's not preceded by another character, the default output for XSLT (and for XML, generally, is utf8 in which most characters are encodedusing multiple bytes. the copyright symbol is encoded in two bytes, so if you view the file using a utf8 aware system then these two bytes look like a single (c) but if you look at them in a system that thinks it's latin-a then you see two random characters (which in this case happen to be an accented A and the copyright symbol) Your web browser can understabd utf8 so if it is showing incorrectly there most likely you are serving it specifying the encoding is iso-88591. It's possible to fix the web server not todo that but simpler is just to ask xslt to generate in latin-1 by adding <xsl:output encoding="iso-8859-1"/> to your stylesheet.

When I run this, I get the material under the p tag just as I desire, but I
get <p xmlns=""> instead of just <p>

that's because your stylesheet generated p in no-namespace rather than p in the xhtml namespace. Move xmlns="http://www.w3.org/1999/xhtml" l up on to the xsl:stylesheet element so that it is in scope for teh whole stylesheet (and probably add it to your common.xsl stylesheet as well That would fix things for elements generated by the stylesheet but for html coming from teh source you don't want to copy-of as you need to change th element name (from p-in-no-namespace to p-in-xhtml) so replace

<xsl:copy-of select="content/p"/>


<xsl:apply templates mode="xh" select="content/p"/>

and have an xh mode that puts things in xhtml,something like

<xsl:template match="*" mode="xh">
<xsl:element name="{local-name()}"
<xsl:apply templates mode="xh" />


Current Thread


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.
First Name
Last Name
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.