title: XSL Transformation issue for an XML
body: <p>I am accessing a WebService which give me a valid response. While parsing the response using an XSL Transformation, I am getting SAXParseException. If I tested in the online tools such as freeformatter.com, I am getting a proper parsing without any issues. Any help is greatly appreciated.</p>
  
  <p>The response I have received from the WebService is below</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;&lt;message channel-id="10a60e45-65d4-40c0-826f-1a91d2135da0"&gt;
  &lt;soap:Envelope
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Body&gt;
  &lt;ns:ITSPResponse xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services"&gt;
  &lt;Output&gt;Test IT Service Portal - 1&lt;/Output&gt;
  &lt;/ns:ITSPResponse&gt;
  &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>I am trying to parse the response using XSL Transformation; but receiving an exception. The XSL I am using</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services"&gt;
          &lt;xsl:template match="/"&gt;
              &lt;message&gt;
                  &lt;xsl:attribute name="channel-id"&gt;
                      &lt;xsl:value-of select="//@*[local-name()='channel-id']" /&gt;
                  &lt;/xsl:attribute&gt;
                  &lt;send-parameters&gt;
                      &lt;agent-parameter&gt;
                          &lt;name&gt;Output&lt;/name&gt;
                          &lt;value&gt; &lt;xsl:value-of select="//*[local-name()='Output']" /&gt; &lt;/value&gt;
                      &lt;/agent-parameter&gt;
                  &lt;/send-parameters&gt;
              &lt;/message&gt;
          &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>The exception I am getting is </p>
  
  <pre><code>org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at com.newscale.bfw.util.XMLValidator.validate(XMLValidator.java:147) at com.newscale.is.core.MessageExecutor.processNSTaskTransportMessage(MessageExecutor.java:135) at com.newscale.is.core.MessageExecutor.processTransportMessage(MessageExecutor.java:431) at com.newscale.is.core.MessageExecutor.processSynchronousOutboundMessage(MessageExecutor.java:526) at com.newscale.is.adk.OutboundAdapterUtil.processSynchronousResponse(OutboundAdapterUtil.java:44) at com.newscale.is.adapter.http.HTTPOutboundAdapter.call(HTTPOutboundAdapter.java:190) at com.newscale.is.adapter.http.HTTPOutboundAdapter.processMessage(HTTPOutboundAdapter.java:147) at com.newscale.is.core.MessageRouter.routeMessage(MessageRouter.java:115) at com.newscale.is.core.MessageExecutor.processOutboundMessage(MessageExecutor.java:604) at com.newscale.is.core.MessageExecutor.processMessage(MessageExecutor.java:125) at com.newscale.is.core.QueueListener.handleTextMessage(QueueListener.java:91) at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:340) at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:237) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:168) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:73) at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:101) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:115) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:285) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:322) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:213) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:105) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:561) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:499) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 
  </code></pre>
  
  <p>I am not sure whether I am missing anything anywhere?</p>