Re: dtd question

2010-08-03 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 15:02:59 -0700 (PDT) Randy Hudson wrote: > I think we're almost there, sorry for the various mistakes. > > If you look in the source for clojure.xml, you can see that the > default "startparse" argument for xml/parse is > > (defn startparse-sax [s ch] > (.. SAXPa

Re: dtd question

2010-08-01 Thread Randy Hudson
I think we're almost there, sorry for the various mistakes. If you look in the source for clojure.xml, you can see that the default "startparse" argument for xml/parse is (defn startparse-sax [s ch] (.. SAXParserFactory (newInstance) (newSAXParser) (parse s ch))) and we've only gotten as far a

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 10:04:16 -0700 (PDT) Randy Hudson wrote: > Right you are Michael; sorry for the missing paren at the end of the > def. > Now compiling the code works: (def parser (.newSAXParser (SAXParserFactory/newInstance))) (.setEntityResolver (.getXMLReader parser) resolver

Re: dtd question

2010-08-01 Thread Randy Hudson
Right you are Michael; sorry for the missing paren at the end of the def. On Aug 1, 11:59 am, Michael Wood wrote: > On 1 August 2010 17:15, Manfred Lotz wrote: > > > > > > > Hi Randy, > > > On Sun, 1 Aug 2010 06:23:58 -0700 (PDT) > > Randy Hudson wrote: > > >> Hi Manfred, > > >> I'm sorry the c

Re: dtd question

2010-08-01 Thread Michael Wood
On 1 August 2010 17:15, Manfred Lotz wrote: > Hi Randy, > > On Sun, 1 Aug 2010 06:23:58 -0700 (PDT) > Randy Hudson wrote: > >> Hi Manfred, >> >> I'm sorry the code wasn't quite correct. The EntityResolver is set on >> the parser's XMLReader, not on the parser itself: >> >> (def parser (.newSAXPar

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, On Sun, 1 Aug 2010 06:23:58 -0700 (PDT) Randy Hudson wrote: > Hi Manfred, > > I'm sorry the code wasn't quite correct. The EntityResolver is set on > the parser's XMLReader, not on the parser itself: > > (def parser (.newSAXParser (SAXParserFactory/newInstance)) > (.setEntityResolver

Re: dtd question

2010-08-01 Thread Randy Hudson
Hi Manfred, I'm sorry the code wasn't quite correct. The EntityResolver is set on the parser's XMLReader, not on the parser itself: (def parser (.newSAXParser (SAXParserFactory/newInstance)) (.setEntityResolver (.getXMLReader parser) resolver) You don't need any external jars: all the classes an

Re: dtd question

2010-08-01 Thread Manfred Lotz
Hi Randy, Thanks for your help. A bit late my answer because in the meantime I was on vacation and only now found the time to pursue it further. On Tue, 29 Jun 2010 18:53:30 -0700 (PDT) RandyHudson wrote: > Yes, you can do this by defining an EntityResolver that corrects the > bad system id, de

Re: dtd question

2010-06-29 Thread RandyHudson
Yes, you can do this by defining an EntityResolver that corrects the bad system id, define a SAXParser that uses that resolver, and pass the parser into the xml/parse call. Something like this: (import '[javax.xml.parsers SAXParserFactory] '[org.xml.sax EntityResolver InputSource]) (def resol

dtd question

2010-06-29 Thread Manfred Lotz
Hi there, I got a directory tree of xml documents all having the same dtd. However the dtd file is not where the DOCTYPE SYSTEM entry says it is. Currently, xml/parse throws an exception that the dtd file will not be found. Is there a possibility to tell xml/parse about a different location of th