[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Storing DOM Document in the OzoneDB




Hi,

On Fre, 17 Okt 2036, you wrote:
> 1)
> I Tried to Store the Transient DOM created (using JAVA XML API
> DocumentbuilderFactory for creating a new Document)by using
> DOMParser.StroreDocument(Document doc, String docName).
> I got the following Exception :
> java.io.ioException :at com.sun.tree.XmlDocument  

In general it should be possible to store any transient DOM into the Ozone DB.
But you got an exception in Suns source code - can you send the whole stack
trace? Because the one line you have given is not that clear - maybe Suns
implementation is not Serializable - but then should get a NotSerializable
exception instead of IOException .... Anyway please send the whole stack trace!

> Is it not possible to store a new Document Object created using some other API
> then ozoneDb.util.DOMFactory
> the DOMFactory class in the org.ozoneDB.xml does not have the required
> classes. Is creating a New Document Object using ozone API not supported?
> How do you create one if you cant't use other API's to create a new Document?

Normally you use the DOM2DOM or SAX2DOM converter to store documents into Ozone.
This converter creates new OzoneXML objects inside Ozone via an API - but this
is not the normal procedure client applications use! Why do you need this API
for public? Do you want to create a Document in the Ozone server at runtime?

> 2)
> Can we Store a DTD in the OZONEDB and get the elements and attributes from it
> Just like XML. Let's say I have created a transient DOM XML using java XML API
> DocumentBuilderFactory ,how do I validate it against a predefined DTD  before
> storing it in the OZONEDB(without serializing it and writing it to a file and
> Storing it by using XercesDOMParser.)

No, the current implementation does not support explicitely storing of DTDs.
Because DTDs are not XML-aware you need a special DTD parser, like the Xerces
packages includes one, to parse a DTD. But Ozone does not support storing
objects of a type other then a Document node. The specification of DOM Level 1
does not define a large DTD API, so Ozone didn't take so much care about this
topic, because Ozone "only" implements DOM Level 1. With DOM Level 2 many
things regarding DTDs were introduced - so the new XML storage engine will
support these.

Hmm, did you thought about using XML Schema? Schema is XML-aware so you can
store these documents into Ozone without the need of any special addition to
the current implementation.

Regards,
Lars
-- 
___________________________________________________________________
Lars Martin                                 mailto:lars@smb-tec.com
SMB GmbH                                     http://www.smb-tec.com