unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Why won't PSGML use http system identifiers?
@ 2002-10-29 19:28 D. D. Brierton
  2002-10-29 20:03 ` Henrik Motakef
  2002-10-30  8:06 ` Arto V. Viitanen
  0 siblings, 2 replies; 5+ messages in thread
From: D. D. Brierton @ 2002-10-29 19:28 UTC (permalink / raw)


Is there some reason why PSGML has to have all the various DTDs, mod and ent
files on the local system, as opposed to downloading them via http when the
system identifier is a URL?

Basically, I'm trying to set up PSGML mode for XHTML 1.1 and frankly getting
hold of all the various modules is a complete nightmare, and I'm especially
concerned that it will prove hard to keep up-to-date. (BTW, does anyone know
if the W3C make available all their DTDs, etc. together with a suitable
catalog file available for downloadin a tarball or zip archive?

Best, Darren

-- 
======================================================================
D. D. Brierton            darren@dzr-web.com           www.dzr-web.com
       Trying is the first step towards failure (Homer Simpson)
======================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why won't PSGML use http system identifiers?
  2002-10-29 19:28 Why won't PSGML use http system identifiers? D. D. Brierton
@ 2002-10-29 20:03 ` Henrik Motakef
  2002-10-30  8:06 ` Arto V. Viitanen
  1 sibling, 0 replies; 5+ messages in thread
From: Henrik Motakef @ 2002-10-29 20:03 UTC (permalink / raw)


"D. D. Brierton" <darren@dzr-web.com> writes:

> Is there some reason why PSGML has to have all the various DTDs, mod and ent
> files on the local system, as opposed to downloading them via http when the
> system identifier is a URL?

Probably because there isn't a portable way to download something via
HTTP, AFAIK.

Here's a workaround I use. It depends on the Url lib from
<http://www.gnu.org/software/url/>. It is probably a quite stupid way
to do this, but it seems to work for me so far.

  (require 'url)
  
  (defun download-uri-to-string (uri)
    (let* ((buffer (url-retrieve-synchronously uri))
  	 (data (with-current-buffer buffer
  		 (goto-char (point-min))
  		 (forward-paragraph)
  		 (buffer-substring (point) (point-max)))))
        (kill-buffer buffer)
        data))
  
  (defun my-insert-sysid (sysid)
    (condition-case nil
        (progn (insert (download-uri-to-string sysid)) t)
      (error ; Couldn't download, maybe uri is relative?
       (let ((last-uri 
  	    (second (third (caar (sgml-entity-text sgml-current-eref))))))
         (condition-case nil
  	   (progn
  	     (insert
  	      (download-uri-to-string 
  	       (concat (file-name-directory last-uri) sysid)))
  	     t)
  	 (error nil))))))
  
  (add-to-list 'sgml-sysid-resolve-functions 'my-insert-sysid)

Would be nice if someone could look at it, and perhaps explain what
I'm doing, esp. in the `(second (third (caar ...' line. If have no
idea if there is some "official" API for the eref structure, or this
code will work with other PSGML versions.

> Basically, I'm trying to set up PSGML mode for XHTML 1.1 and frankly getting
> hold of all the various modules is a complete nightmare, and I'm especially
> concerned that it will prove hard to keep up-to-date. 

I wouldn't expect any major changes in XHTML 1.1 to come :-)

Regards
Henrik

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why won't PSGML use http system identifiers?
  2002-10-29 19:28 Why won't PSGML use http system identifiers? D. D. Brierton
  2002-10-29 20:03 ` Henrik Motakef
@ 2002-10-30  8:06 ` Arto V. Viitanen
  2002-10-30 10:13   ` Puff Addison
  1 sibling, 1 reply; 5+ messages in thread
From: Arto V. Viitanen @ 2002-10-30  8:06 UTC (permalink / raw)


>>>>> "D" == D D Brierton <darren@dzr-web.com> writes:

 D> Is there some reason why PSGML has to have all the various DTDs, mod and
 D> ent files on the local system, as opposed to downloading them via http
 D> when the system identifier is a URL?

 D> Basically, I'm trying to set up PSGML mode for XHTML 1.1 and frankly
 D> getting hold of all the various modules is a complete nightmare, and I'm
 D> especially concerned that it will prove hard to keep up-to-date. (BTW,
 D> does anyone know if the W3C make available all their DTDs, etc. together
 D> with a suitable catalog file available for downloadin a tarball or zip
 D> archive?

Or better yet, why does not it use catalogs like xsltproc? With xsltproc you
can use URLs in XML, but the catalog says where the files are locally.


-- 
Arto V. Viitanen				                  av@cs.uta.fi
University of Tampere, Department of Computer and Information Sciences
Tampere, Finland				      http://www.cs.uta.fi/~av/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why won't PSGML use http system identifiers?
  2002-10-30  8:06 ` Arto V. Viitanen
@ 2002-10-30 10:13   ` Puff Addison
  2002-10-30 20:31     ` Henrik Motakef
  0 siblings, 1 reply; 5+ messages in thread
From: Puff Addison @ 2002-10-30 10:13 UTC (permalink / raw)


Arto V. Viitanen wrote:

>>>>>>"D" == D D Brierton <darren@dzr-web.com> writes:
>>>>>>            
>>>>>>
>
> D> Is there some reason why PSGML has to have all the various DTDs, mod and
> D> ent files on the local system, as opposed to downloading them via http
> D> when the system identifier is a URL?
>
> D> Basically, I'm trying to set up PSGML mode for XHTML 1.1 and frankly
> D> getting hold of all the various modules is a complete nightmare, and I'm
> D> especially concerned that it will prove hard to keep up-to-date. (BTW,
> D> does anyone know if the W3C make available all their DTDs, etc. together
> D> with a suitable catalog file available for downloadin a tarball or zip
> D> archive?
>
>Or better yet, why does not it use catalogs like xsltproc? With xsltproc you
>can use URLs in XML, but the catalog says where the files are locally.
>
>
>  
>
Surely it does? Check the documentation on "Enitity  Management". Works 
for me.

-- 
J. D. Addison
email puff@theaddisons.demon.co.uk 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why won't PSGML use http system identifiers?
  2002-10-30 10:13   ` Puff Addison
@ 2002-10-30 20:31     ` Henrik Motakef
  0 siblings, 0 replies; 5+ messages in thread
From: Henrik Motakef @ 2002-10-30 20:31 UTC (permalink / raw)


Puff Addison <puff@theaddisons.demon.co.uk> writes:

> >Or better yet, why does not it use catalogs like xsltproc? With xsltproc you
> >can use URLs in XML, but the catalog says where the files are locally.
> >
> Surely it does? Check the documentation on "Enitity
> Management". Works for me.

It doesn't support the XML catalog format proposed by (IIRC) OASIS,
like xsltproc does. However, xsltproc also understands the "old"
format, which also happens to be way more maintainable, so I fail to
see a reason to use the new style anyway...

Regards
Henrik

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-30 20:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-29 19:28 Why won't PSGML use http system identifiers? D. D. Brierton
2002-10-29 20:03 ` Henrik Motakef
2002-10-30  8:06 ` Arto V. Viitanen
2002-10-30 10:13   ` Puff Addison
2002-10-30 20:31     ` Henrik Motakef

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).