Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Copying without namespace?

Thread Tools

Copying without namespace?

Andre-John Mas
Posts: n/a
On Mar 5, 3:41 pm, Joseph Kesselman <(E-Mail Removed)>
> Andre-John Mas wrote:
> > The issue is that I end up with an xhtml document that includes
> > namespaces that were only meant to be used in the xsl and not the
> > final document.

> Sounds like you're looking for xsl:stylesheet's exclude-result-prefixes
> attribute.

That what I tried doing, currently I have:

exclude-result-prefixes="i18n ota dataList iItemList math"

which excludes non-anonymous namespaces, such as:


but how do you exclude an anonymous namespace:


Reading elsewhere I was given the suggestion of using:

<!-- copies without the template -->
<xsl:template match="*">
<xsl:element name="{name()}" namespace="">
<xsl:copy-of select="@*"/>

and changed the original block to:

<xsl:for-each select="$pageMetaData/*">
<xsl:when test="local-name() = 'meta'">
<xsl:apply-templates select="."/>
<meta content="{.}" name="{local-name()}"/>

but I am not sure this is the best approach.


Reply With Quote
Joseph Kesselman
Posts: n/a
Andre-John Mas wrote:
> but how do you exclude an anonymous namespace:
> xmlns=""

The default namespace declaration is generally not generated into the
output unless it is required, meaning that the parent element is in a
different default namespace. I'd have to take another look at your
specific example to see whether that's what's going on, but if it is
then the proper answer is "if you don't want to change default
namespaces, don't output an element that's in a different default
namespace than its parent."

Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying collection without duplicates Karsten Wutzke Java 7 08-12-2007 11:06 PM
Get RealPlayer to play CDs without copying them MARK WOOLSTON Computer Support 4 09-01-2006 09:43 PM
Copying files without halting on bad ones yawnmoth Computer Information 0 12-22-2005 09:30 AM
Passing large C buffers to Java (via JNI) without copying? Java 10 10-28-2005 09:33 AM
Adding an embedded resource without copying it? Wysiwyg ASP .Net 0 05-03-2005 10:15 PM