[jdom-interest] DOMOutputter...

Rafizan Baharum udabahar at umich.edu
Sat Nov 18 14:21:07 PST 2000


hi all

FYI, i did my own patch that seems to work for me

cvs diff DOMOutputter.java (in directory C:\jdom\src\java\org\jdom\output\)
Index: DOMOutputter.java
===================================================================
RCS file: /home/cvspublic/jdom/src/java/org/jdom/output/DOMOutputter.java,v
retrieving revision 1.9
diff -r1.9 DOMOutputter.java

296c296
<                 doc.createElement(element.getQualifiedName());
---
>                 doc.createElementNS(element.getName(), element.getQualifiedName());

303a304,307

but still i couldnt get Node.getNamespaceURI() .
please helpppp!


total newbie..
z00t




Rafizan Baharum wrote:

> hi ..
>
> ive tried running a simple program below on DOMOutputter and compare it
> with DOMParser
> i noticed that the Document created is losing namespaceURI, localName,
> prefix and Doctype
> the output ive got is..
>
> ------------DOMPARSER INFO--------------
> fo:root
> root
> fo
> http://www.w3.org/1999/XSL/Format
> [fo:root: null]
> -----------DOMOUTPUTTER INFO------------
> fo:root
> null
> null
> null
> null
>
> am i doing something wrong or is this a possible bug??
> btw, im using fresh cvs checkout today 11/17 5:48pm
>
> thanks
>
> .z00t
>
> my xml looks like this
> <?xml version="1.0" encoding="utf-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> </fo:root>
>
> code..
>       DOMParser parser = new DOMParser();
>       InputSource input = new InputSource(new FileInputStream(source));
>       parser.setFeature("http://xml.org/sax/features/namespaces",true);
>       parser.parse(input);
>       Document xDOM = parser.getDocument();
>       Node xNode = xDOM.getFirstChild();
>
>       System.out.println("------------DOMPARSER INFO--------------");
>       System.out.println(xNode.getNodeName());
>       System.out.println(xNode.getLocalName());
>       System.out.println(xNode.getPrefix());
>       System.out.println(xNode.getNamespaceURI());
>       System.out.println(xDOM.getDoctype());
>
>       SAXBuilder builder = new SAXBuilder();
>       org.jdom.Document doc = builder.build(new File(source));
>       DOMOutputter dOut = new DOMOutputter();
>       Document jDOM = dOut.output(doc);
>
>       Node jNode = jDOM.getFirstChild();
>       System.out.println("-----------DOMOUTPUTTER INFO------------");
>       System.out.println(jNode.getNodeName());
>       System.out.println(jNode.getLocalName());
>       System.out.println(jNode.getPrefix());
>       System.out.println(jNode.getNamespaceURI());
>       System.out.println(jDOM.getDoctype());
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com




More information about the jdom-interest mailing list