From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Graham Hannington" Newsgroups: gmane.emacs.help Subject: Re: Using Emacs nXML mode to validate XHTML5 using the v.Nu schemas: support for HTTP-based schema URI? Date: Wed, 16 Mar 2016 16:45:49 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1458117996 27539 80.91.229.3 (16 Mar 2016 08:46:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Mar 2016 08:46:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 16 09:46:24 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ag75z-0007j9-H7 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Mar 2016 09:46:23 +0100 Original-Received: from localhost ([::1]:53922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag75y-0003yK-PC for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Mar 2016 04:46:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag75k-0003wI-Ll for help-gnu-emacs@gnu.org; Wed, 16 Mar 2016 04:46:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag75f-0001pX-V8 for help-gnu-emacs@gnu.org; Wed, 16 Mar 2016 04:46:08 -0400 Original-Received: from cluster-k.mailcontrol.com ([116.50.57.190]:34431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag75f-0001oe-Cf for help-gnu-emacs@gnu.org; Wed, 16 Mar 2016 04:46:03 -0400 Original-Received: from corax.fundi.priv (fundi.com.au [116.212.215.58] (may be forged)) by rly09k.srv.mailcontrol.com (MailControl) with ESMTP id u2G8jovc042623; Wed, 16 Mar 2016 08:45:50 GMT In-Reply-To: X-KeepSent: 2C03633E:EEE4B631-48257F78:002C578D; name=$KeepSent; type=4 X-Mailer: IBM Notes Release 9.0 March 08, 2013 X-Disclaimed: 3367 X-Scanned-By: MailControl 44278.1202 (www.mailcontrol.com) on 10.75.0.119 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 116.50.57.190 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109593 Archived-At: Hi Stefan, Re: > the naive approach... Good point. > It could also use a cache Yes, jEdit does this, but I can't see myself getting the time to (a) learn= =20 Lisp and (b) implement something similar for Emacs nXML, so I'm going to=20 drop this idea for now. Thanks for the patch anyway, that's very kind of you. Re: > I'd welcome some help to improve the html5-schema so that the HTML it=20 accepts includes SVG elements. Yes, I can help, but be prepared for some tedious detail. If you're prone= =20 to responding "tl;dr", look away now ;-). =46rom the description of the html5-schema package ( https://elpa.gnu.org/packages/html5-schema.html): > The RelaxNG files are taken straight from=20 https://github.com/validator/validator.git's via: > git subtree -P schema/html5 split The problem with that approach - taking files "straight" from the v.Nu=20 GitHub repo - is this: > Some schemas in the v.Nu GitHub repository - in particular, schemas that= =20 combine markup languages - refer to file paths that do not exist in the=20 repository. The paths exist only in the context of the distributed files=20 (inside vnu.jar). > These nonexistent paths prevent the schemas being usable directly from=20 the v.Nu repo (for example, via GitHub Pages URLs). For details, see the readme at (my) repo: https://github.com/unsoup/validator As described in that readme, I extracted the schemas from vnu.jar and=20 compared them with the schemas in the repo. Today, prompted by your email, I went two steps further: 1. I developed a Microsoft Windows PowerShell script (sorry, that's my=20 primary working environment) that completely automates a process that I=20 had previously done manually: a. Downloads the latest release of the vnu.jar .zip from GitHub b. Extracts vnu.jar from the .zip c. Copies the schema files from their single ("flat") directory in vnu.jar= =20 to a directory of your choice, re-creating the same relative directory=20 structure as the URI paths used by v.Nu. The result is a set of schema files that matches what v.Nu uses, with=20 relative include paths that work. 2. I uploaded the results of running that script to: https://github.com/unsoup/validator/tree/gh-pages/schema-release To improve the html5-schema package, replace its contents with the=20 contents of the unsoup/validator/schema-release directory (perhaps minus=20 the readme). That is: use the v.Nu schemas from vnu.jar, not from the GitHub repo. To "accept" SVG elements in an XHTML5 document, use the following schema=20 file: xhtml5_rdfalite.rnc which matches the Validator.nu "preset": XHTML + SVG 1.1 + MathML 3.0 + RDFa Lite 1.1 For details, see the readme at: https://github.com/unsoup/validator/tree/gh-pages/schema-release (I might add to that readme a table that matches Validator.nu presets to=20 schema file names.) Let me know how you get on. I plan to upload that PowerShell script in the next few days. In time, I might even schedule that script to run every so often, and=20 introduce further automated steps, to get the latest-release vnu.jar,=20 extract its schemas, and commit any changes to the copy in the=20 unsoup/validator/schema-release directory. Cheers, Graham Fundi Software Pty Ltd 2016 ABN 89 009 120 290 This message has been scanned for malware by Websense. www.websense.com