discuss: XML setup HOWTO??


Previous by date: 29 Jun 2002 21:39:39 -0000 Re: , Charles Curley
Next by date: 29 Jun 2002 21:39:39 -0000 Re: XML setup HOWTO??, Charles Curley
Previous in thread: 29 Jun 2002 21:39:39 -0000 Re: XML setup HOWTO??, Tabatha Persad
Next in thread: 29 Jun 2002 21:39:39 -0000 Re: XML setup HOWTO??, Charles Curley

Subject: Re: XML setup HOWTO??
From: Charles Curley ####@####.####
Date: 29 Jun 2002 21:39:39 -0000
Message-Id: <20020629153841.I21070@trib.com>

On Sat, Jun 29, 2002 at 01:35:31PM -0400, Tabatha Persad wrote:
> On Saturday 29 June 2002 08:44, Charles Curley wrote:
> > I looked through http://www.jimweller.net/jim/dbxmlqs/ and my
> > catalog files again, and realized that I didn't have docbkx412.zip.
> > OK, you get that from OASIS. Weller's link to it is broken. OK, I
> > found it again on the OASIS site. It's at the URL which is in the
> > header of the test file,
> > http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd.
> 
> > I have previously pulled that file in and tried to use it. It
> > didn't work even when I changed the test file's system identifier
> > to call out the docbookx.dtd directly instead of by URL.
> >
> > Furthermore, if jade is refusing to use the URL (see the compile
> > trace below), is jade broken?
> >
> > I'm reading Erik Ray's Learning XML, O'Reilly, 2001. On page 33, he
> > says that the system identifier (the URL in the prolog) "specifies
> > the location of the DTD". If the system identifier tells me where
> > the DTD is, why do I need a catalog at all?
> 
> As a matter of fact, O'Reilly's book on DocBook says that XML 
> requires a system identifier. 
> 
> So I asked myself, Self, why do you have a catalog identifying XML 
> 4.1.2 if it requires a system identifier?
> 
> Since the catalog can also contain PUBLIC and SYSTEM identifiers, as 
> well as CATALOGS pointing to other locations, I added the following 
> line:
> 
> SYSTEM "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
> 
> I forgot that I had done this, and the reason I had done it was the 
> same as you, openjade was not recognizing the doctype.  When I added 
> the system identfier URI to my main catalog file it seemed to work 
> fine after that.  I still left the line that points to the XML 4.1.2 
> catalog, but added the above to the end.  By default, Docbook should 
> be looking for SYSTEM identifiers first, unless you've used the 
> "OVERRIDE YES" in the catalog, which will cause it to look for PUBLIC 
> identifiers first even if the SYSTEM identifiers are there.
> 
> Try adding that line to your main catalog file and process your 
> test.xml again with openjade to see if it will work.  I'm hoping that 
> it will!

I've added that, and the thing now compiles and generates output. It
still produces a lot of errors. However, I do not have a line
analogous to:

CATALOG "/usr/local/sgml/docbook/4.1.2xml/catalog"

in my catalog, for the simple reason that I don't have an analogous
catalog.

This comes back to the question I asked earlier: where do I get the
4.1.2xml DTD? I went back to OASIS to see if I could find the DTD
again, and this time I found it, at
http://www.oasis-open.org/committees/docbook/xml/4.1.2/index.shtml.

I now have that unzipped at /usr/share/sgml/docbook/4.1.2xml, to be
consistent with the SGML DTDs.

The catalog is not named somethin obvious and useful, like
"catalog". It is named "docbook.cat." AAARRRGGGHHHHH!!!!!!!

So I added "CATALOG /usr/share/sgml/docbook/4.1.2xml/docbook.cat" to
my master catalog. I now get fewer errors.

In /etc/sgml I have a catalog for each of the SGML DTDs I have. So I
created one for the XML DTD, called xml-docbook-4.1.2.cat

My master catalog now looks like this:


CATALOG /etc/sgml/sgml-docbook-3.0.cat
CATALOG /etc/sgml/sgml-docbook-3.1.cat
CATALOG /etc/sgml/sgml-docbook-4.0.cat
CATALOG /etc/sgml/sgml-docbook-4.1.cat
CATALOG /etc/sgml/xml-docbook-4.1.2.cat
SYSTEM "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"


