|
|
|
@@ -3,6 +3,7 @@ package altk.comm.engine; |
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Vector; |
|
|
|
@@ -11,6 +12,9 @@ import java.util.zip.ZipInputStream; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.xml.parsers.DocumentBuilder; |
|
|
|
import javax.xml.parsers.DocumentBuilderFactory; |
|
|
|
import javax.xml.parsers.ParserConfigurationException; |
|
|
|
import javax.xml.parsers.SAXParser; |
|
|
|
import javax.xml.parsers.SAXParserFactory; |
|
|
|
import javax.xml.xpath.XPath; |
|
|
|
import javax.xml.xpath.XPathConstants; |
|
|
|
import javax.xml.xpath.XPathExpressionException; |
|
|
|
@@ -21,7 +25,9 @@ import org.w3c.dom.Element; |
|
|
|
import org.w3c.dom.NamedNodeMap; |
|
|
|
import org.w3c.dom.Node; |
|
|
|
import org.w3c.dom.NodeList; |
|
|
|
import org.xml.sax.InputSource; |
|
|
|
import org.xml.sax.SAXException; |
|
|
|
import org.xml.sax.helpers.DefaultHandler; |
|
|
|
|
|
|
|
import altk.comm.engine.exception.BroadcastError; |
|
|
|
import altk.comm.engine.exception.BroadcastException; |
|
|
|
@@ -94,6 +100,28 @@ public abstract class XMLDOMBroadcast extends Broadcast |
|
|
|
{ |
|
|
|
inb = request.getInputStream(); |
|
|
|
} |
|
|
|
/* |
|
|
|
// alternate code to find out where are the offending characters in input |
|
|
|
myLogger.info("Begin parsing"); |
|
|
|
SAXParser parser; |
|
|
|
try |
|
|
|
{ |
|
|
|
parser = SAXParserFactory.newInstance().newSAXParser(); |
|
|
|
// constructs an empty ArrayList for use by parser. |
|
|
|
// Convert InputStream inb into InputSource, using the UTF-8 |
|
|
|
// character set, and for use by SAX parser |
|
|
|
InputSource is = new InputSource(new InputStreamReader(inb, "UTF-8")); |
|
|
|
|
|
|
|
DefaultHandler parserHandler = new DefaultHandler(); |
|
|
|
parser.parse(is, parserHandler); |
|
|
|
} |
|
|
|
catch (ParserConfigurationException e) |
|
|
|
{ |
|
|
|
// TODO Auto-generated catch block |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
int contentLength = request.getContentLength(); |
|
|
|
CommonLogger.activity.info("Receiving " + contentLength + " bytes of data"); |
|
|
|
byte[] content = new byte[contentLength]; |
|
|
|
|