Re: how to edit multi-part files?

Sam Steingold <[email protected]>
Newsgroups gmane.emacs.nxml.general
Message-ID <[email protected]>
On Fri, Nov 5, 2010 at 3:46 AM, Dave Pawson <[email protected]> wrote:
> On 4 November 2010 18:57, Sam Steingold <[email protected]> wrote:
> > I have a large document which is split into several parts which are
> > included into the master file using system entities.
> > editing the sub-files using nxml mode is a nightmare: all the entities
> > defined in a separate file and included in the master file are not
> > recognized and the constant unsuccessful revalidation makes editing very
> > slow.
> > So, how do I tell nxml that the XML file I am editing is actually
> > included in the master file and thus should be validated as its part?
> > Thanks!
>
> Your schema needs a start element matching the root element of the part.

this helps avoid the "vacuous schema" problem, but emacs still treats
the file as a stand alone document which is wrong.

let me be more specific.
here are 3 files which validate with xmllint and are converted with
xsltproc perfectly:
=== master.xml ===
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC ... [
  <!ENTITY % entities-file SYSTEM "ent.xml">
  %entities-file;
  <!ENTITY body-file SYSTEM "body.xml">
]>
<book id="top"><title>Title</title>
<para>&foo;</para>
&body-file;
</book>
=== /master.xml ===

=== ent.xml ===
<?xml version="1.0" encoding="UTF-8"?>
<!ENTITY foo "bar">
=== /ent.xml ===

=== body.xml ===
<?xml version="1.0" encoding="UTF-8"?>
<part id="...">...
&foo;
</part>
=== /body.xml ===

problems with emacs:
1. "!ENTITY" in ent.xml is red and the file is "invalid"
2. &foo; in body.xml is red and the file is "invalid"

note that &foo; in master.xml is greenish (i.e. OK) and the file would
have been valid if it did not contain the <xi:include> elements (which
is, BTW, another bug).

--
Sam Steingold <http://sds.podval.org>


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.