xml-docbook-4.1.2.cat looks like this:

CATALOG /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
CATALOG /usr/share/sgml/docbook/4.1.2xml/docbook.cat
CATALOG /usr/share/sgml/openjade-1.3/catalog
CATALOG /usr/share/sgml/docbook/dsssl-stylesheets-1.64/catalog

I now get a lot of errors. The first few look like this:

[ccurley@charlesc foo]$ openjade -t xml -d /usr/share/sgml/docbook/dsssl-stylesheets-1.64/ldp.dsl#html /usr/share/doc/openjade-1.3/pubtext/xml.dcl test.xml > foo.txt
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:test.xml:8:0:E: URL not supported by this version
openjade:test.xml:8:0:E: DTD did not contain element declaration for document type name
openjade:test.xml:14:5:E: element "book" undefined
openjade:test.xml:16:11:E: element "bookinfo" undefined
openjade:test.xml:17:10:E: element "title" undefined
openjade:test.xml:18:11:E: element "author" undefined
openjade:test.xml:19:16:E: element "firstname" undefined
openjade:test.xml:20:14:E: element "surname" undefined
openjade:test.xml:22:14:E: element "copyright" undefined
openjade:test.xml:22:20:E: element "year" undefined
openjade:test.xml:22:39:E: element "holder" undefined
openjade:test.xml:23:16:E: element "legalnotice" undefined
openjade:test.xml:24:11:E: element "para" undefined
openjade:test.xml:24:74:E: general entity "copy" not defined and no default entity
openjade:test.xml:24:74:E: general entity "reg" not defined and no default entity
openjade:test.xml:26:13:E: element "abstract" undefined
openjade:test.xml:27:11:E: element "para" undefined
openjade:test.xml:31:10:E: element "chapter" undefined
openjade:test.xml:32:10:E: element "title" undefined
openjade:test.xml:33:9:E: element "para" undefined
openjade:test.xml:38:12:E: element "section" undefined
openjade:test.xml:38:19:E: element "title" undefined
openjade:test.xml:38:59:E: element "para" undefined
openjade:test.xml:42:12:E: element "section" undefined
openjade:test.xml:42:19:E: element "title" undefined
openjade:test.xml:43:11:E: element "para" undefined
openjade:test.xml:48:11:E: element "appendix" undefined
openjade:test.xml:48:18:E: element "title" undefined
openjade:test.xml:49:9:E: element "para" undefined
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
openjade:/etc/sgml/catalog:6:66:E: literal expected
etc.

The first error and the rest of them point to the empty line right
after your "SYSTEM" line.

So what is in your "/usr/local/sgml/docbook/4.1.2xml/catalog"?

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://w3.trib.com/~ccurley     / \    No M$ Word docs in email

--> -->
 
 
<type 'exceptions.IOError'>
Python 2.5.2: /usr/bin/python
Wed Jul 3 16:54:32 2024

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /opt/ezmlm-browse-0.20/<string> in ()
 /opt/ezmlm-browse-0.20/main.py in main()
  424 
  425         if path is not None:
  426                 main_path(path)
  427         else:
  428                 main_form()
global main_form = <function main_form at 0x8800c6c>
 /opt/ezmlm-browse-0.20/main.py in main_form()
  378         except ImportError:
  379                 die(ctxt, "Invalid command")
  380         module.do(ctxt)
  381 
  382 def main():
