Re: [xsl] unwanted xmlns and shape attributes

Subject: Re: [xsl] unwanted xmlns and shape attributes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 9 Sep 2005 15:01:31 +0100
> a. The inserted anchor shows xmlns="" as an attribute,
>    but how do I to get rid of it?  

the namespace is part of the name so essentially you change the
namespace the same way as you would change letters in the local part of
the element name.
If you are generating everything in xhtml putting
xmlns=""; on your xsl:stylesheet is the most
natural way, but if you only want to generate this one element in xhtml
namespace you can put the namespace declaration on the literal result
element <a> in the stylesheet.

> 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?  

It is in the source tree as seen by xslt: it is defaulted by the dtd so
added by the xml parser while building the input tree before xslt starts.

You either need to stop the dtd being read by either removing teh
<!DOCTYPE or using an entity resolver that ignores it, or change your
styleshet not to copy but instead traverse down the tree and omit this
attribute. Note that if you remove the dtd you may need to explictly add
an xmlns=""; to your source (as it is
defaulted by the dtd, and otherwise teh elements will be in no-namespace
if you remove the dtd)


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread