Hi Lan, I think we can Implement by LSParser Interface. http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSParser.html this link may help you.
Regards, Ravikanth On Thu, Dec 11, 2008 at 7:36 PM, Ian Hummel <[EMAIL PROTECTED]> wrote: > Hi everyone, > I need to create XML that looks like this whenever the value of "tag" is "" > (the empty string): > > <root> > <tag></tag> > </root> > > I've tried the following: > > DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); > DocumentBuilder db = dbf.newDocumentBuilder(); > Document d = db.newDocument(); > Element root = d.createElement("root"); > Element tag = d.createElement("tag"); > d.appendChild(root); > root.appendChild(tag); > Text text = d.createTextNode("\t"); > tag.appendChild(text); > > > but I always end up with XML like this: > > <root> > <tag/> > </root> > > > Is there a way to force empty text nodes to get "denormalized" ? > > Thanks, > > Ian. > -- Ravikanth