Re: how to edit multi-part files?
George Cristian Bina <[email protected]>
| Newsgroups | gmane.emacs.nxml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Sam, The problem is general with XML and many XML related technologies (XSLT, Relax NG, XML Schema, DTDs, etc.): you can have modules that are invalid by themselves but valid if they are used from a master file. A possible solution is to specify the main document that the validation needs to start from - we implemented this idea in oXygen XML Editor through validation scenarios where you can specify exactly what validation actions should be perform for a file. It will be great if a standard or at least recommended mechanism will exist for allowing to specify the main file(s) for a module. Another idea that we are experimenting with at the moment is to define an XML project that will allow to automatically analyze the source files and detect the dependencies between them and thus detect the master files for a module. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 11/5/10 3:22 PM, Sam Steingold wrote: > > > On Fri, Nov 5, 2010 at 3:46 AM, Dave Pawson <[email protected] > <mailto:dave.pawson%40gmail.com>> wrote: > > On 4 November 2010 18:57, Sam Steingold <[email protected] > <mailto:sds%40gnu.org>> 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/