Re: Commenting whole Elements?

Laurent Bihanic <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hi,

A commented out element is no longer XML data, it's just some comment text.

So you should replace the elements to comment out by a Comment node that 
contains the text representation of these elements obtained by outputting them 
to a string using XMLOutputter.

Laurent

Jan Brauer a écrit :
> Hi,
> 
> I'm currently writing a tool to merge different fragments into a
> web.xml. I'm looking for a way to surround an element with comments.
> I've added a namespaced attribute to the element. Based on this I'm
> trying to surround the Element with two Text elements:
> 
> Text intro = new Text("<!--");
> Text outro = new Text("-->");
> 
> Unfortunately the pointy brackets are escaped. I haven't found a way to
> disable the escaping:
> 
> new Text("&lt;--")
> resolves to:
> 
> "&amp;lt;--"
> 
> What can I do to disable the escaping for those two Text elements? Or is
> there an even better way to accomplish what I'm trying?
> 
> Thx,
> Jan
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.