Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: how to get closing tag

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 2/6/2008 3:13:00 PM

Imran wrote:

> when i use DOM to generate the XML file ,what i get for a tag is as follows
> 
> <MYTAG ATT="Hello"/>
> 
> but what I want it
> 
> 
> 
> <MYTAG ATT="Hello"> </MYTAG>

In your case the MYTAG element has as its content a text with a space 
character. If you really want that then insert the contents e.g.
   myTagElement.appendChild(xmlDocumentInstance.createTextNode(" "))

If you meant
   <MYTAG ATT="Hello"></MYTAG>
instead then, in case your are using the .NET DOM implementation, there 
is a property IsEmpty 
<URL:http://msdn2.microsoft.com/en-us/library/system.xml.xmlelement.isempty.aspx> 
that you can set to false.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent