xsl-list
[Top] [All Lists]

[xsl] changing from no namespace to a namespace

2008-04-03 13:50:13
I have a document starting:
<?xml version="1.0" encoding="UTF-8"?>
<osis>
   <osisText  type="x-Wycliffe-1.0" osisIDWork="WBT.seh" xml:lang="seh"
             canonical="true">
      <header>

and want it to be:

<?xml version="1.0" encoding="UTF-8"?>
<osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace";>
   <osisText  type="x-Wycliffe-1.0" osisIDWork="WBT.seh" xml:lang="seh"
             canonical="true">
      <header>
 
but I keep getting xmlns="" added

<?xml version="1.0" encoding="UTF-8"?>
<osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace";>
   <osisText  xmlns=""  type="x-Wycliffe-1.0" osisIDWork="WBT.seh" 
xml:lang="seh"
             canonical="true">
      <header>

-----
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="2.0"
xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace";
    >
<xsl:output indent="yes"/>
 
<xsl:template match="osis">
        <osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace
">
                <xsl:apply-templates/>
        </osis>
</xsl:template>
 
 
 
   <!-- identity transformation -->
    <!-- Whenever you match any node or any attribute -->
    <xsl:template match="node()|@*">
        <!-- Copy the current node -->
        <xsl:copy>
            <!-- Including any attributes it has and any child nodes -->
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

 
</xsl:transform>


Jim Albright
704 843-0582
JAARS, Speeding Bible Translation
Wycliffe, Partners in Bible Translation



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

<Prev in Thread] Current Thread [Next in Thread>