So if I wanted to <Element>.setText("&nbsp;") and 
<Attribute>.setValue("Apples & Oranges"), that's just not gonna work, right?

Is there some crazy way to do <Element>.add( <Entity> )?  And maybe the 
entity returns "&nbsp;" when you call asXML() on it or something?  I 
dunno...  It'd be nice if the javadoc had more comments than like 
"Writes the given |Entity| 
<http://www.dom4j.org/apidocs/org/dom4j/Entity.html>." for 
<XMLWriter>.write( <Entity> )
--Evan

Edwin Dankert wrote:
> I believe your problem is exactly the opposite ...
>
> You want to set the following text:
> test="a & b"
>
> which should automatically be escaped to
> test="a &amp; b"
>
> This is what dom4j should do out of the box.
>
> However if you want to do:
> test="a &test; b"
>
> dom4j (out of the box) would convert this to:
> test="a &amp;test; b"
>
> Which would make the entity reference totally useless,
> so use code in the previous mail if you want dom4j to
> generate:
>
> test="a &test; b"
>
> Regards,
> Edwin



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to