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

Re: Specifying the XHTML XMLNS

Subject: Re: Specifying the XHTML XMLNS
From: knocte <knocte@xxxxxxxxx>
Date: Wed, 28 Sep 2005 16:34:35 +0200
xhtml xmlns
> But presumably this was not generated by the stylesheet that you posted
> earlier, as that had a literal result element <link> so if you added
> xmlns="http.... to xsl:stylesheet then this link element would be in the
> xhtml namespace not in no-namespace and you woul dnot get xmlns=""
> generated.

Of course not. I have posted the "original" stylesheet that didn't
include the xmlns declaration. If I make the change you suggest, the
XSLT becomes (the same but with an extra xmlns declaration in
xsl:stylesheet tag):

<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="xml" indent="no"
              doctype-public="-//W3C//DTD XHTML 1.1//EN"
              doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
              encoding="ISO-8859-15" />

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="/page">
    <html>
      <xsl:attribute name="xml:lang">es</xsl:attribute>

      <head>
        <title>DHL - <xsl:value-of select="title" /></title>
        <meta name="author" content="knocte" />

        <script type="text/javascript" src="./js/general/amuse.js"></script>
        <script type="text/javascript"
src="./js/general/general.js"></script>
        <link rel="stylesheet" href="./css/general/site.css" type="text/css"
/>

        <xsl:apply-templates select="head/*" />

      </head>

      <body>

        <div id="divHeader">This is my header</div>

        <div id="divContent">
          <xsl:apply-templates select="content/*" />
        </div>

        <div id="divHeader">This is my footer</div>

      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>


And the resultant XML is:

<html xml:lang="es" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>DHL - My specific title</title>
    <meta name="author" content="knocte" />
    <script type="text/javascript" src="./js/general/amuse.js"></script>
    <script type="text/javascript" src="./js/general/general.js"></script>
    <link rel="stylesheet" href="./css/general/site.css" type="text/css" />
    <link rel="stylesheet" href="./css/login.css" type="text/css"
xmlns=""></link>
    <script type="text/javascript" src="./js/login.js" xmlns=""></script>
  </head>
  <body>
    <div id="divHeader">This is my header</div>

    <div id="divContent">
      <h2 xmlns="">Test</h2>
    </div>

    <div id="divHeader">This is my footer</div>
  </body>
</html>


How can I avoid the no-namespace ('xmlns=""') declaration?

  Thanks again,

    Andrew    [ knocte ]

--

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.