|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
missing baseURI in outputHi:
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@... |
|
|
Re: missing baseURI in outputhi
i have got exactly the same problem. Have you found a solution yet? regards
|
|
|
Re: missing baseURI in outputok i found a workaround
where you add the namespaces to the root you can add the following line; root.setAttribute(new Attribute("base", "http://foo.bar/owlTest", Namespace.XML_NAMESPACE)); this does the job ... at least in my case regards
|
| Free embeddable forum powered by Nabble | Forum Help |