[om] OpenMath SigFile JAVA class problem
olga caprotti
olga at win.tue.nl
Fri May 12 18:08:11 CEST 2000
Hi -
I am trying to write a JAVA class that uses
DOM to read the XML Signature files and has
methods to return the OpenMath Objects that
represent the signatures. So far I get errors
like:
com.sun.xml.tree.DomEx: This node isn't allowed there.
at com.sun.xml.tree.DomEx.<init>(Compiled Code)
at com.sun.xml.tree.XmlDocument.checkChildType(Compiled Code)
at com.sun.xml.tree.ParentNode.appendChild(Compiled Code)
at com.sun.xml.tree.XmlDocument.appendChild(Compiled Code)
at
nl.tue.win.riaca.openmath.lang.SignatureFile.getXmlSigObject(Compiled
Code)
at
nl.tue.win.riaca.openmath.lang.SignatureFile.getSigObject(Compiled Code)
at nl.tue.win.riaca.openmath.lang.SignatureFile.main(Compiled
Code)
produced by the code:
public String getXmlSigObject(Node node){
String nodename = node.getNodeName();
String sigobj = null;
if ( nodename.equals("Signature") )
{
Node child = node.getFirstChild().cloneNode(true);
if ( child != null )
System.out.println("Child is" + child.getNodeName());
XmlDocument document = new XmlDocument();
// we try and fix the doctype until we know better
DocumentType doctype = document.setDoctype(null,
"http://www.riaca.win.tue.nl/~olga/openmath/dtd/omobj.dtd",null );
StringWriter writer = new StringWriter();
document.changeNodeOwner(child);
document.appendChild(child);
try{
document.write(writer);
sigobj=writer.toString();
}
catch (IOException e){
sigobj = null;
}
}
return sigobj;
}
Anyone has XML-DOM experience in JAVA?
Have you ever encountered this problem?
Thank you
olga
--
Olga Caprotti <olga at win.tue.nl>
URL http://www.win.tue.nl/~olga
Tech. Univ. Eindhoven, P.O.Box 513
5600MB Eindhoven (The Netherlands)
--
om at openmath.org - general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org
Mail om-owner at openmath.org for assistance with any problems
More information about the Om
mailing list