[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Two questions
I have limited experience with XSLT, so please accept my beginner's stance.
The good news is that I am creating about 500 web pages, where I control the xml content and can do the transforms any way that is practical. I am using SaxonB with java programs, 1.5.0_07. Right now I have two particular problems: entities and a namespace issue. First, I need to put some entity characters in the web pages, copyright for example. This occurs on many of the pages, so I have put it in a template with other footer information. Using © saxon gives me an error that the entity hasn't been declared. Trying © saxon is OK, but I notice that the html page winds up with the actual copyright symbol, not the entity. It also is preceded by another character - B The web page then displays B) What is the correct way to get entities onto the web page through a transform? Second, my xml material has content that already has html tags. I have got that onto the pages using <xsl:copy-of .., but I am getting some additional namespace information. example xml <?xml version="1.0" encoding="ISO-8859-1"?> <HistoryPages> <page seq="1"> <url>monumentSquareJarvisMap.html</url> <title>Monument Square, 1810 - 1820, from a Map by Edward Jarvis</title> <content> <p>Edward Jarvis (1803-1884) was a physician</p> </content> </HistoryPages> stylesheet <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd method="html" indent="yes" /> <xsl:include href="common.xsl"/> <xsl:template match="page"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" > <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <title> <xsl:value-of select="title"/> </title> </head> <body> <xsl:copy-of select="content/p"/> <xsl:call-template name="footerText"/> </body> </html> </xsl:template> </xsl: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> It displays successfully, but fails strict validation. What is the correct way to do this? Thanks for your help.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|