From marianomontone at gmail.com Tue May 4 13:15:36 2010 From: marianomontone at gmail.com (Mariano Montone) Date: Tue, 04 May 2010 10:15:36 -0300 Subject: [cxml-devel] DTD parsing Message-ID: <4BE01DF8.8010605@gmail.com> Hi, I write because I have a problem with DTD validation. I can not parse the DTD The DTD I want to use is this: http://www.w3.org/TR/html4/strict.dtd But this is what I get when evaluating: (cxml:parse-dtd-file "/home/marian/Escritorio/strict.dtd") Document not well-formed: Expected :> saw :NMTOKEN ["--"] Context: Line 82, column 7 in file://+/home/marian/Escritorio/strict.dtd [Condition of type CXML:WELL-FORMEDNESS-VIOLATION] Does anyone know what may be wrong? I'm using the git version of cxml on sbcl. Thanks! Mariano From david at lichteblau.com Tue May 4 14:51:42 2010 From: david at lichteblau.com (David Lichteblau) Date: Tue, 4 May 2010 16:51:42 +0200 Subject: [cxml-devel] DTD parsing In-Reply-To: <4BE01DF8.8010605@gmail.com> References: <4BE01DF8.8010605@gmail.com> Message-ID: <20100504145142.GA8753@radon> Hi, Quoting Mariano Montone (marianomontone at gmail.com): > I write because I have a problem with DTD validation. I can not > parse the DTD The DTD I want to use is this: > http://www.w3.org/TR/html4/strict.dtd I believe that can't work, because the DTD in question in an SGML DTD, not an XML DTD. If you really need the SGML DTD, then Closure HTML has a parser for those somewhere (in fact, its HTML parser is based on information extracted from the DTD). Otherwise though, I would recommend use of the XHTML DTD instead, which describes the same content model, just for XML. The XHTML DTD can definitely be parsed with cxml. d. From marianomontone at gmail.com Tue May 4 15:42:36 2010 From: marianomontone at gmail.com (Mariano Montone) Date: Tue, 04 May 2010 12:42:36 -0300 Subject: [cxml-devel] DTD parsing In-Reply-To: <4BE03F1F.3030109@gmail.com> References: <4BE01DF8.8010605@gmail.com> <20100504145142.GA8753@radon> <4BE03F1F.3030109@gmail.com> Message-ID: <4BE0406C.7020607@gmail.com> Mariano Montone escribi?: > David Lichteblau escribi?: > >> Hi, >> >> Quoting Mariano Montone (marianomontone at gmail.com): >> >> >>> I write because I have a problem with DTD validation. I can not >>> parse the DTD The DTD I want to use is this: >>> http://www.w3.org/TR/html4/strict.dtd >>> >>> >> I believe that can't work, because the DTD in question in an SGML DTD, >> not an XML DTD. >> >> If you really need the SGML DTD, then Closure HTML has a parser for >> those somewhere (in fact, its HTML parser is based on information >> extracted from the DTD). >> >> Otherwise though, I would recommend use of the XHTML DTD instead, which >> describes the same content model, just for XML. >> >> The XHTML DTD can definitely be parsed with cxml. >> >> >> d. >> >> > I can parse the DTD now, but I cannot parse my html output. What I want > to do is to write a bunch of tests that validate my html serialization. > > So this is what I'm doing: > > (let ((html (with-output-to-string (s) > (serialize-html (generate (gen-html)) > s > :mode :xml)))) > (cxml:parse html (cxml-xmls:make-xmls-builder))) > > The html variable is a string like the following: > > " 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> > qimt example

href='http://example.com/'>Link to example.com

href='http://example2.com/'>Link to example2.com

Dynamic code > generation

