title: Mirth Transformer Error: prefix for element is not bound
body: <p>I'm getting the following error when trying to convert HL7v3 to HL7v2</p>
  
  <p>The message passed in is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;S:Body&gt;
          &lt;PRPA_IN201306UV02 xmlns="urn:hl7-org:v3" xmlns:ns2="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:ns3="urn:gov:hhs:fha:nhinc:common:patientcorrelationfacade" xmlns:ns4="http://schemas.xmlsoap.org/ws/2004/08/addressing" ITSVersion="XML_1.0"&gt;
              &lt;id extension="4ae5403:12752e71a17:-7b52" root="1.1.1"/&gt;
  ...
          &lt;/PRPA_IN201306UV02&gt;
      &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>The error I get is:</p>
  
  <blockquote>
    <p>ERROR-300: Transformer error
    ERROR MESSAGE:  Error evaluating transformer
    com.webreach.mirth.server.MirthJavascriptTransformerException: 
    CHANNEL:    v3v2ConversionResponseMessage
    CONNECTOR:  sourceConnector
    SCRIPT SOURCE:<br>
    LINE NUMBER:    5
    DETAILS:    <strong>TypeError: The prefix "S" for element "S:Envelope" is not bound.</strong>
        at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.evaluateScript(JavaScriptTransformer.java:460)
        at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.transform(JavaScriptTransformer.java:356)
        at org.mule.transformers.AbstractEventAwareTransformer.doTransform(AbstractEventAwareTransformer.java:48)
        at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:197)
        at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:200)
        at org.mule.impl.MuleEvent.getTransformedMessage(MuleEvent.java:251)
        at org.mule.routing.inbound.SelectiveConsumer.isMatch(SelectiveConsumer.java:61)
        at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:83)
        at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:493)
        at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:272)
        at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:231)
        at com.webreach.mirth.connectors.vm.VMMessageReceiver.getMessages(VMMessageReceiver.java:207)
        at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:108)
        at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:90)
        at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Unknown Source)</p>
  </blockquote>
  
  <p>When I remove the S: tag in front of the Envelope and Body and redefine the namespace to default, it gives me a new error </p>
  
  <blockquote>
    <p>TypeError: The prefix "xsi" for attribute "xsi:nil" associated with an element type "targetMessage" is not bound." </p>
  </blockquote>
  
  <p>This is referring to </p>
  
  <pre><code>&lt;targetMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                  xsi:nil="true"/&gt;
  </code></pre>
  
  <p>As if Mirth can't handle the namespaces being defined on the same line as the first use of that element.</p>
  
  <p>Any suggestions would be useful</p>