Announcement

Collapse
No announcement yet.

mapping to xslt result

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mapping to xslt result

    -So I have a channel, and I have a working XSLT transform.

    -I have my result mapped to a variable called: "TransXML"

    -I mapped a variable called "theDate" using: DateUtil.getCurrentDate( "yyyyMMddHHmmss");

    -Now I want to insert "theDate" into the result of my XSLT transform using a message builder step like:
    Message Segment: $('TransXML')['A_PLACE']['ANOTHER_PLACE']
    Mapping: $('thedate')

    But I get an error like:
    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    com.webreach.mirth.server.MirthJavascriptTransform erException:
    CHANNEL: Tra2ces Export 2
    CONNECTOR: Destination 1
    SCRIPT SOURCE:
    SOURCE CODE:
    171: </A_PLACE>
    172: </ROOT>
    173: </xsl:template>
    174: </xsl:stylesheet>);transformer = tFactory.newTransformer(new Packages.javax.xml.transform.stream.StreamSource(x sltTemplate));sourceVar = new Packages.java.io.StringReader(msg);resultVar = new Packages.java.io.StringWriter();transformer.transf orm(new Packages.javax.xml.transform.stream.StreamSource(s ourceVar), new Packages.javax.xml.transform.stream.StreamResult(r esultVar));channelMap.put('TransXML', resultVar)
    175: var mapping;try { mapping = DateUtil.getCurrentDate( "yyyyMMddHHmmss");; }catch (e) { logger.error(e); mapping = '';}channelMap.put('thedate', validate( mapping , '', new Array()));
    176: $('TransXML')['A_PLACE']['ANOTHER_PLACE'] = validate($('thedate'), '', new Array());
    177:
    178: }
    LINE NUMBER: 176
    DETAILS: TypeError: Cannot set property "ANOTHER_PLACE" of undefined to "[email protected] 1"
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:458)

    Anyone have any idea why I can't seem to just insert my date variable into the result of the XSLT step?

  • #2
    Another way?

    Alternatively, I could just place my date variable directly into my XSLT, if that is possible. But when I drag and drop my channel variable into the my XSLT template, my output is:

    <tag>$(theDate)</tag>

    instead of the actual variable. Anyone tried this?

    Comment

    Working...
    X