Search

In order to be XHTML 1.1 compliant, I've to add

xmlns="http://www.w3.org/1999/xhtml"

to the <html> element. However, if I add the namespace using

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

or

&lt;xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"&gt;

it adds the namespace to <html> but it "thinks" I want to add this namespace only to the elements inside the current document, so it resets the namespace of the elements imported from other XSL documents, automatically adding

xmlns=""

to that elements.

So... I've added xmlns="http://www.w3.org/1999/xhtml" to the xsl:stylesheet of every XSL document, but it still adds xmlns="" (the "resetting" tag) to the elements inside the written articles (generated by the markdown interpreter?).

Is there a simpler way to propagate this namespace (xmlns="http://www.w3.org/1999/xhtml") from the "master" document to the other documents? If not, how could I specify this namespace for the elements inside the articles?

Thanks :-)

i've run into this issue before. did you remove the xmlns from the <html> element? and you only want the xmlns on that element, correct?

if so, the default install (and what you have posted above) should work:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

and of course the &lt; should be <.

As I reported before, adding it to "<xsl:stylesheet>" doesn't work


if I add the namespace using

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

or

&lt;xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"&gt;

:-)

well you shouldn't add it to the html element otherwise it will give you the blank xmlns in other elements. as far as adding it to the xsl:stylesheet element, I'm not sure why it's not outputting anything.

what's your xsl look like exactly? can you post the code?

It outputs the same thing as adding it to <html> (ok for <html>, blank for others), I think this is because the "other things" are "imported" from other XSL stylesheets (as I've already said in the first message). Adding it to the <xsl:stylesheet> of every stylesheet seems to work... the problem is adding it to the content of the markdown formatted text.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details