On 10/24/2008 10:41 PM, yf508 is rumored to have said:
> We're using Fedora 2.x/Muradora to build our digital library. I've got a
> problem while using fedora.utilities.FoxmlDocument. The addDataStream,
> addDataStreamVersion work correctly. However, when I tried to use
> addXmlContent method, I've got the following error message:
>
> java.lang.ClassCastException: org.apache.xerces.dom.DocumentImpl cannot be
> cast to org.apache.xerces.dom.DeferredDocumentImpl
FYI, I only created these classes recently to help with FOXML creation
for some of our unit tests, not for general use, so YMMV. There's
certainly no validation in place to ensure you are generating valid FOXML.
The following works for me:
@Test
public void testFoo() throws Exception {
String ds = "DS1";
String dsv = ds + ".0";
Date date = new Date();
Foxml11Document doc = new Foxml11Document("demo:foo");
doc.addDatastream(ds, State.A, ControlGroup.X, true);
doc.addDatastreamVersion(ds, dsv, "text/xml", "label", 1, date);
doc.addXmlContent(dsv, "<doc/>");
doc.serialize(System.out);
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fedora-commons-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers