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

Genshi and nxml-mode

Expand Messages
  • Lennart Borgman (gmail)
    Can Genshi be supported by nxml-mode? Have someone already written support for it? Genshi adds an additional name space like this:
    Message 1 of 4 , Feb 6 11:26 PM
    • 0 Attachment
      Can Genshi be supported by nxml-mode? Have someone already written
      support for it?

      Genshi adds an additional name space like this:

      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      lang="en">
      ...
      </html>
    • Dave Pawson
      ... Not needed. Add what ever namespaces you want to your schemas. nxml-mode is an editing mode, no more. regards -- Dave Pawson XSLT XSL-FO FAQ.
      Message 2 of 4 , Feb 7 12:13 AM
      • 0 Attachment
        On 07/02/2008, Lennart Borgman (gmail) <lennart.borgman@...> wrote:
        > Can Genshi be supported by nxml-mode? Have someone already written
        > support for it?
        >
        > Genshi adds an additional name space like this:
        >
        > <html xmlns="http://www.w3.org/1999/xhtml"
        > xmlns:py="http://genshi.edgewall.org/"
        > lang="en">
        > ...
        > </html>


        Not needed.
        Add what ever namespaces you want to your schemas.
        nxml-mode is an editing mode, no more.

        regards



        --
        Dave Pawson
        XSLT XSL-FO FAQ.
        http://www.dpawson.co.uk
      • Florent Georges
        Lennart Borgman (gmail) wrote: Hi ... It depends what you mean by support and by adding namespace . If you just need an extra namespace declaration,
        Message 3 of 4 , Feb 7 10:54 AM
        • 0 Attachment
          "Lennart Borgman (gmail)" wrote:

          Hi

          > Can Genshi be supported by nxml-mode? Have someone already
          > written support for it?

          > Genshi adds an additional name space like this:

          > <html xmlns="http://www.w3.org/1999/xhtml"
          > xmlns:py="http://genshi.edgewall.org/"
          > lang="en">
          > ...
          > </html>

          It depends what you mean by 'support' and by 'adding namespace'. If
          you just need an extra namespace declaration, well, that's out of the
          box ;-). If you want nXML to validate elements in that namespace, then
          you have to provide the appropriate schema. That is, Genshi + HTML.

          From the Genshi user guide, excerpt of the ToC of "Genshi XML
          Template Language":

          Conditional Sections
          Looping
          Snippet Reuse
          Variable Binding
          Structure Manipulation

          That sounds very like reinventing XSLT. And having a schema for such
          a templating language and its 'hosted' language (in your case HTML)
          sound pretty hard. Elements of the hosted language can appear
          everywhere in the template language, and are not required to have a
          valid content regarding their original schema.

          IMHO, not feasible unless either hard schema writing or nXML
          modifications. But should be an excellent exercise, in either case ;-)

          Regards,

          --drkm

























          _____________________________________________________________________________
          Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr
        • Klotz, Leigh
          Lennart, Here s my opinion: Integrating with the XHTML RNG schema so you could validate XHTML+Genshi documents would be difficult for two reasons, one a bit
          Message 4 of 4 , Feb 7 4:02 PM
          • 0 Attachment
            Lennart,

            Here's my opinion: Integrating with the XHTML RNG schema so you could
            validate XHTML+Genshi documents would be difficult for two reasons, one
            a bit of work and the other (I think) impossible.

            1. It would need to add py:if, py:for, etc. to the content model of HTML
            elements, since they can appear anywhere.

            2. It would be harder still to validate the intent of the template. For
            example, with
            foo={'src': 'foo.jpg', 'alt': 'Foo' }
            in the template context
            <xhtml:img py:attrs="foo" />
            will produce
            <xhtml:img src='foo.jpg' alt='Foo' />
            when the template is run, but the RNG validator has no way to know that;
            and in fact it might not even be true that the template context contains
            those values.

            Leigh.


            -----Original Message-----
            From: emacs-nxml-mode@yahoogroups.com
            [mailto:emacs-nxml-mode@yahoogroups.com] On Behalf Of Lennart Borgman
            (gmail)
            Sent: Wednesday, February 06, 2008 11:27 PM
            To: emacs-nxml-mode@yahoogroups.com
            Subject: [emacs-nxml-mode] Genshi and nxml-mode

            Can Genshi be supported by nxml-mode? Have someone already written
            support for it?

            Genshi adds an additional name space like this:

            <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:py="http://genshi.edgewall.org/"
            lang="en">
            ...
            </html>
          Your message has been successfully submitted and would be delivered to recipients shortly.