Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-3340

XsltAction does not resolve relative uri properly

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.6
    • Fix Version/s: None
    • Component/s: Transformation Service
    • Labels:
      None
    • Environment:

      Windows XP Pro, CZ, JBossESB Server 4.6 with Sun JDK 1.6.0_17using javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl

    • Steps to Reproduce:
      Hide
      • Create a service containing XsltAction
      • Use xslt template mentioned in description above
      • run the service feeding the action with any type of xml document
      • check the resulting message for value of attribute resolvedUri being created relative to JBoss start direcotry and not to the esb package
      Show
      Create a service containing XsltAction Use xslt template mentioned in description above run the service feeding the action with any type of xml document check the resulting message for value of attribute resolvedUri being created relative to JBoss start direcotry and not to the esb package
    • Affects:
      Compatibility/Configuration
    • Estimated Difficulty:
      Low

      Description

      Xslt relative path are resolved not from the place, template is located, but from bin directory (from which is JBoss started)

      <xsl:variable name="locs" select="document('region/pl/Warszawa.xml')"/>
      complains about not being able to find the file in D:\opt\jbossesb-server-4.6\bin\region\pl\Warshawa.xml even though the tempate is located inside of esb package.

      Using XSLT 2.0 I tried also
      <xsl:attribute name="resolvedUri"><xsl:value-of select="resolve-uri('region/pl/Warshawa.xml', base-uri)"/></xsl:attribute>
      and result shows exactly the same value of "D:\opt\jbossesb-server-4.6\bin\region\pl\Warshawa.xml".

      For testing I used this template

      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" encoding="UTF-8"/>
      <xsl:template match="/">
      <xsl:element name="jbossesb">
      <xsl:attribute name="resolvedUri"><xsl:value-of select="resolve-uri('region/pl/Warshawa.xml', base-uri)"/></xsl:attribute>
      <xsl:text>Local name of root element is: </xsl:text><xsl:value-of select="local-name(/*)"/><xsl:text>
      Number of children elements on second level is: </xsl:text><xsl:value-of select="count(//)"/>
      <xsl:text>
      Total number of elements in the document is: </xsl:text><xsl:value-of select="count(//*)"/>
      </xsl:element>
      </xsl:template>
      </xsl:stylesheet>

      and following Esb file
      <?xml version="1.0"?>
      <jbossesb parameterReloadSecs="5"
      xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
      <providers>
      <fs-provider name="FSprovider1">
      <fs-bus busid="helloFileChannel">
      <fs-message-filter
      directory="D:\var\projects\EsbSimpleFileGate\filegate\input"
      error-delete="false"
      error-directory="D:\var\projects\EsbSimpleFileGate\filegate\error"
      error-suffix=".IN_ERROR" input-suffix=".xml" post-delete="false"
      post-directory="D:\var\projects\EsbSimpleFileGate\filegate\output"
      post-suffix=".sentToEsb" work-suffix=".esbWorking"/>
      </fs-bus>
      </fs-provider>
      </providers>
      <services>
      <service category="myCategory"
      description="Hello World File Action (esb listener)"
      invmScope="GLOBAL" name="myFileListener">
      <listeners>
      <fs-listener busidref="helloFileChannel" is-gateway="true"
      name="FileGateway" poll-frequency-seconds="10"/>
      </listeners>
      <actions mep="OneWay">
      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="printBeforeXslt">
      <property name="message"/>
      </action>
      <action
      class="org.jboss.soa.esb.actions.transformation.xslt.XsltAction" name="XsltAction">
      <property name="templateFile" value="/template-small.xsl"/>
      <property name="resultType" value="STRING"/>
      <property name="failOnWarning" value="true"/>
      </action>
      <action class="org.jboss.soa.esb.actions.SystemPrintln" name="printAfterXslt">
      <property name="message"/>
      </action>
      </actions>
      </service>
      </services>
      </jbossesb>

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                vlcinsky Jan Vlcinsky
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: