shane nuessler wrote:
Hi Kevin, Murry.

Thankyou very much for your help.

We are currently trying to store SMIL files for a project we are undertaking at the moment. The SMIL file has the DTD specified at the top to declare that SMIL version 2 is being used. But when we store and then retrieve the document, the comments of the DTD are included in the retrieved SMIL file, it really knocks RealOne player about! We just need the SMIL file out, the same as it went in.

We downloaded the CVS of Xindice (1.1b2) which I believe uses Xerces.

Murray Altheim from the Knowledge Media Institute suggested-
make a JAXP call:
  javax.xml.parsers.DocumentBuilderFactory.setIgnoringCommments(false);

Which we will try (Murry, i'm not sure which file though, since I've never programmed in Java!)
(I think it is xml-xindice/java/src/org/apache/xindice/xml/jaxp/DocumentBuilderImpl.java ?)

Well, I'm not entirely sure, but in the Xindice code there's only two places where you find DocumentBuilderFactory.newInstance(), which is where you create a new factory from which you get a new DocumentBuilder (which is the actual XML processor).

The first is in org/apache/xindice/client/xmldb/xmlrpc/CollectionImpl.java,
the second in org/apache/xindice/core/Database.java. Since it sounds like
it's your client that is having the problem, I'd suggest the former.
Where you see the line

   dbf.setNamespaceAware(true);

you'd add:

   dbf.setIgnoringComments(true);

and I *think* that should do the trick. If not, try Database.java. There's
no reason to keep the comments AFAIK. I think I figured this one out a
year or so ago when digging in the Xerces code to see what was happening;
I had the same problem as you.

The stupid approach I suggested previously would also work: remove all
the comments from the SMIL DTD and you solve this problem without having
to muck with Xindice code. But this is probably a problem that needs
solving anyway.

Murray

...........................................................................
Murray Altheim                         http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK                    .

   "Shhh. Be vewy, vewy quiet. We're hunting wabbits." -- Elmer Fudd

   "I don't know how close we are, closer than we were yesterday,
    I guess. All I know is we're on the hunt." -- George W. Bush
    BBC News: http://news.bbc.co.uk/1/hi/world/americas/3110615.stm



Reply via email to