Loading ...
Sorry, an error occurred while loading the content.

how to edit multi-part files?

Expand Messages
  • Sam Steingold
    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
    Message 1 of 12 , Nov 4, 2010
    • 0 Attachment
      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!
      --
      Sam Steingold (http://sds.podval.org/) on Ubuntu 10.04 (lucid)
      http://thereligionofpeace.com http://www.memritv.org http://dhimmi.com
      http://mideasttruth.com http://ffii.org http://www.PetitionOnline.com/tap12009/
      If at first you don't suck seed, try and suck another seed.
    • Dave Pawson
      ... Your schema needs a start element matching the root element of the part. HTH -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk
      Message 2 of 12 , Nov 5, 2010
      • 0 Attachment
        On 4 November 2010 18:57, Sam Steingold <sds@...> 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.


        HTH



        --
        Dave Pawson
        XSLT XSL-FO FAQ.
        Docbook FAQ.
        http://www.dpawson.co.uk
      • Sam Steingold
        ... 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
        Message 3 of 12 , Nov 5, 2010
        • 0 Attachment
          On Fri, Nov 5, 2010 at 3:46 AM, Dave Pawson <dave.pawson@...> wrote:
          > On 4 November 2010 18:57, Sam Steingold <sds@...> 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>
        • George Cristian Bina
          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
          Message 4 of 12 , Nov 5, 2010
          • 0 Attachment
            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 <dave.pawson@...
            > <mailto:dave.pawson%40gmail.com>> wrote:
            > > On 4 November 2010 18:57, Sam Steingold <sds@...
            > <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>
            >
            >
          • Dave Pawson
            ... http://www.lysator.liu.se/~lenst/about_psgml/psgml.html#Using%20a%20Split%20Document Lennart used to manage it, using an emacs specific var at the bottom
            Message 5 of 12 , Nov 5, 2010
            • 0 Attachment
              On 5 November 2010 14:00, George Cristian Bina <george@...> wrote:
              > 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.


              http://www.lysator.liu.se/~lenst/about_psgml/psgml.html#Using%20a%20Split%20Document

              Lennart used to manage it, using an emacs specific
              var at the bottom of the file?


              HTH

              --
              Dave Pawson
              XSLT XSL-FO FAQ.
              Docbook FAQ.
              http://www.dpawson.co.uk
            • Sam Steingold
              ... it does not look like sgml-parent-document is respected by nxml-mode. maybe it should be? PS. where is nxml development happening? cvs? emacs bzr? -- Sam
              Message 6 of 12 , Nov 5, 2010
              • 0 Attachment
                On Fri, Nov 5, 2010 at 10:15 AM, Dave Pawson <dave.pawson@...> wrote:
                >
                > http://www.lysator.liu.se/~lenst/about_psgml/psgml.html#Using%20a%20Split%20Document
                >
                > Lennart used to manage it, using an emacs specific
                > var at the bottom of the file?

                it does not look like sgml-parent-document is respected by nxml-mode.
                maybe it should be?

                PS. where is nxml development happening? cvs? emacs bzr?

                --
                Sam Steingold <http://sds.podval.org>
              • Dave Pawson
                ... nxml-mode hijacked by the html users may/may not be happening under emacs... somewhere. AFAIK nothing has been done with nxml-mode for xml since James
                Message 7 of 12 , Nov 5, 2010
                • 0 Attachment
                  On 5 November 2010 14:35, Sam Steingold <sds@...> wrote:
                  > On Fri, Nov 5, 2010 at 10:15 AM, Dave Pawson <dave.pawson@...> wrote:
                  >>
                  >> http://www.lysator.liu.se/~lenst/about_psgml/psgml.html#Using%20a%20Split%20Document
                  >>
                  >> Lennart used to manage it, using an emacs specific
                  >> var at the bottom of the file?
                  >
                  > it does not look like sgml-parent-document is respected by nxml-mode.
                  > maybe it should be?
                  >
                  > PS. where is nxml development happening? cvs? emacs bzr?

                  nxml-mode hijacked by the html users may/may not be happening
                  under emacs... somewhere.

                  AFAIK nothing has been done with nxml-mode for xml since James
                  posted it.

                  Perhaps a case for another google code project, or add it to
                  relax ng at google code?

                  regards



                  --
                  Dave Pawson
                  XSLT XSL-FO FAQ.
                  Docbook FAQ.
                  http://www.dpawson.co.uk
                • Steinar Bang
                  ... I thought it had been accepted into emacs?
                  Message 8 of 12 , Nov 5, 2010
                  • 0 Attachment
                    >>>>> Dave Pawson <dave.pawson@...>:

                    > AFAIK nothing has been done with nxml-mode for xml since James
                    > posted it.

                    I thought it had been accepted into emacs?
                  • Lennart Borgman
                    ... nxml-mode is now in the Emacs bzr repository. Any changes are happening there. If you want to contribute then please make the changes against this and post
                    Message 9 of 12 , Nov 5, 2010
                    • 0 Attachment
                      On Fri, Nov 5, 2010 at 3:43 PM, Dave Pawson <dave.pawson@...> wrote:
                      >
                      >
                      >
                      > On 5 November 2010 14:35, Sam Steingold <sds@...> wrote:
                      > > On Fri, Nov 5, 2010 at 10:15 AM, Dave Pawson <dave.pawson@...> wrote:
                      > >>
                      > >> http://www.lysator.liu.se/~lenst/about_psgml/psgml.html#Using%20a%20Split%20Document
                      > >>
                      > >> Lennart used to manage it, using an emacs specific
                      > >> var at the bottom of the file?
                      > >
                      > > it does not look like sgml-parent-document is respected by nxml-mode.
                      > > maybe it should be?
                      > >
                      > > PS. where is nxml development happening? cvs? emacs bzr?
                      >
                      > nxml-mode hijacked by the html users may/may not be happening
                      > under emacs... somewhere.
                      >
                      > AFAIK nothing has been done with nxml-mode for xml since James
                      > posted it.
                      >
                      > Perhaps a case for another google code project, or add it to
                      > relax ng at google code?


                      nxml-mode is now in the Emacs bzr repository. Any changes are
                      happening there. If you want to contribute then please make the
                      changes against this and post it to Emacs devel (or as an Emacs bug
                      report).
                    • Dave Pawson
                      ... And who is going to take an interest in it there? We re in an odd corner Steiner (world view?), I just can t see the emacs crew wanting to take on the
                      Message 10 of 12 , Nov 5, 2010
                      • 0 Attachment
                        On 5 November 2010 14:49, Steinar Bang <sb@...> wrote:
                        >>>>>> Dave Pawson <dave.pawson@...>:
                        >
                        >> AFAIK nothing has been done with nxml-mode for xml since James
                        >> posted it.
                        >
                        > I thought it had been accepted into emacs?
                        >

                        And who is going to take an interest in it there?
                        We're in an odd corner Steiner (world view?),
                        I just can't see the emacs crew wanting to take
                        on the work.

                        I may be wrong... again!

                        regards

                        --
                        Dave Pawson
                        XSLT XSL-FO FAQ.
                        Docbook FAQ.
                        http://www.dpawson.co.uk
                      • Dave Pawson
                        Now there s a voice from the past! How many years have you been lurking Lennart :-) Nice to hear from you again. ... regards -- Dave Pawson XSLT XSL-FO FAQ.
                        Message 11 of 12 , Nov 5, 2010
                        • 0 Attachment
                          Now there's a voice from the past!
                          How many years have you been lurking Lennart :-)
                          Nice to hear from you again.

                          On 5 November 2010 14:50, Lennart Borgman <lennart.borgman@...> wrote:

                          > nxml-mode is now in the Emacs bzr repository. Any changes are
                          > happening there. If you want to contribute then please make the
                          > changes against this and post it to Emacs devel (or as an Emacs bug
                          > report).


                          regards


                          --
                          Dave Pawson
                          XSLT XSL-FO FAQ.
                          Docbook FAQ.
                          http://www.dpawson.co.uk
                        • Lennart Borgman
                          ... There is surely interest in it, but lack of time and perhaps detailed knowledge. I think your support is very, very welcome. Maybe the best way to
                          Message 12 of 12 , Nov 5, 2010
                          • 0 Attachment
                            On Fri, Nov 5, 2010 at 3:51 PM, Dave Pawson <dave.pawson@...> wrote:
                            >
                            > > I thought it had been accepted into emacs?
                            > >
                            >
                            > And who is going to take an interest in it there?
                            > We're in an odd corner Steiner (world view?),
                            > I just can't see the emacs crew wanting to take
                            > on the work.
                            >
                            > I may be wrong... again!


                            There is surely interest in it, but lack of time and perhaps detailed
                            knowledge. I think your support is very, very welcome. Maybe the best
                            way to contribute is to send changes as Emacs bug reports (since I can
                            imagine you do not have time to read Emacs Devel mailing list).
                          Your message has been successfully submitted and would be delivered to recipients shortly.