Jump to content

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

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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...