I am trying to pass a date through the Transform-Xslt process step. I have the date saved in a context Data Property and want to use it as the input. When I go into the XsltParameter Collection Editor I enter the parameter name (postdate), leave the Namepace Uri field empty and place XPT.PostDate in the Value field. What it gets passed into my xslt it is a literal, not a reference. How do I get the date passed using the XsltParameter Collection Editor?
Tags:
Can you please send us a sample of what you are doing?
In order to reference the value of the XPT.PostDate property, you have to specify a property reference. For example, entering "{property:XPT.PostDate}" will retrieve the value of the XPT.PostDate property and will pass the value as the XSLT parameter. If you enter "XPT.PostDate," then the literal string "XPT.PostDate" will be passed for the parameter instead.
I changed the XsltParameter Collection Editor to read "{property:XPT.PostDate}" (See the attached jprg XsltParameter). The second image (XsltDefinition) I have placed a column in it to see the input parameter.
The third imgae (XsltOutput) shows the output from the XsltTranslation and, as you see, the parameter output is
{property:XPT.PostDate} which doesn't give me the result I need.
Which version of Neuron are you using?
Can you try the attached sample project in your environment? Load the sample project and in the process designer, test it using the simple XML "<Root/>". If it works, can you compare it to what you are doing?
My sample process has a code step that sets the value of the XPT.PostDate property on the message and then executes an XSLT transform that I modeled after yours. When I run it, I am getting the date inserted into the XML.
When I get it I get the second trace blank. See the attached image.
The XML that you sent in doesn't match the XSLT. Try this:
<Root/>
Also, what version of Neuron are you using? This feature was introduced after the 3.0 release. I want to make sure that you're using the right version.
We are using version 3.0.2.85
Here is the beginning of my Xslt, where do you want me to put <Root/>?
<?
xml version="1.0" encoding="utf-16"?>
/p>
xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
/font>xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
/font>xsl:param name="postdate"></xsl:param>
/font>xsl:template match="/">
/font>xsl:apply-templates select="/Root" />
</xsl:template>
/font>xsl:template match="/Root">
/font>Data>
/font>Table>
/font>xsl:attribute name="name">
/font>xsl:text>FinanceStaging_BB</xsl:text>
</xsl:attribute>
/font>xsl:for-each select="Row">
<!--<xsl:if test="Field7 = $postdate">-->
/font>Row>
/font>Column>
/font>xsl:attribute name="name">
/font>xsl:text>ParameterIn</xsl:text>
</xsl:attribute>
/font>xsl:attribute name="type">
/font>xsl:text>char</xsl:text>
</xsl:attribute>
/font>xsl:value-of select="$postdate" />
</Column>/font>Column>
/font>xsl:attribute name="name">
/font>xsl:text>LineNmbr</xsl:text>
</xsl:attribute>
/font>xsl:attribute name="type">
/font>xsl:text>char</xsl:text>
</xsl:attribute>
/font>xsl:value-of select="LineNmbr" />
</Column>
</Row>
<!--</xsl:if>-->
</xsl:for-each>
</Table>
</Data>
</xsl:template>
</xsl:stylesheet>
Maybe this looks better:
<?xml version="1.0" encoding="utf-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
<xsl:param name="postdate"></xsl:param>
<xsl:template match="/">
<xsl:apply-templates select="/Root" />
</xsl:template>
<xsl:template match="/Root">
<Data>
<Table>
<xsl:attribute name="name">
<xsl:text>FinanceStaging_BB</xsl:text>
</xsl:attribute>
<xsl:for-each select="Row">
<!--<xsl:if test="Field7 = $postdate">-->
<Row>
<Column>
<xsl:attribute name="name">
<xsl:text>ParameterIn</xsl:text>
</xsl:attribute>
<xsl:attribute name="type">
<xsl:text>char</xsl:text>
</xsl:attribute>
<xsl:value-of select="$postdate" />
</Column>
</Row>
<!--</xsl:if>-->
</xsl:for-each>
</Table>
</Data>
</xsl:template>
</xsl:stylesheet>
In the screenshot that you sent, you used the default test XML. This XML does not match your template, so the output data was empty. You need to modify the test XML with valid XML that matches your template. You should enter:
<Root/>
as the test XML document to test the process with.
See image.
The functionality that you are looking for was introduced after the release that you are currently using. Are you able to upgrade to 3.0.3?
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by