" > > I've already added the xhtml dtd to my catalog with: > > systemIdStartString="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > catalog="file:///home/marian/work/cluts2/qimt/test/xhtml1-strict.dtd"/> > > And it is being detected, but there's a problem when parsing it: > > WARNING: > deprecated SAX default method used by a handler that is not a > subclass of SAX:ABSTRACT-HANDLER or HAX:ABSTRACT-HANDLER > WARNING: ignoring catalog error: Document not well-formed: element expected > Context: > Line 27, column 9 in > file://+/home/marian/work/cluts2/qimt/test/xhtml1-strict.dtd > > What am I doing wrong now? > > Thanks again, > > Mariano > And this is the error I get (what I wrote above where the warnings): URI scheme :HTTP not supported [Condition of type CXML:XML-PARSE-ERROR] From david at lichteblau.com Tue May 4 15:50:31 2010 From: david at lichteblau.com (David Lichteblau) Date: Tue, 4 May 2010 17:50:31 +0200 Subject: [cxml-devel] DTD parsing In-Reply-To: <4BE0406C.7020607@gmail.com> References: <4BE01DF8.8010605@gmail.com> <20100504145142.GA8753@radon> <4BE03F1F.3030109@gmail.com> <4BE0406C.7020607@gmail.com> Message-ID: <20100504155031.GB8753@radon> Quoting Mariano Montone (marianomontone at gmail.com): > > > systemIdStartString="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > > catalog="file:///home/marian/work/cluts2/qimt/test/xhtml1-strict.dtd"/> > > > > And it is being detected, but there's a problem when parsing it: > > > > WARNING: > > deprecated SAX default method used by a handler that is not a > > subclass of SAX:ABSTRACT-HANDLER or HAX:ABSTRACT-HANDLER > > WARNING: ignoring catalog error: Document not well-formed: element expected > > Context: > > Line 27, column 9 in > > file://+/home/marian/work/cluts2/qimt/test/xhtml1-strict.dtd [...] > And this is the error I get (what I wrote above where the warnings): > > URI scheme :HTTP not supported > [Condition of type CXML:XML-PARSE-ERROR] Good question. Line 27 is where the DTD starts pulling in other files (xhtml-lat1.ent, in this case). Perhaps it is just that the catalog is not set up for those *.ent files, so the parser sees only the http:// system ID for them, and gives up? d. From marianomontone at gmail.com Tue May 4 15:52:00 2010 From: marianomontone at gmail.com (Mariano Montone) Date: Tue, 04 May 2010 12:52:00 -0300 Subject: [cxml-devel] DTD parsing In-Reply-To: <20100504155031.GB8753@radon> References: <4BE01DF8.8010605@gmail.com> <20100504145142.GA8753@radon> <4BE03F1F.3030109@gmail.com> <4BE0406C.7020607@gmail.com> <20100504155031.GB8753@radon> Message-ID: <4BE042A0.3070908@gmail.com> David Lichteblau escribi?: > Quoting Mariano Montone (marianomontone at gmail.com): > >>> >> systemIdStartString="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >>> catalog="file:///home/marian/work/cluts2/qimt/test/xhtml1-strict.dtd"/> >>> >>> And it is being detected, but there's a problem when parsing it: >>> >>> WARNING: >>> deprecated SAX default method used by a handler that is not a >>> subclass of SAX:ABSTRACT-HANDLER or HAX:ABSTRACT-HANDLER >>> WARNING: ignoring catalog error: Document not well-formed: element expected >>> Context: >>> Line 27, column 9 in >>> file://+/home/marian/work/cluts2/qimt/test/xhtml1-strict.dtd >>> > [...] > >> And this is the error I get (what I wrote above where the warnings): >> >> URI scheme :HTTP not supported >> [Condition of type CXML:XML-PARSE-ERROR] >> > > Good question. Line 27 is where the DTD starts pulling in other files > (xhtml-lat1.ent, in this case). > > Perhaps it is just that the catalog is not set up for those *.ent files, > so the parser sees only the http:// system ID for them, and gives up? > > > d. > Mmm..thanks. Having a look... From marianomontone at gmail.com Tue May 4 15:37:03 2010 From: marianomontone at gmail.com (Mariano Montone) Date: Tue, 04 May 2010 12:37:03 -0300 Subject: [cxml-devel] DTD parsing In-Reply-To: <20100504145142.GA8753@radon> References: <4BE01DF8.8010605@gmail.com> <20100504145142.GA8753@radon> Message-ID: <4BE03F1F.3030109@gmail.com> David Lichteblau escribi?: > Hi, > > Quoting Mariano Montone (marianomontone at gmail.com): > >> I write because I have a problem with DTD validation. I can not >> parse the DTD The DTD I want to use is this: >> http://www.w3.org/TR/html4/strict.dtd >> > > I believe that can't work, because the DTD in question in an SGML DTD, > not an XML DTD. > > If you really need the SGML DTD, then Closure HTML has a parser for > those somewhere (in fact, its HTML parser is based on information > extracted from the DTD). > > Otherwise though, I would recommend use of the XHTML DTD instead, which > describes the same content model, just for XML. > > The XHTML DTD can definitely be parsed with cxml. > > > d. > I can parse the DTD now, but I cannot parse my html output. What I want to do is to write a bunch of tests that validate my html serialization. So this is what I'm doing: (let ((html (with-output-to-string (s) (serialize-html (generate (gen-html)) s :mode :xml)))) (cxml:parse html (cxml-xmls:make-xmls-builder))) The html variable is a string like the following: " qimt example

Link to example.com

Link to example2.com

Dynamic code generation

  • Item 0
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • Item 6
  • Item 7
  • Item 8
  • Item 9
  • Item 10
  • Item 11
  • Item 12
  • Item 13
  • Item 14
