Jump to content

self closing tags (e.g. "<thisnode/>")


RyanD
 Share

Recommended Posts

For some reason, the xsl I am using will not create any tags that are "self closing" (e.g "<thisnode/>" as opposed to "<thisnode></thisnode>"). Any body have any idea why?My xsl begins as follows:<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="xml" version="1.0" standalone="yes" encoding="utf-8"/><xsl:output method="xml" doctype-system=""/> <xsl:strip-space elements="*" />------------------..somehow I suspect that a declaration or setting of some kind is to blame...Thanks in advance for any help!

Link to comment
Share on other sites

make sure there is a space before your /> so it would be ( />) not (/>)

<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform" /><xsl:output method="xml" version="1.0" standalone="yes" encoding="utf-8" /><xsl:output method="xml" doctype-system="[url to a dtd]" /><xsl:strip-space elements="*" />

hope this helps.Matt

Link to comment
Share on other sites

...perhaps I am not being clear. Here is an example of some of the xsl in my xsl doc: <xsl:element name="TITLE_HOLDER"> <xsl:attribute name="_Name"><xsl:value-of select="NAMESONTITLE"/></xsl:attribute> </xsl:element>...it creates xml like:<TITLE_HOLDER _Name="Richard Cranium"></TITLEHOLDER>Is there a way I can make it create xml like:<TITLE_HOLDER _Name="Richard Cranium"/>Thanks again for any help!Ryan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...