Re: [bdbxml] XMLInputStreams and regular InputStreams and w3c DOM objects.
George Feinberg <[email protected]> Sun, 25 Sep 2005 18:50:45 -0400
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
> I see this as difficult because the class isn't really an InputStream > but more or less a handle on a C InputStream. I can read from the > stream > in java (C++ --> Java) when accessing the contents of the container > but > I'm not sure if I can have the XMLContainer read the inputstream from > Java (Java --> C++) without actually having to subclass the C++ > version > of XMLInputStream? > > >> XmlInputStream is a pure virtual interface. In C++, you can subclass >> XmlInputStream, and pass an instance of your class to any of the >> methods that take it as a parameter, such as >> XmlContainer.putDocument(com.sleepycat.dbxml.XmlDocument, >> com.sleepycat.dbxml.XmlUpdateContext). This is especially useful for >> streaming XML from an application directly into Berkeley DB XML >> without first converting it to a string. >> > > Does this mean I can Implement XMLInputStream in Java and use it > there, or I have to Implement it in C++ and instantiate it using a > JNI/SWIG the way that they are created using XMLManager? Mark, As of the 2.1.8, it is not possible to implement XmlInputStream in Java. There have been some issues getting the SWIG mechanisms involved working correctly. For now, the only way to make this work in Java is to write your own C++ subclass that uses JNI to delegate to your own Java instance. SWIG need not be involved -- it's just pure JNI. Regards, George ------------------------------------------ To remove yourself from this list, send an email to [email protected]