" I've already added the xhtml dtd to my catalog with: And it is being detected, but there's a problem when parsing it: WARNING: deprecated SAX default method used by a handler that is not a subclass of SAX:ABSTRACT-HANDLER or HAX:ABSTRACT-HANDLER WARNING: ignoring catalog error: Document not well-formed: element expected Context: Line 27, column 9 in file://+/home/marian/work/cluts2/qimt/test/xhtml1-strict.dtd What am I doing wrong now? Thanks again, Mariano From lukas.giessmann at hotmail.de Sat May 22 15:31:41 2010 From: lukas.giessmann at hotmail.de (=?iso-8859-1?B?THVrYXMgR2ll321hbm4=?=) Date: Sat, 22 May 2010 17:31:41 +0200 Subject: [cxml-devel] installing cxml on sbcl 1.0.34.0.debian Message-ID: hi list, i have a problem with installing the latest cxml on sbcl 1.0.34.0.debian. after (asdf:operate 'asdf:load-op :cxml) i get the following message: --- Error while trying to load definition for system cxml from pathname /root/.sbcl/systems/cxml.asd: The value (MERGE-PATHNAMES "xml/" (MAKE-PATHNAME :NAME NIL :TYPE NIL :DEFAULTS *LOAD-TRUENAME*)) is not of type (OR (VECTOR CHARACTER) (VECTOR NIL) BASE-STRING PATHNAME FILE-STREAM). [Condition of type ASDF:LOAD-SYSTEM-DEFINITION-ERROR] --- has anyone an idea? best regards lukas _________________________________________________________________ http://redirect.gimas.net/?n=M1005xHM2 Entdecken Sie das mobile Einfach: Nutzen Sie Hotmail unterwegs! -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at lichteblau.com Sat May 22 18:05:57 2010 From: david at lichteblau.com (David Lichteblau) Date: Sat, 22 May 2010 20:05:57 +0200 Subject: [cxml-devel] installing cxml on sbcl 1.0.34.0.debian In-Reply-To: References: Message-ID: <20100522180556.GA27685@radon> Quoting Lukas Gie?mann (lukas.giessmann at hotmail.de): > i have a problem with installing the latest cxml on sbcl 1.0.34.0.debian. > after (asdf:operate 'asdf:load-op :cxml) > i get the following message: [...] > has anyone an idea? Does with happen with upstream (i.e., non-Debian) SBCL, too? d. From achambers.home at gmail.com Sat May 29 12:54:36 2010 From: achambers.home at gmail.com (Andy Chambers) Date: Sat, 29 May 2010 13:54:36 +0100 Subject: [cxml-devel] Building cxml with recent versions of asdf Message-ID: Hi All, Building cxml seems to fail with recent versions of asdf. I get the error message in the linked paste. http://paste.lisp.org/display/110920 The attached patch was the minimum change I could make to get the system to load. Cheers, Andy -- Andy Chambers -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-for-asdf2.patch Type: text/x-patch Size: 1852 bytes Desc: not available URL: From achambers.home at gmail.com Sat May 29 13:44:08 2010 From: achambers.home at gmail.com (Andy Chambers) Date: Sat, 29 May 2010 14:44:08 +0100 Subject: [cxml-devel] normalize-text-nodes! Message-ID: Hi, Using xuriella to perform the identity transform fails when there are empty elements (e.g. "") in the source document. I believe the problem is in normalize-text-nodes! which doesn't check to see if there are any children before trying to iterate over them. This seems to trigger an assertion error in sbcl. XURIELLA> (apply-stylesheet #p"/usr/src/discworld/xslt/identity.xsl" "abc") " abc" XURIELLA> (apply-stylesheet #p"/usr/src/discworld/xslt/identity.xsl" "") The value NIL is not of type VECTOR. [Condition of type TYPE-ERROR] Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [ABORT] Return to SLIME's top level. 2: [TERMINATE-THREAD] Terminate this thread (#) Backtrace: 0: (CXML-STP-IMPL::NORMALIZE-TEXT-NODES! #.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "root")) 1: ((SB-PCL::FAST-METHOD XPATH-PROTOCOL:CHILD-PIPE-USING-NAVIGATOR ((EQL :DEFAULT-NAVIGATOR) CXML-STP:ELEMENT)) ..) 2: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) #.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "root") #.(CXML-STP:ELEMENT #| :PARENT of type DOCUMENT |# :LOCAL-NAME "root")) 3: ((LAMBDA (XPATH:CONTEXT)) #) Simple fix is attached. Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: check-for-presence-of-kids.patch Type: text/x-patch Size: 727 bytes Desc: not available URL: