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

A few questions

Expand Messages
  • stephen_langer
    Hi-- I ve just started using nxml-mode for docbook, switching over from psgml. I have three questions: 1. Why does nxml mark tags like this
    Message 1 of 5 , Oct 14, 2009
    • 0 Attachment
      Hi--

      I've just started using nxml-mode for docbook, switching over from psgml. I have three questions:

      1. Why does nxml mark tags like this <chapter id="chapter:intro"> as illegal? If I remove the ':' in the id it's ok. I didn't see anything in the docbook manual about not having colons in ids, but maybe I missed it. Can I tell nxml-mode that colons are ok? I'd rather not remove them all, as there are probably several thousand in the existing document.

      2. Is there an nxml-mode equivalent of psgml's sgml-parent-document setting? I have several entities defined in a parent document which are then flagged as invalid by nxml when editing a chapter which is included in the parent.

      3. I've followed the instructions for setting up nxml-mode at http://infohost.nmt.edu/tcc/help/pubs/nxml/config.html, but still when I open an existing *.xml file, it's opened in xml mode, not nxml mode (although emacs does report that it's using the correct schema). If I open a new xml file, it opens in nxml. What could be causing this? It doesn't seem to depend on whether or not the file has "-*- xml-mode -*-" in the first line.

      I'm using emacs22-carbon from fink on OS X 10.5.8.

      Thanks.
      -- Steve
    • Florent Georges
      stephen_langer wrote: Hi, ... An ID must be an NCName. ... I don t know, sorry, maybe someone else. As nXML is now part of GNU Emacs, you can ask over there
      Message 2 of 5 , Oct 15, 2009
      • 0 Attachment
        stephen_langer wrote:

        Hi,

        > 1. Why does nxml mark tags like this <chapter
        > id="chapter:intro"> as illegal? If I remove the ':' in the id
        > it's ok.

        An ID must be an NCName.

        > 2. Is there an nxml-mode equivalent of psgml's
        > sgml-parent-document setting? I have several entities defined
        > in a parent document which are then flagged as invalid by nxml
        > when editing a chapter which is included in the parent.

        I don't know, sorry, maybe someone else. As nXML is now part
        of GNU Emacs, you can ask over there too...

        > 3. I've followed the instructions for setting up nxml-mode
        > at http://infohost.nmt.edu/tcc/help/pubs/nxml/config.html,
        > but still when I open an existing *.xml file, it's opened in
        > xml mode, not nxml mode (although emacs does report that
        > it's using the correct schema). If I open a new xml
        > file, it opens in nxml. What could be causing
        > this? It doesn't seem to depend on whether or not the
        > file has "-*- xml-mode -*-" in the first line.

        What's within your magic-mode-alist variable?

        Regards,

        --
        Florent Georges
        http://www.fgeorges.org/
      • Stephen Langer
        ... I see. I guess I ll have to change them all. ... It s only in emacs 23, isn t it? I m using 22.3.1. I ll see if I can install 23 before asking that list.
        Message 3 of 5 , Oct 15, 2009
        • 0 Attachment
          On Oct 15, 2009, at 9:06 AM, Florent Georges wrote:

          >>
          >> 1. Why does nxml mark tags like this <chapter
          >> id="chapter:intro"> as illegal? If I remove the ':' in the id
          >> it's ok.
          >
          > An ID must be an NCName.

          I see. I guess I'll have to change them all.
          >
          >> 2. Is there an nxml-mode equivalent of psgml's
          >> sgml-parent-document setting? I have several entities defined
          >> in a parent document which are then flagged as invalid by nxml
          >> when editing a chapter which is included in the parent.
          >
          > I don't know, sorry, maybe someone else. As nXML is now part
          > of GNU Emacs, you can ask over there too...

          It's only in emacs 23, isn't it? I'm using 22.3.1. I'll see if I can
          install 23 before asking that list.

          >
          >> 3. I've followed the instructions for setting up nxml-mode
          >> at http://infohost.nmt.edu/tcc/help/pubs/nxml/config.html,
          >> but still when I open an existing *.xml file, it's opened in
          >> xml mode, not nxml mode (although emacs does report that
          >> it's using the correct schema). If I open a new xml
          >> file, it opens in nxml. What could be causing
          >> this? It doesn't seem to depend on whether or not the
          >> file has "-*- xml-mode -*-" in the first line.
          >
          > What's within your magic-mode-alist variable?

          I think I have auto-mode-alist instead of magic-mode-alist. I don't
          know much about elisp. How do I print the value? My .emacs file
          contains this:

          (setq auto-mode-alist
          (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
          auto-mode-alist))

          Thanks again,
          Steve



          --
          -- stephen.langer@... Tel: (301) 975-5423 --
          -- http://math.nist.gov/mcsd/Staff/SLanger/ Fax: (301) 975-3553 --
          -- NIST, 100 Bureau Drive, Stop 8910, Gaithersburg, Md 20899-8910 --

          -- "I don't think this will work. That's why it's science." --
          -- Naomi Langer (age 6), 17 Feb 2003 --
        • Florent Georges
          ... Yes, but if such a mechanism exists in 23, there is a chance it was in nXML before its inclusion in Emacs ;-) ... They are two distinct variables.
          Message 4 of 5 , Oct 15, 2009
          • 0 Attachment
            Stephen Langer wrote:

            > It's only in emacs 23, isn't it?  I'm using 22.3.1.  I'll see
            > if I can install 23 before asking that list.

            Yes, but if such a mechanism exists in 23, there is a chance it was in nXML before its inclusion in Emacs ;-)

            > >  What's within your magic-mode-alist variable?

            > I think I have auto-mode-alist instead of magic-mode-alist.

            They are two distinct variables. auto-mode-alist is used to choose the mode from the file name, while magic-mode-alist is used to choose the mode from the file content (in case of XML, this is interesting if the file starts with <?xml...)

            > I don't know much about elisp.  How do I print the value?

            "C-h v magic-mode-alist RET" will print the variable documentation alongside its value on your Emacs at that time.

            Regards,

            --
            Florent Georges
            http://www.fgeorges.org/
          • Stephen Langer
            ... magic-mode-alist is nil. I ve found the problem, and of course it had nothing to do with auto- mode-alist or magic-mode-alist. The file contained local
            Message 5 of 5 , Oct 15, 2009
            • 0 Attachment
              On Oct 15, 2009, at 12:15 PM, Florent Georges wrote:

              >>>
              >>> What's within your magic-mode-alist variable?
              >
              >> I think I have auto-mode-alist instead of magic-mode-alist.
              >
              > They are two distinct variables. auto-mode-alist is used to choose
              > the mode from the file name, while magic-mode-alist is used to
              > choose the mode from the file content (in case of XML, this is
              > interesting if the file starts with <?xml...)
              >
              >> I don't know much about elisp. How do I print the value?
              >
              > "C-h v magic-mode-alist RET" will print the variable documentation
              > alongside its value on your Emacs at that time.


              magic-mode-alist is nil.

              I've found the problem, and of course it had nothing to do with auto-
              mode-alist or magic-mode-alist. The file contained local variable
              values for psgml and the mode was being set in that section. It's
              been a long time since I edited these files...

              Thanks for your help.

              -- Steve

              --
              -- stephen.langer@... Tel: (301) 975-5423 --
              -- http://math.nist.gov/mcsd/Staff/SLanger/ Fax: (301) 975-3553 --
              -- NIST, 100 Bureau Drive, Stop 8910, Gaithersburg, Md 20899-8910 --

              -- "I don't think this will work. That's why it's science." --
              -- Naomi Langer (age 6), 17 Feb 2003 --
            Your message has been successfully submitted and would be delivered to recipients shortly.