emacs-wiki-discuss
[Top][All Lists]
Advanced

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

[emacs-wiki-discuss] First pass RNC Schema for muse-xml.el


From: Brad Collins
Subject: [emacs-wiki-discuss] First pass RNC Schema for muse-xml.el
Date: Fri, 12 Aug 2005 19:53:10 +0700
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (windows-nt)

Hi folks/

Attatched is a first pass at writing a schema for muse-xml.

I used the Compact syntax of RelaxNG.  RNC has a lot of advantages
over other schemas.  It's far easier to read and write than the XML
syntax and it can easily be converted to DTD or XML Schema.

RNC is very easy to learn -- it took less than a day for me.

RNC is also the only supported type of schema supported by James
Clarke's nxml-mode which does inline validation.  Install nxml-mode.
Run  M-x muse-publish-this-file on a muse buffer.  Then open
the the XML file that is created in nxml-mode.  Type C-c C-s and you
will be prompted for the the schema file.  The schema will load and
validate or try to validate the file.  Anything underlined in red is
broken.  As you debug and fix the file, use C-c C-a to reload the
schema. 

I have kept the schema very loose for the first draft.  If everyone is
happy with the approach I took then I can go back and tighten up the
values for the type and level attributes.

I also recommend doing a quick Google for rnc-mode which is very small
bur provides night font-locking for RNC files.

A few Bugs.

  - The hard ruler element is printed as <hd> when it should be <hd />.

  - There doesn't seem to be any way of dealing with enumerated lists.

A few suggestions:

  - The verse element should have a child element for each line.  

        <verse>
          <line>line of crud</line>
          <line>line of crud</line>
        </verse>

  - The root element page should be upper case PAGE, or changed to
    something like MUSE, this is a common convention for the root
    element in a markup language.

  - do tables need to wrap each <tr> in a <tbody>?  

    <table>
      <tbody><tr><td>stuff</td></td></tbody>
      <tbody><tr><td>stuff</td></td></tbody>
      <tbody><tr><td>stuff</td></td></tbody>
    </table>

   I have written the schema to describe the above, but wouldn't it be
   better like this:

    <table>
      <tr><td>stuff</td></td>
      <tr><td>stuff</td></td>
      <tr><td>stuff</td></td>
    </table>

I already have papers assigned, so there shouldn't be any problem
including it with muse.

I'll be happy to maintain the the muse schema/s on a regular basis.
They will have to be updated every time the muse-xml is tweaked.

Please have a look and play around with the schema and let me know
what you want added or changed.

Personally, I will use muse-xml via xml.el or xml-parse.el (which I
prefer) to convert the file into a list which is easily manipulated in
elisp.  I've never been much of a fan of XSLT (also from James
Clarke).

Cheers,

b/

Attachment: muse.rnc
Description: muse.rnc

-- 
Brad Collins <address@hidden>, Bangkok, Thailand


reply via email to

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