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

editing Ant files using nxml-mode?

Expand Messages
  • Jochen+emacs-nxml-mode@Hayek.name
    Would any body seriously do that kind of thing? Is there a RELAX NG (maybe compact?) file describing Ant files?
    Message 1 of 14 , Jun 19, 2007
    • 0 Attachment
      Would any body seriously do that kind of thing?
      Is there a RELAX NG (maybe compact?) file describing Ant files?
    • Dave Pawson
      On 19/06/07, Jochen+emacs-nxml-mode@hayek.name ... Yes, not regularly, but with lots of confidence. ... Unlikely. If nxml-mode doesn t find a schema, it simply
      Message 2 of 14 , Jun 19, 2007
      • 0 Attachment
        On 19/06/07, Jochen+emacs-nxml-mode@...
        <Jochen+emacs-nxml-mode@...> wrote:
        > Would any body seriously do that kind of thing?
        Yes, not regularly, but with lots of confidence.

        > Is there a RELAX NG (maybe compact?) file describing Ant files?

        Unlikely. If nxml-mode doesn't find a schema, it simply offers help
        with markup completion, checks for well formedness etc.

        Still helpful.

        Use the ant documentation for syntax, and nxm-mode for xml help.

        regards



        --
        Dave Pawson
        XSLT XSL-FO FAQ.
        http://www.dpawson.co.uk
      • Florent Georges
        Dave Pawson wrote: Hi ... I d say I would be surprised if there was no schema somewhere on the web. At least for the core tasks. And if there isn t any, that
        Message 3 of 14 , Jun 19, 2007
        • 0 Attachment
          Dave Pawson wrote:

          Hi

          > On 19/06/07, Jochen+emacs-nxml-mode@... wrote:

          > > Is there a RELAX NG (maybe compact?) file describing
          > > Ant files?

          > Unlikely.

          I'd say I would be surprised if there was no schema somewhere on the
          web. At least for the core tasks. And if there isn't any, that
          shouldn't be so hard to write one, I guess.

          Regards,

          --drkm























          ___________________________________________________________________________
          Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
          Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
          http://fr.answers.yahoo.com
        • Suraj Acharya
          ... There s no schema for ant files. But, the antstructure task can generated a specialized dtd based on all the custom tasks that it can see.
          Message 4 of 14 , Jun 19, 2007
          • 0 Attachment
            On 6/19/07, Dave Pawson <dave.pawson@...> wrote:
            > On 19/06/07, Jochen+emacs-nxml-mode@...
            > <Jochen+emacs-nxml-mode@...> wrote:
            > > Would any body seriously do that kind of thing?
            > Yes, not regularly, but with lots of confidence.

            There's no schema for ant files. But, the antstructure task can
            generated a specialized dtd based on all the custom tasks that it can
            see. http://ant.apache.org/manual/CoreTasks/antstructure.html

            You can then use trang (
            http://www.thaiopensource.com/relaxng/trang.html ) to convert the dtd
            into a rnc schema.

            I started with a large dtd from work which I suspect was originally
            generated from antconvert and am quite happy with the support nxml
            mode provides. It would be nicer still to be able to automatically
            find target and property definitions, especially when they reside
            outside the current file, but I can live without that for now.

            Suraj

            >
            > > Is there a RELAX NG (maybe compact?) file describing Ant files?
            >
            > Unlikely. If nxml-mode doesn't find a schema, it simply offers help
            > with markup completion, checks for well formedness etc.
            >
            > Still helpful.
            >
            > Use the ant documentation for syntax, and nxm-mode for xml help.
            >
            > regards
            >
            >
            >
            > --
            > Dave Pawson
            > XSLT XSL-FO FAQ.
            > http://www.dpawson.co.uk
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
          • Tony Graham
            On Tue, Jun 19 2007 18:23:27 +0100, Suraj Acharya wrote: ... I had a mode based on xslide that, among other things, implemented an imenu for locating the
            Message 5 of 14 , Jun 19, 2007
            • 0 Attachment
              On Tue, Jun 19 2007 18:23:27 +0100, Suraj Acharya wrote:
              ...
              > I started with a large dtd from work which I suspect was originally
              > generated from antconvert and am quite happy with the support nxml
              > mode provides. It would be nicer still to be able to automatically
              > find target and property definitions, especially when they reside
              > outside the current file, but I can live without that for now.

              I had a mode based on xslide that, among other things, implemented an
              imenu for locating the targets, macros, etc. in the current build
              file.

              That part of the mode could probably be extracted and turned into a
              minor mode or maybe just a command to put in a hook.

              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
              ======================================================================
            • dpom
              i, Here is my ant RNC made one year ago (I forget how I made it :). Is customized for my specific use but you can easily add more tasks (see local.tasks). The
              Message 6 of 14 , Jun 20, 2007
              • 0 Attachment
                Hi,

                Here is my ant RNC made one year ago (I forget how I made it :). Is
                customized for my specific use but you can easily add more tasks (see
                local.tasks). The main file is ant.rnc
              • Steinar Bang
                ... There s an ant tasks that can dump a DTD for all tasks that the ant file the task is called from, knows about:
                Message 7 of 14 , Jun 20, 2007
                • 0 Attachment
                  >>>>> Florent Georges <darkman_spam@...>:

                  > I'd say I would be surprised if there was no schema somewhere on the
                  > web. At least for the core tasks. And if there isn't any, that
                  > shouldn't be so hard to write one, I guess.

                  There's an ant tasks that can dump a DTD for all tasks that the ant
                  file the task is called from, knows about:
                  http://www.cenqua.com/fisheye/demo/browse/~raw,r=1.6/ant/docs/manual/CoreTasks/antstructure.html

                  The DTD can be given to trang to create a RNC schema that nxml can use.
                • J.Pietschmann
                  ... [snip] ... The DTD is not necessarily a valid one: there may be tasks defining elements with the same name but different content, and the DTD will simply
                  Message 8 of 14 , Jun 20, 2007
                  • 0 Attachment
                    Steinar Bang wrote:
                    > There's an ant tasks that can dump a DTD for all tasks that the ant
                    > file the task is called from, knows about
                    [snip]
                    > The DTD can be given to trang to create a RNC schema that nxml can use.

                    The DTD is not necessarily a valid one: there may be tasks defining
                    elements with the same name but different content, and the DTD will
                    simply contain the conflicting definitions.
                    Well, most of the time the DTD should be ok.

                    J.Pietschmann
                  • Steinar Bang
                    ... Yes, I found out last night. I had to doctor the generated DTD, remove a duplicate ELEMENT and add a missing attribute on another element. But it s a
                    Message 9 of 14 , Jun 21, 2007
                    • 0 Attachment
                      >>>>> "J.Pietschmann" <j3322ptm@...>:

                      > Steinar Bang wrote:
                      >> There's an ant tasks that can dump a DTD for all tasks that the ant
                      >> file the task is called from, knows about
                      > [snip]
                      >> The DTD can be given to trang to create a RNC schema that nxml can use.

                      > The DTD is not necessarily a valid one: there may be tasks defining
                      > elements with the same name but different content, and the DTD will
                      > simply contain the conflicting definitions.
                      > Well, most of the time the DTD should be ok.

                      Yes, I found out last night.

                      I had to doctor the generated DTD, remove a duplicate ELEMENT and add
                      a missing attribute on another element.

                      But it's a start.

                      RNC schema attached to this message is generated from the
                      slightly doctored DTD (Caveat emptor!).

                      I use the following line in schemas.xml to trigger it:
                      <documentElement localName="project" uri="antproject.rnc" />

                      I worried a bit if this would collide with the setting of the maven
                      schema (maven also has <project> as its top element), but using this
                      setting for maven triggers usage of the maven schema:
                      <namespace ns="http://maven.apache.org/POM/4.0.0" uri="maven-v4_0_0.rnc" />
                    • Florent Georges
                      Steinar Bang wrote: Hi ... I ve just gave it a quick try. Seems pretty good. I just found that the javac element doesn t accept the attributes
                      Message 10 of 14 , Jun 21, 2007
                      • 0 Attachment
                        Steinar Bang wrote:

                        Hi

                        > I had to doctor the generated DTD, remove a duplicate
                        > ELEMENT and add a missing attribute on another element.

                        > But it's a start.

                        I've just gave it a quick try. Seems pretty good.

                        I just found that the javac element doesn't accept the
                        attributes memoryInitialSize and memoryMaximumSize, but
                        accepts memoryinitialsize and memorymaximumsize (note the
                        case), while the Ant doc says they have to be camel cased.

                        I don't know if Ant accepts both cases for element and
                        attribute names.

                        > I use the following line in schemas.xml to trigger it:
                        > <documentElement localName="project" uri="antproject.rnc" />

                        > I worried a bit if this would collide with the setting of
                        > the maven schema (maven also has <project> as its top
                        > element), but using this setting for maven triggers usage
                        > of the maven schema:
                        > <namespace ns="http://maven.apache.org/POM/4.0.0"
                        > uri="maven-v4_0_0.rnc" />

                        I don't have the precedence rules in mind, but you should
                        find them in (info "(nxml-mode)Schema locating files").
                        Here is what I have in my schemas.xml:

                        <uri pattern="*/build.xml" typeId="ANT"/>
                        <documentElement localName="project" typeId="ANT"/>
                        <typeId id="ANT" uri="ant.rnc"/>

                        Do you have a public URI for this schema? If you don't,
                        would you mind if I added it to my site in order to point it
                        from a blog post?

                        BTW, does someone here have some interesting schema he/she
                        uses? The most useful I get until know is the XSLT (both
                        1.0 and 2.0 in the same schema) from Norman.

                        Regards,

                        --drkm





















                        _____________________________________________________________________________
                        Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
                      • Lennart Borgman
                        ... I do not have anything to offer, but could you please tell us the URL of your site/blog here?
                        Message 11 of 14 , Jun 21, 2007
                        • 0 Attachment
                          Florent Georges wrote:

                          > Do you have a public URI for this schema? If you don't,
                          > would you mind if I added it to my site in order to point it
                          > from a blog post?
                          >
                          > BTW, does someone here have some interesting schema he/she
                          > uses? The most useful I get until know is the XSLT (both
                          > 1.0 and 2.0 in the same schema) from Norman.
                          >
                          > Regards,
                          >
                          > --drkm

                          I do not have anything to offer, but could you please tell us the URL of
                          your site/blog here?
                        • Florent Georges
                          Lennart Borgman wrote: Hi ... Of course: http://www.fgeorges.org/ http://fgeorges.blogspot.com/ The home page smells a little bit weird, and there is not so
                          Message 12 of 14 , Jun 22, 2007
                          • 0 Attachment
                            Lennart Borgman wrote:

                            Hi

                            > I do not have anything to offer, but could you please tell
                            > us the URL of your site/blog here?

                            Of course:

                            http://www.fgeorges.org/
                            http://fgeorges.blogspot.com/

                            The home page smells a little bit weird, and there is not so much
                            about Emacs Lisp (I unfortunately don't have enough time for every
                            thing I like). But feel free to have a walk there.

                            Regards,

                            --drkm


























                            ___________________________________________________________________________
                            Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
                            Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
                            http://fr.answers.yahoo.com
                          • Steinar Bang
                            ... Hm... perhaps correct it, if ant has a problem with the attributes not being camelcase? Or if it conflicts with existing build.xml files? ... No, I won t
                            Message 13 of 14 , Jun 22, 2007
                            • 0 Attachment
                              >>>>> Florent Georges <darkman_spam@...>:

                              > I just found that the javac element doesn't accept the
                              > attributes memoryInitialSize and memoryMaximumSize, but
                              > accepts memoryinitialsize and memorymaximumsize (note the
                              > case), while the Ant doc says they have to be camel cased.

                              > I don't know if Ant accepts both cases for element and
                              > attribute names.

                              Hm... perhaps correct it, if ant has a problem with the attributes not
                              being camelcase? Or if it conflicts with existing build.xml files?

                              > Do you have a public URI for this schema? If you don't,
                              > would you mind if I added it to my site in order to point it
                              > from a blog post?

                              No, I won't mind. Please go ahead!

                              (strictly speaking it isn't mine. it's generated by ant, and
                              converted by trang... I don't know what copyright laws says about
                              something like that... :-) )




















                              > _____________________________________________________________________________
                              > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail



                              > Yahoo! Groups Links
                            • Florent Georges
                              ... Hi ... Ant seems to accept any case (I just changed a build file and run Ant, it didn t complain). So I suggest to use the case used in the doc (it is
                              Message 14 of 14 , Jun 24, 2007
                              • 0 Attachment
                                Steinar Bang wrote:

                                > >>>>> Florent Georges:

                                Hi

                                > > I don't know if Ant accepts both cases for element and
                                > > attribute names.

                                > Hm... perhaps correct it, if ant has a problem with the
                                > attributes not being camelcase? Or if it conflicts with
                                > existing build.xml files?

                                Ant seems to accept any case (I just changed a build file
                                and run Ant, it didn't complain). So I suggest to use the
                                case used in the doc (it is sometimes came case, sometimes
                                all in lower case).

                                > > Do you have a public URI for this schema? If you
                                > > don't, would you mind if I added it to my site in order
                                > > to point it from a blog post?

                                > No, I won't mind. Please go ahead!

                                Thanks:

                                http://fgeorges.blogspot.com/2007/06/ant-build-files-relax-ng-compact-schema.html
                                http://www.fgeorges.org/purl/20070624/ant.rnc

                                Regards,

                                --drkm























                                ___________________________________________________________________________
                                Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
                                Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
                                http://fr.answers.yahoo.com
                              Your message has been successfully submitted and would be delivered to recipients shortly.