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

unwanted xmlns and shape attributes

Subject: unwanted xmlns and shape attributes
From: Manfred Staudinger <manfred.staudinger@xxxxxxxxx>
Date: Fri, 9 Sep 2005 15:35:46 +0200
xhtml anchor
Hi list,
I have two temporary trees to be used for an identity
transformation. The first one $html is initialized with
<xsl:copy-of select="doc('itrans.html')"/>
the second one with a sequence constructor. The
transformation inserts an anchor element before the
one existing already. It finally works somehow, but I've
still two problems (using Saxon 8.5.1):
a. The inserted anchor shows xmlns="" as an attribute,
   but how do I to get rid of it?
      I know that specifying a default nemespace
   xmlns="http://www.w3.org/1999/xhtml"
   on the stylesheet would solve the issue. However
   this seems to have a devastating effect on my
   original stylesheet and I would like to avoid it.
b. The second anchor shows a shape="rect" attribute,
   which is not in the source and again the question
   is how do I to get rid of it?

Regards, Manfred

Input file itrans.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>hhh</title>
	</head>
	<body>
		<div class="index">
			<a href="Index.html">Personen-Index</a>
		</div>
	</body>
</html>

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xhtml"
   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
   omit-xml-declaration="yes" />
<xsl:template match="node()|@*" mode="index">
<xsl:param name="a"/>
	<xsl:copy copy-namespaces="no">
     	<xsl:apply-templates select="node()|@*" mode="index">
			<xsl:with-param name="a" select="$a"/>
		</xsl:apply-templates>
	</xsl:copy>
</xsl:template>
<xsl:template xpath-default-namespace="http://www.w3.org/1999/xhtml"
match="a" mode="index">
<xsl:param name="a"/>
	<xsl:copy-of select="$a" copy-namespaces="no"/>
	<xsl:copy-of select="."/>
</xsl:template>

<xsl:template match="/">
	<xsl:variable name="html">
		<xsl:copy-of select="doc('itrans.html')"/>
	</xsl:variable>
	<xsl:variable name="link">
		<a href="../name.html">
			<xsl:text>name</xsl:text>
		</a>
	</xsl:variable>
	<xsl:apply-templates select="$html" mode="index">
		<xsl:with-param name="a" select="$link"/>
	</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>

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.