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

Supporting multiple-namespace files

Expand Messages
  • Alan Shutko
    I m trying to use nxml to edit Spring configuration files. Spring configs originally had a DTD which was easy to translate to RNC and use with nxml. However,
    Message 1 of 13 , Aug 15, 2007
    • 0 Attachment
      I'm trying to use nxml to edit Spring configuration files. Spring
      configs originally had a DTD which was easy to translate to RNC and
      use with nxml. However, with the latest release they've switched to a
      new style which uses multiple XML Schema definitions, and allows you
      to choose which you are using in a given document.

      Their website has detailed documentation[1] of this, but I'll
      summarize here. Given an example

      <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:util="http://www.springframework.org/schema/util"
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
      http://www.springframework.org/schema/util
      http://www.springframework.org/schema/util/spring-util-2.0.xsd">

      <bean id="..." class="...">
      <property name="isolation">
      <bean id="java.sql.Connection.TRANSACTION_SERIALIZABLE"
      class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean" />
      </property>
      </bean>

      the base schema is http://www.springframework.org/schema/beans, but it
      also brings in another namespace (util) and tags within that
      namespace. It also brings in the xsi namespace and schema so it can
      have the schemaLocation attribute.

      I have no difficulties using trang and rngconv on any of the XSDs
      independently, but I'm at a loss how to get completion and validation
      to work in the presence of multiple namespaces. (As well, how to
      block the xsi:schemaLocation from being flagged as invalid.)

      Ideally, I'd like nxml to be able to load each of the schemas (after I
      convert them to rnc and put them in schemas.xml, naturally) and bind
      them to the namespaces in the document. I'm willing to put in some
      elisp development on this, if someone can point me to a general area
      of code to start browsing.

      Any ideas?

      Footnotes:
      [1] http://static.springframework.org/spring/docs/2.0.x/reference/xsd-config.html#xsd-config-body

      --
      Alan Shutko <ats@...> - I am the rocks.
      Experience is directly proportional to equipment ruined.
    • Florent Georges
      Alan Shutko wrote: Hi ... You should create one new single schema that includes all the others. That way all the definitions will be available. That was
      Message 2 of 13 , Aug 16, 2007
      • 0 Attachment
        Alan Shutko wrote:

        Hi

        > However, with the latest release they've switched to a
        > new style which uses multiple XML Schema definitions,
        > and allows you to choose which you are using in a given
        > document.

        You should create one new single schema that includes all the others.
        That way all the definitions will be available. That was discussed on
        the list if I remember correctly.

        Of course, if you find a better way, don't forget us ;-)

        Regards,

        --drkm






















        _____________________________________________________________________________
        Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
      • Alan Shutko
        ... I m willing to do that, if someone can tell me how to do that and there s absolutely no better way. However, that approach have some big deficiencies: *
        Message 3 of 13 , Aug 16, 2007
        • 0 Attachment
          Florent Georges <darkman_spam@...> writes:

          > You should create one new single schema that includes all the others.
          > That way all the definitions will be available. That was discussed on
          > the list if I remember correctly.

          I'm willing to do that, if someone can tell me how to do that and
          there's absolutely no better way.

          However, that approach have some big deficiencies:

          * XML namespaces allow you to pick the name of the namespace on a
          per-document bases. Predefining a schema for nxml does not allow me
          to operate on documents written by other people who have chosen
          different namespaces.

          * This solution means that I need to create a global schema for all
          potential options. That's an additional burden that each nxml user
          would need to do, and it would need to be updated each time that set
          of options changed.

          * Since we would have a combined schema with all options, nxml would
          mark documents as valid even if they contained items which were not
          listed in the namespace declarations above. This diminishes the
          value of nxml's validation checking, because it would be possible to
          write documents which would not validate by XML Schema-based tools
          (or by the applications and libraries for which these documents are
          intended).

          * This method of defining the full set of schemas for a given document
          by combining separately written schemas is becoming more popular.
          It is the foundation for MathML and SVG support in XHTML, for
          instance. Spring is using it, so I expect the technique to increase
          in the Java space. I believe nxml will be more useful to more
          people if we can find a way to support this.

          I realize it won't be trivial to do it, and I'm volunteering to work
          on the development if someone can help familiarize me with the
          existing code. I think there's a way we can leverage the excellent
          RNC support we have already, if we can have nxml compose the schemas
          at runtime instead of requiring the user to do it manually.




          > Of course, if you find a better way, don't forget us ;-)
          > Regards,
          > --drkm
          > ____________
          >
          > _________
          >
          > _________
          >
          > _________
          >
          > _________
          >
          > _________
          >
          > _
          > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
          >
          >
          > [[ Messages in this topic ]] (0) [[ Reply (via web post) ]] | [[ Start a new
          > topic ]]
          >
          > [[Messages]] | [[Files]] | [[Photos]] | [[Links]] | [[Database]] | [[Polls]] |
          > [[Members]] | [[Calendar]]
          >
          > [[ Yahoo! Groups]]
          > [[Change settings via the Web]] (Yahoo! ID required)
          > Change settings via email: [[Switch delivery to Daily Digest]] | [[Switch
          > format to Traditional]]
          > [[ Visit Your Group ]] | [[ Yahoo! Groups Terms of Use ]] | [[ Unsubscribe ]]
          > Recent
          > Activity
          > o
          > 1
          > [[New
          > Members]]
          > [[ Visit Your Group ]]
          > SPONSORED
          > LINKS
          > o [[
          > Xml development]]
          > o [[Xml format]]
          > o [[James clark]]
          > Yahoo!
          > Finance
          > [[It's Now Personal]]
          >
          > Guides, news,
          >
          > advice & more.
          > HDTV
          > Support
          > [[The official Samsung]]
          >
          > Y! Group for HDTVs
          >
          > and devices.
          > Yoga
          > Groups
          > [[Exchange insights]]
          >
          > with members of
          >
          > the yoga community.
          >
          > .
          > *

          --
          Alan Shutko <ats@...> - I am the rocks.
          Even when you're running the world, you can't get off.
        • Dave Pawson
          ... *If* the various schemas have different namespaces, you could desptach to a validator for each schema? NVDL. http://www.dpawson.co.uk/nvdl/index.html is a
          Message 4 of 13 , Aug 16, 2007
          • 0 Attachment
            On 16/08/07, Alan Shutko <ats@...> wrote:
            > Florent Georges <darkman_spam@...> writes:
            >
            > > You should create one new single schema that includes all the others.
            > > That way all the definitions will be available. That was discussed on
            > > the list if I remember correctly.
            >
            > I'm willing to do that, if someone can tell me how to do that and
            > there's absolutely no better way.
            >
            > However, that approach have some big deficiencies:

            *If* the various schemas have different namespaces, you could
            desptach to a validator for each schema?

            NVDL.
            http://www.dpawson.co.uk/nvdl/index.html
            is a small intro.

            HTH



            --
            Dave Pawson
            XSLT XSL-FO FAQ.
            http://www.dpawson.co.uk
          • Florent Georges
            Dave Pawson wrote: Hi Dave ... That would be a nice solution. Unfortunately, nXML doesn t support NVDL :-(. Regards, --drkm
            Message 5 of 13 , Aug 17, 2007
            • 0 Attachment
              Dave Pawson wrote:

              Hi Dave

              > *If* the various schemas have different namespaces, you could
              > desptach to a validator for each schema?

              > NVDL.
              > http://www.dpawson.co.uk/nvdl/index.html
              > is a small intro.

              That would be a nice solution. Unfortunately, nXML doesn't support
              NVDL :-(.

              Regards,

              --drkm























              _____________________________________________________________________________
              Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
            • Florent Georges
              Alan Shutko wrote: Hi ... The point is that a set of schemas is not enough. You need to tell *how* they can be combined. This is the aim of NVDL for
              Message 6 of 13 , Aug 17, 2007
              • 0 Attachment
                Alan Shutko wrote:

                Hi

                > However, that approach have some big deficiencies:

                > * XML namespaces allow you to pick the name of the
                > namespace on a per-document bases. Predefining a schema
                > for nxml does not allow me to operate on documents
                > written by other people who have chosen different
                > namespaces.

                The point is that a set of schemas is not enough. You
                need to tell *how* they can be combined. This is the aim of
                NVDL for instance. As NVDL is not supported by nXML, the
                only solution I know is to write a different schema per
                schemas combination you will use (it is possible to do that
                in a more clever way, to have only one schema, even if it
                will accept a few things it shouldn't).

                Regards,

                --drkm





















                _____________________________________________________________________________
                Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
              • Dave Pawson
                ... Sorry, I was thinking validation, rather than editing. Thoughts. oXygen supports XML editing. It also has a built in NVDL implementation. No help with
                Message 7 of 13 , Aug 17, 2007
                • 0 Attachment
                  On 17/08/07, Florent Georges <darkman_spam@...> wrote:

                  > That would be a nice solution. Unfortunately, nXML doesn't support
                  > NVDL :-(.

                  Sorry, I was thinking validation, rather than editing.

                  Thoughts.

                  oXygen supports XML editing.
                  It also has a built in NVDL implementation.

                  No help with editing, but you could validate in situ?

                  regards



                  --
                  Dave Pawson
                  XSLT XSL-FO FAQ.
                  http://www.dpawson.co.uk
                • Florent Georges
                  ... Maybe having a single schema for editing, result of merging all the Spring schemas, besides a couple of functions to manually call JNVDL or oNVDL as
                  Message 8 of 13 , Aug 17, 2007
                  • 0 Attachment
                    Dave Pawson wrote:

                    > No help with editing, but you could validate in situ?

                    Maybe having a single schema for editing, result of merging all the
                    Spring schemas, besides a couple of functions to manually call JNVDL or
                    oNVDL as external processes to actually validate the documents at some
                    points would be the most easy to implement and powerful yet?

                    Regards,

                    --drkm




















                    _____________________________________________________________________________
                    Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
                  • Dave Pawson
                    ... I like the idea. Can the windows / mac versions of emacs call out to an external process? regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk
                    Message 9 of 13 , Aug 17, 2007
                    • 0 Attachment
                      On 17/08/07, Florent Georges <darkman_spam@...> wrote:
                      > Dave Pawson wrote:
                      >
                      > > No help with editing, but you could validate in situ?
                      >
                      > Maybe having a single schema for editing, result of merging all the
                      > Spring schemas, besides a couple of functions to manually call JNVDL or
                      > oNVDL as external processes to actually validate the documents at some
                      > points would be the most easy to implement and powerful yet?



                      I like the idea. Can the windows / mac versions of emacs call out to
                      an external process?


                      regards



                      --
                      Dave Pawson
                      XSLT XSL-FO FAQ.
                      http://www.dpawson.co.uk
                    • Florent Georges
                      ... Oooh yes ;-) You have even a quite complete platform-independent API: (info (elisp)Processes ) Regards, --drkm
                      Message 10 of 13 , Aug 17, 2007
                      • 0 Attachment
                        Dave Pawson wrote:

                        > Can the windows / mac versions of emacs call out to an
                        > external process?

                        Oooh yes ;-) You have even a quite complete platform-independent
                        API:

                        (info "(elisp)Processes")

                        Regards,

                        --drkm






















                        _____________________________________________________________________________
                        Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
                      • Alan Shutko
                        ... I think with XML Schema, that s not necessary. Spring uses the type support of XML Schema such that schemas that want to be integrated can derive new
                        Message 11 of 13 , Aug 17, 2007
                        • 0 Attachment
                          Florent Georges <darkman_spam@...> writes:

                          > The point is that a set of schemas is not enough. You
                          > need to tell *how* they can be combined.

                          I think with XML Schema, that's not necessary. Spring uses the type
                          support of XML Schema such that schemas that want to be integrated
                          can derive new elements from those types. Unfortunately, that
                          information is lost in the translation to Relax NG, so with rng or if
                          you want to support multiple schema in different languages, you do
                          want NVDL.

                          I could implement support for NVDL... seems like a lot of work, but
                          might be worth it. Or, I could just implement support for XML Schema
                          (which is a necessary precurser to NVDL, isn't it?) and let nxml
                          autoswitch. It's already got rng support split out very nicely, so
                          it's easy to plug in another validator. Just not easy to write said
                          validator....

                          --
                          Alan Shutko <ats@...> - I am the rocks.
                          Ever put a Slinky on an escalator?
                        • Alan Shutko
                          ... That s definitely an easy way to start! And, it wouldn t just have to call an NVDL validator, it could call any validator. -- Alan Shutko -
                          Message 12 of 13 , Aug 17, 2007
                          • 0 Attachment
                            Florent Georges <darkman_spam@...> writes:

                            > Maybe having a single schema for editing, result of merging all the
                            > Spring schemas, besides a couple of functions to manually call JNVDL or
                            > oNVDL as external processes to actually validate the documents at some
                            > points would be the most easy to implement and powerful yet?

                            That's definitely an easy way to start! And, it wouldn't just have to
                            call an NVDL validator, it could call any validator.

                            --
                            Alan Shutko <ats@...> - I am the rocks.
                          • Tony Graham
                            ... flymake-mode? Regards, Tony Graham. ====================================================================== Tony.Graham@MenteithConsulting.com
                            Message 13 of 13 , Aug 20, 2007
                            • 0 Attachment
                              On Fri, Aug 17 2007 16:07:03 +0100, dave.pawson@... wrote:
                              > On 17/08/07, Florent Georges <darkman_spam@...> wrote:
                              >> Dave Pawson wrote:
                              >>
                              >> > No help with editing, but you could validate in situ?
                              >>
                              >> Maybe having a single schema for editing, result of merging all the
                              >> Spring schemas, besides a couple of functions to manually call JNVDL or
                              >> oNVDL as external processes to actually validate the documents at some
                              >> points would be the most easy to implement and powerful yet?
                              >
                              > I like the idea. Can the windows / mac versions of emacs call out to
                              > an external process?

                              flymake-mode?

                              Regards,


                              Tony Graham.
                              ======================================================================
                              Tony.Graham@... http://www.menteithconsulting.com

                              Menteith Consulting Ltd Registered in Ireland - No. 428599
                              Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
                              ----------------------------------------------------------------------
                              Menteith Consulting -- Understanding how markup works
                              ======================================================================
                            Your message has been successfully submitted and would be delivered to recipients shortly.