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

namespace prefix weirdness

Subject: namespace prefix weirdness
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Mon, 16 Aug 2004 17:43:31 -0400
xsl template prefix
OK, I started over just to see if I can create a version of the complete document as a temporary tree with some additional text inserted along with the mods records.

I'm finding, however, some bizarre behavior with namespace prefixes. Why might I end up with something like the "_0" prefix on that mods element below? This is the latest Saxon 8 release.

<modsCollection xmlns="http://www.loc.gov/mods/v3">
<key xmlns="">test</key>
<_0:mods xmlns="" xmlns:_0="http://www.loc.gov/mods/v3" ID="Mitchell1996b">
<titleInfo xmlns="http://www.loc.gov/mods/v3">
<title>Introduction</title>
<subTitle>Public Space and the City</subTitle>
</titleInfo>


Here's my stylesheet (minus header):

<xsl:template match="/">
  <xsl:variable name="temp">
    <xsl:apply-templates mode="enhanced-bib"/>
  </xsl:variable>
  <xsl:apply-templates select="$temp" mode="modified"/>
</xsl:template>

<xsl:template match="db:article" mode="enhanced-bib">
  <article xmlns="http://docbook.org/docbook-ng">
    <xsl:copy>
      <xsl:apply-templates mode="enhanced-bib"/>
    </xsl:copy>
  </article>
</xsl:template>

<xsl:template match="db:info" mode="enhanced-bib">
  <info xmlns="http://docbook.org/docbook-ng">
    <xsl:copy-of select="."/>
  </info>
</xsl:template>

<xsl:template match="db:section" mode="enhanced-bib">
  <section xmlns="http://docbook.org/docbook-ng">
    <xsl:copy-of select="."/>
  </section>
</xsl:template>

<xsl:template match="db:bibliography" mode="enhanced-bib">
<bibliography xmlns="http://docbook.org/docbook-ng">
<xsl:apply-templates select="mods:modsCollection" mode="enhanced-bib"/>
</bibliography>
</xsl:template>


<xsl:template match="mods:modsCollection" mode="enhanced-bib">
  <modsCollection xmlns="http://www.loc.gov/mods/v3">
    <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:template match="/" mode="modified">
  <xsl:copy-of select="*"/>
</xsl:template>

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.