[jdom-interest] Turning of entity expansion
ion
vnhu38f93 at subdimension.com
Wed Sep 11 05:08:47 PDT 2002
Interestingly I used this kludge in a program:
/*
* Converts plain text marked up in XML to a JDOM tree and then appends
* the contents of this tree to the Element provided.
*/
private void addToElement(Element element, String content) {
SAXBuilder builder; Document hack;
content = "<hack>"+content+"</hack>";
try {
builder = new SAXBuilder();
hack = builder.build(
new StringReader(content)
);
Iterator itr = hack.getRootElement().getChildren().iterator();
while(itr.hasNext()) {
element.addContent((Element)((Element)itr.next()).clone());
}
} catch(Exception e) {
System.err.println(e.getMessage());
System.exit(0);
}
}
[[ion]]
----- Original Message -----
From: "Alex Rosen" <arosen at silverstream.com>
To: "'Elliotte Rusty Harold'" <elharo at metalab.unc.edu>;
<jdom-interest at jdom.org>
Sent: Wednesday, September 04, 2002 4:08 AM
Subject: RE: [jdom-interest] Turning of entity expansion
> > You can't have that, and IYKWWGFY (*), you wouldn't want that.
> >
> > * if you knew what was good for you :-)
>
> That's overstating it a bit, no? He's asking for a particular one of two
> forms that are completely equivalent in XML's eyes, right? But they may
not
> be equivalent in some other application's eyes, e.g. an editor that
doesn't
> understand UTF-8, let's say. You're definitely right that XML doesn't care
> which form it is, and if you think it does, then that's your
> misunderstanding of XML. But there are certainly reasonable cases where
> something else might care, and you might want to have control over this
> (irrespective of this particular case).
>
> Alex
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
More information about the jdom-interest
mailing list