From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Henrik Motakef Newsgroups: gmane.emacs.help Subject: Re: Why won't PSGML use http system identifiers? Date: 29 Oct 2002 21:03:06 +0100 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <87smyp8139.fsf@pokey.henrik-motakef.de> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035921107 17846 80.91.224.249 (29 Oct 2002 19:51:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2002 19:51:47 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 186cOv-0004dZ-00 for ; Tue, 29 Oct 2002 20:51:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 186cOy-0000Sb-00; Tue, 29 Oct 2002 14:51:48 -0500 Original-Followup-To: comp.emacs Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 53 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-NNTP-Posting-Host: 213.23.45.106 Original-X-Trace: 29 Oct 2002 20:48:44 +0100, 213.23.45.106 Original-X-Complaints-To: abuse@arcor-ip.de Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!newsfeed.arcor-ip.de!news.arcor-ip.de!213.23.45.106 Original-Xref: shelby.stanford.edu comp.emacs:75503 gnu.emacs.help:106523 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3073 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3073 "D. D. Brierton" 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 . 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