Re: [xsl] namespace prefix weirdness

Subject: Re: [xsl] namespace prefix weirdness
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Wed, 18 Aug 2004 09:02:27 -0400
On Aug 18, 2004, at 8:35 AM, Michael Kay wrote:

So is this purely an aesthetic issue?  It has no effect on subsequent
processing?

The choice of namespace prefixes, unfortunately, is not completely
arbitrary, (a) because you might be using constructs that use namespace
prefixes in element or attribute content, and (b) because you might require
that the result document is valid against a DTD that disallows the presence
of certain xmlns:xxx attributes.

If there are then processing implications, it seems to me that with Jeni's simple stylesheet, Saxon ought to generate a perfectly clean copy the mods element (the default element for the stylesheet is defined), but it doesn't. IIRC, the mods element gets the weird prefix. That isn't a problem in this case, but seems like it could be.


--- mods.xsl ---
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:mods="http://www.loc.gov/mods/v3";
                xmlns="http://www.loc.gov/mods/v3";>

<xsl:template match="mods:modsCollection" mode="enhanced-bib">
  <modsCollection>
    <xsl:apply-templates select="mods:mods"  mode="enhanced-bib"/>
  </modsCollection>
</xsl:template>

<xsl:template match="mods:mods" mode="enhanced-bib">
  <key>test</key>
  <xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>

Current Thread