|
|
|
Re:doXslTransform() 1 Year, 1 Month ago
|
Karma: 8
|
|
Antoine, DoXslTransform() looks definitely broken to me. It has a side-effect on the output node, causing an existing prefix to be dropped resulting in subsequent XPATH references to the node to mismatch. Is there a work-around for this? Is it a known issue?
The input document, from the default client, is
<query.Response xmlns="http://intalio.com/connectors/jdbc" xmlns:ns1="http://intalio.com/connectors/jdbc" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <rows> <row> <label>lab 1</label> <value>val 1</value> </row> <row> <label>lab 2</label> <value>val 11</value> </row> </rows> </query.Response>
The transform acting on this input document is intended to simply rewrite the 'rows' node as 'items'
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://intalio.com/connectors/jdbc" xmlns:form2="http://example.com/form2/xform" xmlns="http://example.com/form2/xform" > <xsl:output method="xml"/> <xsl:template match="ns1:rows"> <xsl:element name="root" namespace="http://example.com/form2/xform" > <form2:items> <xsl:for-each select="ns1:row"> <form2:item> <form2:label> <xsl:value-of select="ns1:label"/> </form2:label> <form2:value> <xsl:value-of select="ns1:value"/> </form2:value> </form2:item> </xsl:for-each> </form2:items> </xsl:element> </xsl:template> </xsl:stylesheet>
In the mapper, the output of the doXslTransform() function is wired to the node containing 'rows' resulting a BPEL assign .
<bpel:assign bpmn:label="transform" bpmn:id="_sqAlkHqjEdy4boMa16EGGA"> <bpel:copy> <bpel:from>bpel:doXslTransform("urn:/transform.xsl", $doXSLTramsform1.body/MYSQLDB:rows)</bpel:from> <bpel:to>$doXSLTransform1_Response.body/xform:seletpets_items</bpel:to> </bpel:copy> </bpel:assign>
On execution of the process, the output message after the transform looks like this
<input xmlns="http://example.com/form2/xform" xmlns:xform="http://example.com/form2/xform"> <xform:seletpets /> <seletpets_items> <form2:items xmlns:ns1="http://intalio.com/connectors/jdbc" xmlns:form2="http://example.com/form2/xform"> <form2:item> <form2:label>lab 1</form2:label> <form2:value>val 1</form2:value> </form2:item> <form2:item> <form2:label>lab 2</form2:label> <form2:value>val 11</form2:value> </form2:item> </form2:items> </seletpets_items> <xform:pagroup> <xform:Result1 /> <xform:Result2 /> </xform:pagroup> </input>
Note that seletpets_items has lost its prefix in the transform. My understanding is that the root node from the transform should be dropped and the target node contents only replaced.
|
|
|
|
|
|
|
Last Edit: 2007/10/17 20:44 By dfrench.
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:doXslTransform() 1 Year, 1 Month ago
|
Karma: 26
|
|
Hi David,
we will investigate.
Thanks,
Antoine
|
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access. |
mriou (User)
Fresh Boarder
|
|
Re:doXslTransform() 1 Year, 1 Month ago
|
Karma: 0
|
|
Hi,
If you look at the first elements of your result document, the 'input' element has a default namespace declaration and it's identical to the one associated with the xform prefix. So even though your 'seletpets_items' element has no prefix, it's in the right namespace, there's nothing wrong about it.
Your subsequent assignment is probably failing for another reason. As far as namespaces are concerned, the result looks fine to me.
Cheers, Matthieu
|
|
|
|
|
|
|
Last Edit: 2007/10/17 21:16 By mriou.
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:doXslTransform() 1 Year, 1 Month ago
|
Karma: 8
|
|
Thanks Matthieu, ***SOLVED*** It just looked odd to me and distracted me from the extra 'items' element I output from the transform. All this to get the select and select1 initialised from a database!
David
|
|
|
|
|
|
|
Last Edit: 2007/10/18 09:06 By dfrench.
|
|
|
The administrator has disabled public write access. |
|