ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jit K <jkf...@gmail.com>
Subject Error using xsl transformation in process
Date Wed, 13 Jan 2016 07:17:30 GMT
Dear List,

I am trying to use xsl transformation in my process. But I keep getting the
following error
Error
  org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to
insert a node where it is not permitted.

The stylesheet works fine without error if I run it in eclipse over the
input xml.
Can you help me figure out what am I doing wrong?
Is there a way to debug this inside ODE?

////////////////////////
  BPEL
////////////////////////
<bpel:process name="TestXslTransformation" targetNamespace="
http://sample.bpel.org/bpel/sample"
 suppressJoinFailure="yes" xmlns:tns="http://sample.bpel.org/bpel/sample"
 xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
 queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
 expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">

 <bpel:import location="TestXslTransformationArtifacts.wsdl" namespace="
http://sample.bpel.org/bpel/sample"
         importType="http://schemas.xmlsoap.org/wsdl/" />

    <bpel:partnerLinks>
        <bpel:partnerLink name="client"
partnerLinkType="tns:TestXslTransformation"
myRole="TestXslTransformationProvider"/>
    </bpel:partnerLinks>

    <bpel:variables>
        <bpel:variable name="input"
messageType="tns:TestXslTransformationRequestMessage"/>
        <bpel:variable name="output"
messageType="tns:TestXslTransformationResponseMessage"/>
    </bpel:variables>

    <bpel:sequence name="main">

        <bpel:receive name="receiveInput" partnerLink="client"
   portType="tns:TestXslTransformation" operation="initiate"
variable="input" createInstance="yes"/>

        <bpel:assign validate="no" name="doXslt_moveInputArgsToOutput">
            <bpel:copy>
                <bpel:from><bpel:literal><tns:TestXslTransformationResponse
xmlns:tns="http://sample.bpel.org/bpel/sample" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
  <tns:outputArgs>
    <tns:name>tns:name</tns:name>
    <tns:value>tns:value</tns:value>
  </tns:outputArgs>
</tns:TestXslTransformationResponse>
</bpel:literal></bpel:from>
                <bpel:to variable="output" part="payload"></bpel:to>
            </bpel:copy>
            <bpel:copy>
                <bpel:from>

<![CDATA[bpel:doXslTransform("MoveInputParamsToOutput.xsl",
$input.payload)]]>
                </bpel:from>
                <bpel:to part="payload" variable="output"></bpel:to>
            </bpel:copy>
        </bpel:assign>
        <bpel:reply name="Reply" partnerLink="client" operation="initiate"
variable="output"></bpel:reply>
    </bpel:sequence>
</bpel:process>

////////////////////////
  WSDL
////////////////////////
<?xml version="1.0"?>
<definitions name="TestXslTransformation"
 targetNamespace="http://sample.bpel.org/bpel/sample"
 xmlns:tns="http://sample.bpel.org/bpel/sample"
 xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
 xmlns="http://schemas.xmlsoap.org/wsdl/"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

    <types>
        <schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
                targetNamespace="http://sample.bpel.org/bpel/sample"
                xmlns="http://www.w3.org/2001/XMLSchema">

            <element name="TestXslTransformationRequest">
                <complexType>
                    <sequence>
                        <element name="inputArgs" type="tns:inputArg"
maxOccurs="unbounded"/>
                    </sequence>
                </complexType>
            </element>

            <element name="TestXslTransformationResponse">
                <complexType>
                    <sequence>
                        <element name="outputArgs" type="tns:outputArg"
maxOccurs="unbounded"/>
                    </sequence>
                </complexType>
            </element>

             <complexType name="inputArg">
             <sequence>
              <element name="name" type="string"></element>
              <element name="value" type="string"></element>
             </sequence>
            </complexType>

            <complexType name="outputArg">
             <sequence>
              <element name="name" type="string"></element>
              <element name="value" type="string"></element>
             </sequence>
            </complexType>
        </schema>
    </types>

    <message name="TestXslTransformationRequestMessage">
        <part name="payload" element="tns:TestXslTransformationRequest"/>
    </message>
    <message name="TestXslTransformationResponseMessage">
        <part name="payload" element="tns:TestXslTransformationResponse"/>
    </message>

    <portType name="TestXslTransformation">
        <operation name="initiate">
            <input  message="tns:TestXslTransformationRequestMessage" />
            <output message="tns:TestXslTransformationResponseMessage"/>
        </operation>
    </portType>

    <plnk:partnerLinkType name="TestXslTransformation">
        <plnk:role name="TestXslTransformationProvider"
portType="tns:TestXslTransformation"/>
    </plnk:partnerLinkType>

    <binding name="TestXslTransformationBinding"
type="tns:TestXslTransformation">
     <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http" />
     <operation name="initiate">
      <soap:operation
       soapAction="http://sample.bpel.org/bpel/sample/process" />
      <input>
       <soap:body use="literal" />
      </input>
      <output>
       <soap:body use="literal" />
      </output>
     </operation>
    </binding>

    <service name="TestXslTransformationService">
     <port name="TestXslTransformationPort"
binding="tns:TestXslTransformationBinding">
      <soap:address location="
http://localhost:8080/ode/processes/TestXslTransformation" />
     </port>
    </service>
</definitions>

////////////////////////
  XSL
////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:sam="
http://eclipse.org/bpel/sample">
 <xsl:output method="xml"/>

 <!--
 Input: TestXslTransformationRequest with multiple inputArgs elements
 Output: TestXslTransformationResponse with multiple outputArgs elements
each corresponding to inputArgs in TestXslTransformationRequest
 -->
 <xsl:template match="/sam:TestXslTransformationRequest">
  <!-- The root element is the one that will be used as a base for the
assignment rvalue -->
  <xsl:element name="sam:root">
   <xsl:for-each select="sam:inputArgs">
    <xsl:element name="sam:outputArgs">
     <xsl:element name="sam:name"><xsl:value-of
select="sam:name/text()"></xsl:value-of></xsl:element>
     <xsl:element name="sam:value"><xsl:value-of
select="sam:value/text()"></xsl:value-of></xsl:element>
    </xsl:element>
   </xsl:for-each>
  </xsl:element>
 </xsl:template>
</xsl:stylesheet>

Regards,
JK

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message