« Return to Thread: missing baseURI in output

Re: missing baseURI in output

by checker :: Rate this Message:

Reply to Author | View in Thread

hi
i have got exactly the same problem. Have you found a solution yet?
regards



Larry Levin wrote:
Hi:
I've been using JDom for quite some time with no probelems but just hit
a snag when trying to create an OWL ontology using it. This issue is
that while I set a baseURI for the document, it isnt showing up when the
document is written using the XMLOutputer. The code is as follows:

      Namespace rdfsNs = Namespace.getNamespace("rdfs",
"http://www.w3.org/2000/01/rdf-schema#");             Element root = new
Element("RDF", rdfNs);
            :
          { add various namespaces to root }
            :
       Document doc = new Document(root);
       doc.setBaseURI("http://foo.bar/owlTest");

After building the document, I write it as follows:

       Format myFormat = Format.getPrettyFormat();
       XMLOutputter outputter = new XMLOutputter(myFormat);
       FileOutputStream fo =  new FileOutputStream(fileName);
       outputter.output(doc, fo);
       fo.flush();
       fo.close();

The  problem is that the xml base decalaration
xml:base="http://foo.bar/owlTest" must explicitly appear in the output
but doesnt. Any help would be greatly appreciated.
  Thanks
   Larry Levin
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com

 « Return to Thread: missing baseURI in output