Giter Club home page Giter Club logo

Comments (2)

redeemefy avatar redeemefy commented on May 24, 2024

UPDATE:
I'm trying to move this very functionality inside Mirth and still have issues with this. I don't know if this is a bug or not. I'm trying to reach a field within a segment logger.debug(msg['PID']['PID.4']['PID.4.1'].name()); and I get back TypeError: name is not a function, it is xml.. In the Message Trees I see that the node is there with an [empty] value. I tried to do the same thing with a different field and I do get the node name, for instance logger.debug(msg['PID']['PID.5']['PID.5.3'].name()); which its value also [empty] but I get back PID.5.3.

Why the inconsistency?

from connect.

tonygermano avatar tonygermano commented on May 24, 2024

Your actual inbound message probably does not have a PID.4.1 node.

The outbound template in your transformer, if present, gets serialized to the tmp variable.

The inbound template is only there for drag-and-drop purposes. msg will be the contents of your message, which doesn't necessarily look anything like your inbound template that you view in the Message Trees tab.

To your original question, if you are trying to stringify the XML for a node, use msg['PID']['PID.4']['PID.4.1'].toXMLString(). That will return an empty string if the node doesn't exist instead of throwing an exception and include the element name even if the node only contains text children.

from connect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.