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

Re: nxml-mode, docbook, xinclude

Expand Messages
  • wyuenho
    ... I ve rewritten the Xinclude grammar in nXhtml to conform to the official Xinclude XSD. If this is useful for you can you double check it and maybe add the
    Message 1 of 24 , Aug 6, 2009
    • 0 Attachment
      --- In emacs-nxml-mode@yahoogroups.com, Daniel Colascione <danc@...> wrote:
      >
      > On Monday 09 June 2008, rossburton42 wrote:
      > > I'm using nxml-mode to validate my Docbook and so on as I write, but
      > > I've hit a small annoyance. In my current document I'm using XInclude
      > > to bring in source code snippets but nxml is for obviously reasons
      > > marking <xi:include .../> as invalid. Is there a way to get nxml-mode
      > > to ignore certain namespaces or some other cunning way around this?
      > > If I could say that all http://www.w3.org/2001/XInclude namespaced
      > > nodes are valid anywhere (and then should be validated with another
      > > schema for bonus points) then that would be great.
      >
      > The only way to do that currently is to modify the Relax NG schema.
      >

      I've rewritten the Xinclude grammar in nXhtml to conform to the official Xinclude XSD. If this is useful for you can you double check it and maybe add the productions rules in Docbook's grammar?

      http://tech.groups.yahoo.com/group/emacs-nxml-mode/message/1941
    • Dave Pawson
      ... You should be using the docbook v5 schema. nxml-mode has that as valid. ... Already done by the docbook group at Oasis. regards -- Dave Pawson XSLT XSL-FO
      Message 2 of 24 , Aug 6, 2009
      • 0 Attachment
        2009/8/7 wyuenho <wyuenho@...>:
        > --- In emacs-nxml-mode@yahoogroups.com, Daniel Colascione <danc@...> wrote:
        >>
        >> On Monday 09 June 2008, rossburton42 wrote:
        >> > I'm using nxml-mode to validate my Docbook and so on as I write, but
        >> > I've hit a small annoyance.  In my current document I'm using XInclude
        >> > to bring in source code snippets but nxml is for obviously reasons
        >> > marking <xi:include .../> as invalid.

        You should be using the docbook v5 schema.
        nxml-mode has that as valid.



        > I've rewritten the Xinclude grammar in nXhtml to conform to the official Xinclude XSD.

        Already done by the docbook group at Oasis.


        regards


        --
        Dave Pawson
        XSLT XSL-FO FAQ.
        Docbook FAQ.
        http://www.dpawson.co.uk
      • Lennart Borgman
        ... But that is only included in Emacs 23, not the standalone nxml-mode that Emacs 22 users download.
        Message 3 of 24 , Aug 7, 2009
        • 0 Attachment
          On Fri, Aug 7, 2009 at 7:06 AM, Dave Pawson<dave.pawson@...> wrote:
          >
          >
          > 2009/8/7 wyuenho <wyuenho@...>:
          >
          >> --- In emacs-nxml-mode@yahoogroups.com, Daniel Colascione <danc@...>
          >> wrote:
          >>>
          >>> On Monday 09 June 2008, rossburton42 wrote:
          >>> > I'm using nxml-mode to validate my Docbook and so on as I write, but
          >>> > I've hit a small annoyance.  In my current document I'm using XInclude
          >>> > to bring in source code snippets but nxml is for obviously reasons
          >>> > marking <xi:include .../> as invalid.
          >
          > You should be using the docbook v5 schema.
          > nxml-mode has that as valid.

          But that is only included in Emacs 23, not the standalone nxml-mode
          that Emacs 22 users download.


          >> I've rewritten the Xinclude grammar in nXhtml to conform to the official
          >> Xinclude XSD.
          >
          > Already done by the docbook group at Oasis.
          >
          > regards
          >
          > --
          > Dave Pawson
          > XSLT XSL-FO FAQ.
          > Docbook FAQ.
          > http://www.dpawson.co.uk
          >
        • Dave Pawson
          ... The question was about docbook? I don t think even your nxml-mode includes that (nor should it?) docbook is available from sourceforge. With the schema for
          Message 4 of 24 , Aug 7, 2009
          • 0 Attachment
            2009/8/7 Lennart Borgman <lennart.borgman@...>:

            >> You should be using the docbook v5 schema.
            >> nxml-mode has that as valid.
            >
            > But that is only included in Emacs 23, not the standalone nxml-mode
            > that Emacs 22 users download.


            The question was about docbook?
            I don't think even your nxml-mode includes that (nor should it?)

            docbook is available from sourceforge. With the schema
            for v5, from which the rnc can be added to nxml-mode
            with no problem.


            HTH


            --
            Dave Pawson
            XSLT XSL-FO FAQ.
            Docbook FAQ.
            http://www.dpawson.co.uk
          • Lennart Borgman
            ... It is included in the nxml-mode that comes with Emacs 23.
            Message 5 of 24 , Aug 7, 2009
            • 0 Attachment
              On Fri, Aug 7, 2009 at 12:49 PM, Dave Pawson<dave.pawson@...> wrote:
              >
              >
              > 2009/8/7 Lennart Borgman <lennart.borgman@...>:
              >
              >>> You should be using the docbook v5 schema.
              >>> nxml-mode has that as valid.
              >>
              >> But that is only included in Emacs 23, not the standalone nxml-mode
              >> that Emacs 22 users download.
              >
              > The question was about docbook?
              > I don't think even your nxml-mode includes that (nor should it?)


              It is included in the nxml-mode that comes with Emacs 23.


              > docbook is available from sourceforge. With the schema
              > for v5, from which the rnc can be added to nxml-mode
              > with no problem.
              >
              > HTH
              >
              > --
              > Dave Pawson
              > XSLT XSL-FO FAQ.
              > Docbook FAQ.
              > http://www.dpawson.co.uk
              >
            • Dave Pawson
              ... Then either pick up both versions, 4.5 and 5.0 (and keep them up to date I guess) or link to where the schemas can be picked up. -- Dave Pawson XSLT XSL-FO
              Message 6 of 24 , Aug 7, 2009
              • 0 Attachment
                2009/8/7 Lennart Borgman <lennart.borgman@...>:

                >> The question was about docbook?
                >> I don't think even your nxml-mode includes that (nor should it?)
                >
                >
                > It is included in the nxml-mode that comes with Emacs 23.
                >
                >
                >> docbook is available from sourceforge. With the schema
                >> for v5, from which the rnc can be added to nxml-mode
                >> with no problem.

                Then either pick up both versions, 4.5 and 5.0 (and keep
                them up to date I guess) or link to where the schemas
                can be picked up.




                --
                Dave Pawson
                XSLT XSL-FO FAQ.
                Docbook FAQ.
                http://www.dpawson.co.uk
              • Lennart Borgman
                ... Could you please explain how we should handle this in Emacs? (I have added Emacs Devel to the discussion.)
                Message 7 of 24 , Aug 7, 2009
                • 0 Attachment
                  On Fri, Aug 7, 2009 at 1:26 PM, Dave Pawson<dave.pawson@...> wrote:

                  >> It is included in the nxml-mode that comes with Emacs 23.
                  >>
                  >>
                  >>> docbook is available from sourceforge. With the schema
                  >>> for v5, from which the rnc can be added to nxml-mode
                  >>> with no problem.
                  >
                  > Then either pick up both versions, 4.5 and 5.0 (and keep
                  > them up to date I guess) or link to where the schemas
                  > can be picked up.

                  Could you please explain how we should handle this in Emacs? (I have
                  added Emacs Devel to the discussion.)
                • Dave Pawson
                  ... Just my point. I don t think this should be an emacs issue If you want docbook schema, html or any other schema the end user should pick up that schema
                  Message 8 of 24 , Aug 7, 2009
                  • 0 Attachment
                    2009/8/7 Lennart Borgman <lennart.borgman@...>:
                    > On Fri, Aug 7, 2009 at 1:26 PM, Dave Pawson<dave.pawson@...> wrote:
                    >
                    >>> It is included in the nxml-mode that comes with Emacs 23.
                    >>>
                    >>>
                    >>>> docbook is available from sourceforge. With the schema
                    >>>> for v5, from which the rnc can be added to nxml-mode
                    >>>> with no problem.
                    >>
                    >> Then either pick up both versions, 4.5 and 5.0 (and keep
                    >> them up to date I guess) or link to where the schemas
                    >> can be picked up.
                    >
                    > Could you please explain how we should handle this in Emacs? (I have
                    > added Emacs Devel to the discussion.)

                    Just my point. I don't think this should be an emacs issue
                    If you want docbook schema, html or any other schema
                    the end user should pick up that schema from the source
                    of that schema.

                    Hence my earlier comments.

                    I stated, the docbook v5 schema includes xinclude within it.

                    which is what the OP wanted, or was missing



                    --
                    Dave Pawson
                    XSLT XSL-FO FAQ.
                    Docbook FAQ.
                    http://www.dpawson.co.uk
                  • Lennart Borgman
                    ... Thanks. I see. I really think they should be part of Emacs distribution (as they are now) and wondered whether you have some suggestion regarding Docbook
                    Message 9 of 24 , Aug 7, 2009
                    • 0 Attachment
                      On Fri, Aug 7, 2009 at 1:34 PM, Dave Pawson<dave.pawson@...> wrote:
                      > 2009/8/7 Lennart Borgman <lennart.borgman@...>:
                      >> On Fri, Aug 7, 2009 at 1:26 PM, Dave Pawson<dave.pawson@...> wrote:
                      >>
                      >>>> It is included in the nxml-mode that comes with Emacs 23.
                      >>>>
                      >>>>
                      >>>>> docbook is available from sourceforge. With the schema
                      >>>>> for v5, from which the rnc can be added to nxml-mode
                      >>>>> with no problem.
                      >>>
                      >>> Then either pick up both versions, 4.5 and 5.0 (and keep
                      >>> them up to date I guess) or link to where the schemas
                      >>> can be picked up.
                      >>
                      >> Could you please explain how we should handle this in Emacs? (I have
                      >> added Emacs Devel to the discussion.)
                      >
                      > Just my point. I don't think this should be an emacs issue
                      > If you want docbook schema, html or any other schema
                      > the end user should pick up that schema from the source
                      > of that schema.

                      Thanks. I see.

                      I really think they should be part of Emacs distribution (as they are
                      now) and wondered whether you have some suggestion regarding Docbook
                      4.5 and 5.0. There is now a schema for Docbook 4.2 in Emacs 22.

                      I know nothing about how to distinguish those in Emacs. How should the
                      schemas be named so that Emacs can pick the right version according to
                      the spec in the Docbook xml file?



                      > Hence my earlier comments.
                      >
                      > I stated, the docbook v5 schema includes xinclude within it.
                      >
                      > which is what the OP wanted, or was missing
                      >
                      >
                      >
                      > --
                      > Dave Pawson
                      > XSLT XSL-FO FAQ.
                      > Docbook FAQ.
                      > http://www.dpawson.co.uk
                      >
                    • Dave Pawson
                      ... 4.5 is the current Oasis standard. As I said, either keep up or simply tell people where docbook is. How many schemas are you going to try and manage?
                      Message 10 of 24 , Aug 7, 2009
                      • 0 Attachment
                        2009/8/7 Lennart Borgman <lennart.borgman@...>:

                        >>> Could you please explain how we should handle this in Emacs? (I have
                        >>> added Emacs Devel to the discussion.)
                        >>
                        >> Just my point. I don't think this should be an emacs issue
                        >> If you want docbook schema, html or any other schema
                        >> the end user should pick up that schema from the source
                        >> of that schema.
                        >
                        > Thanks. I see.
                        >
                        > I really think they should be part of Emacs distribution (as they are
                        > now) and wondered whether you have some suggestion regarding Docbook
                        > 4.5 and 5.0. There is now a schema for Docbook 4.2 in Emacs 22.

                        4.5 is the current Oasis standard.
                        As I said, either keep up or simply tell people where docbook is.
                        How many schemas are you going to try and manage?

                        Suggest, if you want to track docbook schemas, you point people
                        to the appropriate place, not fall n versions behind.




                        >
                        > I know nothing about how to distinguish those in Emacs.

                        Perhaps that's another good reason not to attempt to provide
                        docbook schemas for the emacs package you're delivering?

                        How should the
                        > schemas be named so that Emacs can pick the right version according to
                        > the spec in the Docbook xml file?

                        You need to see nxml-mode... the original.
                        James explained it there.




                        -
                        Dave Pawson
                        XSLT XSL-FO FAQ.
                        Docbook FAQ.
                        http://www.dpawson.co.uk
                      • Lennart Borgman
                        ... It is a very good point to show them where to get the newest version since Emacs and docbook schemas might not always be in sync. I think that should be in
                        Message 11 of 24 , Aug 7, 2009
                        • 0 Attachment
                          On Fri, Aug 7, 2009 at 1:51 PM, Dave Pawson<dave.pawson@...> wrote:
                          > 2009/8/7 Lennart Borgman <lennart.borgman@...>:
                          >
                          >>>> Could you please explain how we should handle this in Emacs? (I have
                          >>>> added Emacs Devel to the discussion.)
                          >>>
                          >>> Just my point. I don't think this should be an emacs issue
                          >>> If you want docbook schema, html or any other schema
                          >>> the end user should pick up that schema from the source
                          >>> of that schema.
                          >>
                          >> Thanks. I see.
                          >>
                          >> I really think they should be part of Emacs distribution (as they are
                          >> now) and wondered whether you have some suggestion regarding Docbook
                          >> 4.5 and 5.0. There is now a schema for Docbook 4.2 in Emacs 22.
                          >
                          > 4.5 is the current Oasis standard.
                          > As I said, either keep up or simply tell people where docbook is.
                          > How many schemas are you going to try and manage?
                          >
                          > Suggest, if you want to track docbook schemas, you point people
                          > to the appropriate place, not fall n versions behind.


                          It is a very good point to show them where to get the newest version
                          since Emacs and docbook schemas might not always be in sync. I think
                          that should be in the documentation for nxml-mode in Emacs.

                          But I think including schemas with Emacs is also very important. So I
                          would suggest checking this for every new Emacs release (to Emacs
                          Devel: Can we please put this in the to-do for new releases?).



                          >> I know nothing about how to distinguish those in Emacs.
                          >
                          > Perhaps that's another good reason not to attempt to provide
                          > docbook schemas for the emacs package you're delivering?
                          >
                          > How should the
                          >> schemas be named so that Emacs can pick the right version according to
                          >> the spec in the Docbook xml file?
                          >
                          > You need to see nxml-mode... the original.
                          > James explained it there.


                          Could you perhaps make a short summary? How do you yourself handle
                          this for example?
                        • Dave Pawson
                          ... http://www.dpawson.co.uk/relaxng/nxml/schemaloc.html#d574e168 Full explanation in the documentation provided with the original nxml-mode from JC -- Dave
                          Message 12 of 24 , Aug 7, 2009
                          • 0 Attachment
                            2009/8/7 Lennart Borgman <lennart.borgman@...>:

                            >
                            > Could you perhaps make a short summary? How do you yourself handle
                            > this for example?
                            >

                            http://www.dpawson.co.uk/relaxng/nxml/schemaloc.html#d574e168


                            Full explanation in the documentation provided with
                            the original nxml-mode from JC

                            --
                            Dave Pawson
                            XSLT XSL-FO FAQ.
                            Docbook FAQ.
                            http://www.dpawson.co.uk
                          • Lennart Borgman
                            ... Thanks. So a doctypePublicId could be used to distinguish different Docbook versions? On the OASIS site I see that they do not distinguish rng files for
                            Message 13 of 24 , Aug 7, 2009
                            • 0 Attachment
                              On Fri, Aug 7, 2009 at 2:17 PM, Dave Pawson<dave.pawson@...> wrote:
                              > 2009/8/7 Lennart Borgman <lennart.borgman@...>:
                              >
                              >>
                              >> Could you perhaps make a short summary? How do you yourself handle
                              >> this for example?
                              >>
                              >
                              > http://www.dpawson.co.uk/relaxng/nxml/schemaloc.html#d574e168


                              Thanks. So a doctypePublicId could be used to distinguish different
                              Docbook versions?

                              On the OASIS site I see that they do not distinguish rng files for
                              different Docbook versions by file name, but by file path/location. Is
                              that a convenient way in nxml-mode? Can you use for example

                              <typeId id="DocBook4.5" uri="docbook/dokbook4.5.rnc"/>



                              > Full explanation in the documentation provided with
                              > the original nxml-mode from JC
                              >
                              > --
                              > Dave Pawson
                              > XSLT XSL-FO FAQ.
                              > Docbook FAQ.
                              > http://www.dpawson.co.uk
                              >
                            • wyuenho
                              ... It seems that the xinclude grammar is directly merged into the docbook grammar. But xinclude is meant to be general purpose, how do people validate other
                              Message 14 of 24 , Aug 7, 2009
                              • 0 Attachment
                                --- In emacs-nxml-mode@yahoogroups.com, Dave Pawson <dave.pawson@...> wrote:
                                It seems that the xinclude grammar is directly merged into the docbook grammar. But xinclude is meant to be general purpose, how do people validate other xinclude documents if there's not a separate xinclude grammar that's easily extensible for other grammars?

                                >
                                > 2009/8/7 Lennart Borgman <lennart.borgman@...>:
                                >
                                > >> You should be using the docbook v5 schema.
                                > >> nxml-mode has that as valid.
                                > >
                                > > But that is only included in Emacs 23, not the standalone nxml-mode
                                > > that Emacs 22 users download.
                                >
                                >
                                > The question was about docbook?
                                > I don't think even your nxml-mode includes that (nor should it?)
                                >
                                > docbook is available from sourceforge. With the schema
                                > for v5, from which the rnc can be added to nxml-mode
                                > with no problem.
                                >
                                >
                                > HTH
                                >
                                >
                                > --
                                > Dave Pawson
                                > XSLT XSL-FO FAQ.
                                > Docbook FAQ.
                                > http://www.dpawson.co.uk
                                >
                              • Dave Pawson
                                ... It is. It is also an xml namespaced element like any other? Hence it needs to be declared in the schema for the instance you re generating using nxml-mode.
                                Message 15 of 24 , Aug 7, 2009
                                • 0 Attachment
                                  2009/8/7 wyuenho <wyuenho@...>:
                                  > --- In emacs-nxml-mode@yahoogroups.com, Dave Pawson <dave.pawson@...> wrote:
                                  > It seems that the xinclude grammar is directly merged into the docbook grammar. But xinclude is meant to be general purpose, how do people validate other xinclude documents if there's not a separate xinclude grammar that's easily extensible for other grammars?


                                  It is. It is also an xml namespaced element like any other?
                                  Hence it needs to be declared in the schema for the instance you're generating
                                  using nxml-mode.

                                  Take the model from docbookxi.rnc


                                  HTH



                                  --
                                  Dave Pawson
                                  XSLT XSL-FO FAQ.
                                  Docbook FAQ.
                                  http://www.dpawson.co.uk
                                • Steinar Bang
                                  ... As expressed in a DOCTYPE declaration of a document? Yes, it can. I ve used that a lot for legacy formats. You can also match on the document element
                                  Message 16 of 24 , Aug 23, 2009
                                  • 0 Attachment
                                    >>>>> Lennart Borgman <lennart.borgman@...>:

                                    > Thanks. So a doctypePublicId could be used to distinguish different
                                    > Docbook versions?

                                    As expressed in a DOCTYPE declaration of a document? Yes, it can.

                                    I've used that a lot for legacy formats.

                                    You can also match on the document element (i.e. the outermost element
                                    in an XML document), in two way:
                                    - local name, with an optional prefix
                                    - document element default namespace
                                    (but, curiously enough, not document element default name space and
                                    local name)

                                    And you can match on a processing instruction.

                                    And you can match on file URI, with wildcards (you can e.g. match on
                                    extensions).


                                    > On the OASIS site I see that they do not distinguish rng files for
                                    > different Docbook versions by file name, but by file path/location. Is
                                    > that a convenient way in nxml-mode? Can you use for example

                                    > <typeId id="DocBook4.5" uri="docbook/dokbook4.5.rnc"/>

                                    Without having actually tried it, I'm guessing yes. I have everything
                                    in a flat structure (how many schemas do one need? I have maven, and
                                    ant, and something called CPE, that I can no longer remember what is,
                                    and a custom version of docbook, all in a single directory, with a
                                    schemas.xml file), and no time to experiment.
                                  • Lennart Borgman
                                    Thanks Steinar, I will look at this more later.
                                    Message 17 of 24 , Aug 23, 2009
                                    • 0 Attachment
                                      Thanks Steinar, I will look at this more later.


                                      On Sun, Aug 23, 2009 at 8:21 PM, Steinar Bang<sb@...> wrote:
                                      >
                                      >
                                      >>>>>> Lennart Borgman <lennart.borgman@...>:
                                      >
                                      >> Thanks. So a doctypePublicId could be used to distinguish different
                                      >> Docbook versions?
                                      >
                                      > As expressed in a DOCTYPE declaration of a document? Yes, it can.
                                      >
                                      > I've used that a lot for legacy formats.
                                      >
                                      > You can also match on the document element (i.e. the outermost element
                                      > in an XML document), in two way:
                                      > - local name, with an optional prefix
                                      > - document element default namespace
                                      > (but, curiously enough, not document element default name space and
                                      > local name)
                                      >
                                      > And you can match on a processing instruction.
                                      >
                                      > And you can match on file URI, with wildcards (you can e.g. match on
                                      > extensions).
                                      >
                                      >> On the OASIS site I see that they do not distinguish rng files for
                                      >> different Docbook versions by file name, but by file path/location. Is
                                      >> that a convenient way in nxml-mode? Can you use for example
                                      >
                                      >> <typeId id="DocBook4.5" uri="docbook/dokbook4.5.rnc"/>
                                      >
                                      > Without having actually tried it, I'm guessing yes. I have everything
                                      > in a flat structure (how many schemas do one need? I have maven, and
                                      > ant, and something called CPE, that I can no longer remember what is,
                                      > and a custom version of docbook, all in a single directory, with a
                                      > schemas.xml file), and no time to experiment.
                                      >
                                      >
                                    • Dave Pawson
                                      ... This might be more appropriate on the docbook-apps mailing list? Certainly for the schema related questions. regards -- Dave Pawson XSLT XSL-FO FAQ.
                                      Message 18 of 24 , Aug 23, 2009
                                      • 0 Attachment
                                        2009/8/23 Lennart Borgman <lennart.borgman@...>:
                                        > Thanks Steinar, I will look at this more later.

                                        This might be more appropriate on the docbook-apps mailing list?
                                        Certainly for the schema related questions.

                                        regards


                                        --
                                        Dave Pawson
                                        XSLT XSL-FO FAQ.
                                        Docbook FAQ.
                                        http://www.dpawson.co.uk
                                      Your message has been successfully submitted and would be delivered to recipients shortly.