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

Unit Testing XSLT

Expand Messages
  • James Carr
    Hi, Recently I ve started exploring writing unit tests for XSL, especially since I have a few out there that, despite being nicely broken up into multiple
    Message 1 of 4 , Jan 27, 2006
    • 0 Attachment
      Hi,

      Recently I've started exploring writing unit tests for XSL, especially
      since I have a few out there that, despite being nicely broken up into
      multiple smaller templetes, are rather large and tedious to drudge
      through. Any recomendations for a good XSLT unit tester? I'm currently
      trying out http://juxy.tigris.org/, but would be interested if anyone
      else has had luck with it or something else and would be glad to hear
      of experiences.

      Thanks,
      JC
    • Joshua Kerievsky
      ... I wrote a lot of XSLT test-first a few years back. We used the htmlparser (http://htmlparser.sourceforge.net/) on small pieces of XSLT to simply check for
      Message 2 of 4 , Jan 27, 2006
      • 0 Attachment
        James Carr wrote:

        >Recently I've started exploring writing unit tests for XSL, especially
        >since I have a few out there that, despite being nicely broken up into
        >multiple smaller templetes, are rather large and tedious to drudge
        >through. Any recomendations for a good XSLT unit tester? I'm currently
        >trying out http://juxy.tigris.org/, but would be interested if anyone
        >else has had luck with it or something else and would be glad to hear
        >of experiences.
        >
        >
        I wrote a lot of XSLT test-first a few years back. We used the
        htmlparser (http://htmlparser.sourceforge.net/) on small pieces of XSLT
        to simply check for the correct output, given some input. It worked
        well, as the parser makes it easy to analyze markup text.

        That said, I think it is important to keep your XSLT as simple as
        possible. But you probably already knew that.

        --
        best regards,
        jk

        ----
        I n d u s t r i a l L o g i c , I n c .
        Joshua Kerievsky
        Founder, Industrial XP Coach
        http://industriallogic.com
        http://industrialxp.org
        866-540-8336 (toll free)
        510-540-8336 (phone)
        Berkeley, California
      • Erik Hanson
        ... I recently wrote some XSL unit tests in Javascript. My tests were written in a Javascript unit testing library I wrote (for fun*); however, JsUnit** would
        Message 3 of 4 , Jan 31, 2006
        • 0 Attachment
          On Jan 27, 2006, at 8:46 AM, James Carr wrote:
          > Recently I've started exploring writing unit tests for XSL, especially
          > since I have a few out there that, despite being nicely broken up into
          > multiple smaller templetes, are rather large and tedious to drudge
          > through. Any recomendations for a good XSLT unit tester?

          I recently wrote some XSL unit tests in Javascript. My tests were
          written in a Javascript unit testing library I wrote (for fun*);
          however, JsUnit** would work just as well (or perhaps better). I
          created some XML in my tests, loaded some XSL files with
          XmlHttpRequests, and rendered them into the page's DOM with an open-
          source Javascript-based XSL library called AJAXSLT***. I then made
          various asserts on the page's DOM using XPath (via AJAXSLT's XPath
          functions).

          It worked out very nicely. Javascript can simplify web testing
          because it provides easy access to the DOM.


          * Yes, I'm weird.

          ** http://www.jsunit.net/

          *** http://goog-ajaxslt.sourceforge.net/
          http://www.eahanson.com/weblog/?p=4
          http://www.eahanson.com/weblog/?p=6



          Erik
        • James Abley
          ... I ve used XMLUnit in the past. [1] Cheers, James [1] http://xmlunit.sf.net/
          Message 4 of 4 , Feb 1, 2006
          • 0 Attachment
            On 31/01/06, Erik Hanson <yahoogroups@...> wrote:
            > On Jan 27, 2006, at 8:46 AM, James Carr wrote:
            > > Recently I've started exploring writing unit tests for XSL, especially
            > > since I have a few out there that, despite being nicely broken up into
            > > multiple smaller templetes, are rather large and tedious to drudge
            > > through. Any recomendations for a good XSLT unit tester?
            >

            I've used XMLUnit in the past. [1]

            Cheers,

            James

            [1] http://xmlunit.sf.net/

            > I recently wrote some XSL unit tests in Javascript. My tests were
            > written in a Javascript unit testing library I wrote (for fun*);
            > however, JsUnit** would work just as well (or perhaps better). I
            > created some XML in my tests, loaded some XSL files with
            > XmlHttpRequests, and rendered them into the page's DOM with an open-
            > source Javascript-based XSL library called AJAXSLT***. I then made
            > various asserts on the page's DOM using XPath (via AJAXSLT's XPath
            > functions).
            >
            > It worked out very nicely. Javascript can simplify web testing
            > because it provides easy access to the DOM.
            >
            >
            > * Yes, I'm weird.
            >
            > ** http://www.jsunit.net/
            >
            > *** http://goog-ajaxslt.sourceforge.net/
            > http://www.eahanson.com/weblog/?p=4
            > http://www.eahanson.com/weblog/?p=6
            >
            >
            >
            > Erik
            >
            >
            >
            >
            >
            > To Post a message, send it to: extremeprogramming@...
            >
            > To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe@...
            >
            > ad-free courtesy of objectmentor.com
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.