[cxml-devel] Handling doctype declarations for system-ids?

Holger.Schauer at gmx.de Holger.Schauer at gmx.de
Mon Mar 20 00:30:22 UTC 2006


Hi,

I'm using cxml as of 2006-01-05 and encounter problems with documents
which refer to a local DTD. The important constraint here is that I'm
working on a system on which all catalogs are old-style SGML catalogs
and using XML catalogs is out. Before rolling my own entity resolver
or working out a general solution using cxml:make-extid, I simply
wanted to test SYSTEM ids. However, this doesn't work out as
expected. I get an error from xstream-open-extid, which seems to get
passed an absolute path instead of the relative path given in the
doctype declaration. I.e.,

<!DOCTYPE review SYSTEM "review.dtd" >

results in 

2: (XSTREAM-OPEN-EXTID 
    #S(EXTID :PUBLIC NIL :SYSTEM #<URI file://+/review.dtd>))
    Locals:
      SB-DEBUG::ARG-0 = 
    #S(EXTID :PUBLIC NIL :SYSTEM #<URI file://+/review.dt>)

which is afterwards translated to /review.dtd.

I did some fairly low-level digging through the code, and think that
the error is related to the following piece of code in p/doctype-decl:

      (when extid
        (let* ((effective-extid
                (extid-using-catalog (absolute-extid input extid)))

I don't understand why the effective-extid is computed based on an
absolute-extid -- I would have expected some test whether the path is
absolute or relative. However, maybe I misinterpret something, and the
comment below is related to the problem:

(defun absolute-uri (sysid source-stream)
  (let ((base-sysid (zstream-base-sysid source-stream)))
    ;; XXX is the IF correct?
    (if base-sysid
        (puri:merge-uris sysid base-sysid)
        sysid)))

I have an additional theory here: base-sysid is "file://+/", and
indeed inspecting source-stream shows that the URI associated with it
is indeed just

The object is a STRUCTURE-OBJECT of type STREAM-NAME.
 [type: STREAM-NAME]
--------------------
ENTITY-NAME: "main document"
ENTITY-KIND: :MAIN
URI: #<URI file://+>

This also doesn't seem to make to much sense to me either.

However, I'm just debugging cluelessly around, so ultimately, I'm just
asking for help. :-)

With kind regards,

 Holger

-- 
---          http://www.coling.uni-freiburg.de/~schauer/            ---
Fachbegriffe der Informatik - Einfach erklärt
19: voll konfigurierbar
       nicht vorinstalliert. (Peter Berlich)



More information about the cxml-devel mailing list