help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Emacs nXML mode to validate XHTML5 using the v.Nu schemas: sup


From: Graham Hannington
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

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 
Lisp and (b) implement something similar for Emacs nXML, so I'm going to 
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 
accepts includes SVG elements.

Yes, I can help, but be prepared for some tedious detail. If you're prone 
to responding "tl;dr", look away now ;-).

From the description of the html5-schema package (
https://elpa.gnu.org/packages/html5-schema.html):

> The RelaxNG files are taken straight from 
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 
GitHub repo - is this:

> Some schemas in the v.Nu GitHub repository - in particular, schemas that 
combine markup languages - refer to file paths that do not exist in the 
repository. The paths exist only in the context of the distributed files 
(inside vnu.jar).
> These nonexistent paths prevent the schemas being usable directly from 
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 
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 
primary working environment) that completely automates a process that I 
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 
to a directory of your choice, re-creating the same relative directory 
structure as the URI paths used by v.Nu.

The result is a set of schema files that matches what v.Nu uses, with 
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 
contents of the unsoup/validator/schema-release directory (perhaps minus 
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 
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 
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 
introduce further automated steps, to get the latest-release vnu.jar, 
extract its schemas, and commit any changes to the copy in the 
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]