Self Closing Elements
This is an open discussion with 5 replies, filed under General.
Search
You’ve probably got your XSL output type set to html
, which will give you HTML 4.01 non-self-closing elements. Using xml` will give you XHTML self-closing elements.
<xsl:output method="xml" ... />
Maybe it has to do with the method
of your xsl:output
element?
If the method is ‘html’ I guess it defaults to HTML
syntax instead of XML/XHTML
syntax. Changing the output method to xml
should return elements with the self-closing />
.
haha, and @nickdunn is faster again ;)
FWIW: it does not validate but makes no difference in how browsers render your page.
thanks guys, but I thought of that.
I have this though:
<xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" />
That other code by the way I am displaying by this:
<xsl:apply-templates select="/data/seo-manager/entry"/>
Its all sorted, there was a rogue utility that was throwing everything out of sync. All is right with the world now.
Create an account or sign in to comment.
I am trying to validate my site, and have discovered that my meta tags are not closed or self closing.
This is the code I am using:
Looks right? Well it’s not closing.
Anybody know why?