Okay thanks, I modified the copy all as follows which works
<xsl:template match="*" oh:doc="Match and copy any element and it's
attribute" >
<xsl:element name="{local-name()}"
namespace="http://www.mediawiki.org/xml/export-0.4/">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
On Mon, Jun 6, 2011 at 5:36 PM, Andrew Welch
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
On 6 June 2011 18:30, Alex Muir <amuir(_at_)utg(_dot_)edu(_dot_)gm> wrote:
Hi,
The following code adds a namespace to the mediawiki element and a
copyAll I import copies the other elements
<xsl:import href="copyAll.xsl"/>
<xsl:template match="mediawiki">
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.4/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.4/
http://www.mediawiki.org/xml/export-0.4.xsd" version="0.4"
xml:lang="en">
<xsl:apply-templates/>
</mediawiki>
</xsl:template>
However in the result the child element <page> gets a blank xmlns=""
attribute added..... Why?
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.4/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.4/
http://www.mediawiki.org/xml/export-0.4.xsd"
version="0.4" xml:lang="en">
<page xmlns="">
If <page> comes from your stylesheet, then its not in-scope for the
default namespace change.
If <page> comes from your input, then its it no namespace so rather
than copy it you will have to create a new element in the result with
the local name "page" in the right namespace, then copy page's
attributes and process its children.
--
Andrew Welch
http://andrewjwelch.com
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--
Alex Muir
Instructor
Program Organizer
University Technology Student Work Experience Building
https://sites.google.com/a/utg.edu.gm/alex/Home
Come to Gambia, Join UTSWEB
https://sites.google.com/a/utg.edu.gm/utsweb/
+220 359 1203
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--