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

Re: XML source with DOCTYPE declaration

Subject: Re: XML source with DOCTYPE declaration
From: Zeljko Rajic <zeljko.rajic@xxxxxxxxxx>
Date: Fri, 20 Apr 2001 17:05:57 +0200
zeljko body
Hi Jeni,

I hope I can bother you with a further, hopefully last question ....

I'm trying to solve my problem by doing some kind of preprocessing just
as you suggested. So my test case just looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
-->
<html>
	<head>
		<title/>
	</head>
	<body title="article">
		<p>Some Content !</p>
	</body>
</html>



<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:html="http://www.w3.org/1999/xhtml">
   <xsl:output method="html" version="1.0" encoding="UTF-8"
indent="yes"/>

	<xsl:template match="*">
		<xsl:element name="{local-name()}"
namespace="http://www.w3.org/1999/xhtml">
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>

	<xsl:template match="/">
		<xsl:text>ROOT element found !</xsl:text>
		<xsl:apply-templates/>
	</xsl:template>
	
	<xsl:template match="/html:html">
		<xsl:text>HTML tag found !!!</xsl:text>
		<xsl:apply-templates/>
	</xsl:template>
	
	<xsl:template match="/html:html/html:body">
		<xsl:text>BODY tag found !!!</xsl:text>
		<xsl:apply-templates/>
	</xsl:template>

</xsl:stylesheet>


So I'm just trying to add the HTML namespace before any other
transformation. Unfortunately this does not work !!  :(   The generated
output looks like this:

ROOT element found !<html xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xh
tml">
        <head>
                <title/>
        </head>
        <body title="article">
                <p>Some Content !</p>
        </body>
</html>


So what am I doing wrong? Or did I maybe misunderstand you and I have to
do the complete transformation in 2 separate steps:

1. Doing the preprocessing and save the output temporary
2. Using this temporary ouput (file) as source for the intended
transformation

Would be great if you could clarify this.

Thanks a lot,

Zeljko

 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.