module = <module 'commands.showmsg' from '/opt/ezmlm-browse-0.20/commands/showmsg.pyc'>, module.do = <function do at 0x881441c>, global ctxt = {'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}
 /opt/ezmlm-browse-0.20/commands/showmsg.py in do(ctxt={'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'})
   18         write(html('msg-pager') % ctxt)
   19         write('<hr>')
   20         sub_showmsg(ctxt, ctxt[MSGNUM])
   21         write('<hr>')
   22         write(html('msg-pager') % ctxt)
global sub_showmsg = <function sub_showmsg at 0x88001ec>, ctxt = {'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, global MSGNUM = 'msgnum'
 /opt/ezmlm-browse-0.20/globalfns.py in sub_showmsg(ctxt={'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, msgnum=3299)
  229         format_timestamp(ctxt, ctxt)
  230         write(html('msg-header') % ctxt)
  231         rec_showpart(ctxt, msg, 0)
  232         write(html('msg-footer') % ctxt)
  233         ctxt.pop()
global rec_showpart = <function rec_showpart at 0x88001b4>, ctxt = {'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, msg = <email.message.Message instance at 0x8873e2c>
 /opt/ezmlm-browse-0.20/globalfns.py in rec_showpart(ctxt={'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, part=<email.message.Message instance at 0x8873e2c>, partnum=1)
  205                 else:
  206                         for p in part.get_payload():
  207                                 partnum = rec_showpart(ctxt, p, partnum+1)
  208         else:
  209                 write(html('msg-sep') % ctxt)
partnum = 1, global rec_showpart = <function rec_showpart at 0x88001b4>, ctxt = {'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, p = <email.message.Message instance at 0x88780ec>
 /opt/ezmlm-browse-0.20/globalfns.py in rec_showpart(ctxt={'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, part=<email.message.Message instance at 0x88780ec>, partnum=2)
  208         else:
  209                 write(html('msg-sep') % ctxt)
  210                 sub_showpart(ctxt, part)
  211         return partnum
  212 
global sub_showpart = <function sub_showpart at 0x8800144>, ctxt = {'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, part = <email.message.Message instance at 0x88780ec>
 /opt/ezmlm-browse-0.20/globalfns.py in sub_showpart(ctxt={'cmd': 'showmsg', 'threadidx': 10, 'HTTP_X_FORW...HTTP_ACCEPT_ENCODING': 'gzip, br, zstd, deflate'}, part=<email.message.Message instance at 0x88780ec>)
  164         type = ctxt[TYPE] = part.get_content_type()
  165         ctxt[FILENAME] = part.get_filename()
  166         template = html('msg-' + type.replace('/', '-'))
  167         if not template:
  168                 template = html('msg-' + type[:type.find('/')])
global template = <function template at 0x87f8e9c>, global html = <function html at 0x87f8ed4>, type = 'application/pgp-signature', type.replace = <built-in method replace of str object at 0x8876988>
 /opt/ezmlm-browse-0.20/globalfns.py in html(name='msg-application-pgp-signature')
   40 
   41 def html(name):
   42         return template(name + '.html')
   43 
   44 def xml(name):
global template = <function template at 0x87f8e9c>, name = 'msg-application-pgp-signature'
 /opt/ezmlm-browse-0.20/globalfns.py in template(filename='msg-application-pgp-signature.html')
   31         except IOError:
   32                 if not _template_zipfile:
   33                         _template_zipfile = zipfile.ZipFile(sys.argv[0])
   34                 try:
   35                         f = _template_zipfile.open(n).read()
global _template_zipfile = None, global zipfile = <module 'zipfile' from '/usr/lib/python2.5/zipfile.pyc'>, zipfile.ZipFile = <class zipfile.ZipFile at 0x8791a7c>, global sys = <module 'sys' (built-in)>, sys.argv = ['-c', '/opt/ezmlm-browse-0.20']
 /usr/lib/python2.5/zipfile.py in __init__(self=<zipfile.ZipFile instance at 0x881234c>, file='-c', mode='r', compression=0, allowZip64=False)
  337             self.filename = file
  338             modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}
  339             self.fp = open(file, modeDict[mode])
  340         else:
  341             self._filePassed = 1
self = <zipfile.ZipFile instance at 0x881234c>, self.fp = None, builtin open = <built-in function open>, file = '-c', modeDict = {'a': 'r+b', 'r': 'rb', 'w': 'wb'}, mode = 'r'

<type 'exceptions.IOError'>: [Errno 2] No such file or directory: '-c'
      args = (2, 'No such file or directory')
      errno = 2
      filename = '-c'
      message = ''
      strerror = 'No such file or directory'