web stats
Mirth Community - View Single Post - Getting rid of xmlns="" in XML message
View Single Post
  #4  
Old 12-21-2012, 06:54 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Ah, I think I see what you mean now. So here's sort of how it works. The default E4X namespace is set based on the inbound message, so if your outbound message should use a different namespace, then you have two options. Either reset the default namespace, or declare namespaces as variables and use them with the E4X "::" directive in assignment statements. Here's an example of the former:

Code:
default xml namespace = 'http://www.ehealthontario.ca/CCIM';
Note that in that case since your inbound message doesn't have any namespaces defined, you'll have to use a blank one to extract data:

Code:
var ns = new Namespace('');
logger.info(msg.ns::type.toString());
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.

Last edited by narupley; 12-21-2012 at 06:56 AM.
Reply With Quote