utf-x
  1. utf-x
  2. UTF_X-42

Absolute XPath Expressions can't be used

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.0.7 alpha
    • Fix Version/s: 0.0.8
    • Component/s: framework
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      42

      Description

      The root element passed to stylesheet under test is <utfx-wrapper> and not the
      child of the <utfx:source> element in the TDF. Therefore absolute XPath
      expressions can't be used in the stylesheet under test.

      ==============================
      STEPS TO REPRODUCE:

      Stylesheet under test:
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:template name="absolute-copy-of">
      <xsl:copy-of select="/"/>
      </xsl:template>
      </xsl:stylesheet>

      TDF:
      <?xml version="1.0" encoding="UTF-8"?>
      <?xml-stylesheet type="text/xsl" href="../../../src/xsl/test_definition_xhtml.xsl"?>
      <utfx:tests xmlns:utfx="http://utfx.org/test-definition">
      <utfx:stylesheet src="absolute_xpath_tests.xsl"/>

      <utfx:test>
      <utfx:name>absolute xpath test</utfx:name>
      <utfx:call-template name="absolute-copy-of"/>
      <utfx:assert-equal>
      <utfx:source>
      <root>
      <branch>
      <leaf></leaf>
      </branch>
      </root>
      </utfx:source>
      <utfx:expected>
      <root>
      <branch>
      <leaf></leaf>
      </branch>
      </root>
      </utfx:expected>
      </utfx:assert-equal>
      </utfx:test>
      </utfx:tests>

      Actual result:
      [java] [1] absolute xpath test
      [java] actual:
      [java] <utfx-wrapper>< [ DIFF ]
      utfx-wrapper><root><branch><leaf></leaf></branch></root></utfx-wrapper></utfx-wrapper>
      [java] expected:
      [java] <utfx-wrapper>< [ DIFF ]
      root><branch><leaf></leaf></branch></root></utfx-wrapper>

      Expected result:
      Passed

      1. absolute_xpath_tests_test.xml
        4 kB
        lachdrache
      2. absolute_xpath_tests_testwrapper.xsl
        2 kB
        lachdrache
      3. absolute_xpath_tests.xsl
        0.8 kB
        lachdrache

        Activity

        Hide
        jacekrad added a comment -

        will try to fix for the next release; note that the test definition file
        structure will change for the next release

        Show
        jacekrad added a comment - will try to fix for the next release; note that the test definition file structure will change for the next release
        Hide
        lachdrache added a comment -

        Created an attachment (id=11)
        stylesheet under test for absolute xpath expressions

        Show
        lachdrache added a comment - Created an attachment (id=11) stylesheet under test for absolute xpath expressions
        Hide
        lachdrache added a comment -

        Created an attachment (id=12)
        TDF for absolute xpath tests

        Show
        lachdrache added a comment - Created an attachment (id=12) TDF for absolute xpath tests
        Hide
        lachdrache added a comment -

        Created an attachment (id=13)
        testwrapper file for absolute xpath tests

        Show
        lachdrache added a comment - Created an attachment (id=13) testwrapper file for absolute xpath tests
        Hide
        lachdrache added a comment -

        One also has to keep in mind the context node the template works on. Proposed
        TDF-syntax:
        <utfx:source context-node="/tree/branch">
        <tree>
        <branch>
        <leaf/>
        </branch>
        </tree>
        </utfx:source>

        Attention! The attached scripts don't work with
        org.apache.xalan.xsltc.trax.TransformerFactoryImpl or
        com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl because of a
        Xalan bug (http://issues.apache.org/jira/browse/XALANJ-1928). You have to use
        either org.apache.xalan.processor.TransformerFactoryImpl or
        net.sf.saxon.TransformerFactoryImpl in your build.xml file.

        @Jacek I already did a lot of research on this issue and would be happy to fix
        this defect. I already wrote you two emails about the pending developer request
        of mine and didn't get a response. If it is o.k. for you assign this defect to
        me and please grant me access to the CVS repository.

        Show
        lachdrache added a comment - One also has to keep in mind the context node the template works on. Proposed TDF-syntax: <utfx:source context-node="/tree/branch"> <tree> <branch> <leaf/> </branch> </tree> </utfx:source> Attention! The attached scripts don't work with org.apache.xalan.xsltc.trax.TransformerFactoryImpl or com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl because of a Xalan bug ( http://issues.apache.org/jira/browse/XALANJ-1928 ). You have to use either org.apache.xalan.processor.TransformerFactoryImpl or net.sf.saxon.TransformerFactoryImpl in your build.xml file. @Jacek I already did a lot of research on this issue and would be happy to fix this defect. I already wrote you two emails about the pending developer request of mine and didn't get a response. If it is o.k. for you assign this defect to me and please grant me access to the CVS repository.
        Hide
        jacekrad added a comment -

        Alexander,

        I was hoping to get 0.0.8 released this weekend before my wife comes over. Do
        you want to finish this for 0.0.8 or shall we wait (could be a while) for 0.1.0
        and the new schema structure; also, do you want to be involved in the design of
        the new structure/code?

        -j

        Show
        jacekrad added a comment - Alexander, I was hoping to get 0.0.8 released this weekend before my wife comes over. Do you want to finish this for 0.0.8 or shall we wait (could be a while) for 0.1.0 and the new schema structure; also, do you want to be involved in the design of the new structure/code? -j
        Hide
        lachdrache added a comment -

        All code changes are commited and updated manual.xml

        Show
        lachdrache added a comment - All code changes are commited and updated manual.xml

          People

          • Assignee:
            lachdrache
            Reporter:
            lachdrache
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: