Questions tagged [saxparseexception]

The Java exception which encapsulates an XML parse error or warning.

The Java exception which encapsulates an XML parse error or warning.
This exception will include information for locating the error in the original XML document.

125 questions
45
votes
5 answers

Content is not allowed in Prolog SAXParserException

I am trying to call a web service but facing a strange behavior. we have a web-service running on my server but the code is not open to us so can not see what going on behind the wall The owner of the service have exposed web based test client UI…
Umesh Awasthi
  • 23,407
  • 37
  • 132
  • 204
14
votes
2 answers

How to use SAXParseException effectively in Java

I'm validating against XMLSchema in Java, and getting SAXParseExceptions thrown when I have non-valid content models. I'm going to be using these exceptions to highlight where the validation has failed - but the SAXParseExceptions seem to be a…
brabster
  • 42,504
  • 27
  • 146
  • 186
11
votes
3 answers

SaxParser on Android: Unexpected End Of Document Exception

I'm getting a "SAXParseException: Unexpected end of document" error when trying to parse an xml document on android. The document in question is from the google weather api, but it seems to throw the same error regardless of the xml file in…
Dave Smylie
  • 2,663
  • 3
  • 25
  • 32
9
votes
3 answers

cvc-complex-type.2.4.a: Invalid content was found starting with element 'MarkupListURI'. One of '{MarkupDeleteURI}' is expected

I have been attempting to resolve this final issue with validating the return xml from the api to the xsd, in almost all instances that are similar the solution is to add the following line: elementFormDefault="qualified" however this line is…
MinosMythos
  • 93
  • 1
  • 1
  • 5
8
votes
6 answers

Why does this code keep triggering the SaxParseException : ""PI must not start with xml"?

This code is used to generate a XML document from its String representation. It works fine in my small unit tests, but fails in my actual xml data. The line where it triggers is Document doc = db.parse(is); Any ideas? public static Document…
Kurru
  • 14,180
  • 18
  • 64
  • 84
7
votes
1 answer

Using SAX (Java) to parse multiple XML messages from a single TCP-stream

I'm in a position where I use Java to connect to a TCP port and am streamed XML documents one after another, each delimited with the
jkt
  • 73
  • 1
  • 4
7
votes
3 answers

The entity name must immediately follow the '&' in the entity reference error in jasper reports

I have a Master report that has 4 subreports. The report gets generated successfully when I generate the report in iReport(version 4.1.3). However when the report gets deployed in JBoss server it gives the following error Error Parsing Styled…
Abhinash
  • 263
  • 3
  • 8
  • 14
5
votes
1 answer

how to ignore XML errors when parsing faulty XML with Sax (on Android)

Question on the Sax XML parser on Android, using Java: I need to parse XML files I get from the web, and that I have no control over. Some contain errors and cause the parser to abort with errors like "mismatched tag" or "not well-formed (invalid…
user1225364
5
votes
2 answers

Using dom4j DOMDocument to feed validator.validate(DOMSource) fails in java 1.6 (xsi:noNamespaceSchemaLocation is not allowed), works in 1.5

Using dom4j DOMDocument to feed validator.validate(DOMSource) fails in java 1.6 (with xsi:noNamespaceSchemaLocation is not allowed to appear in root element), works in 1.5 I'm finding the following problem quite intractable (OK, that's an…
user598656
  • 442
  • 7
  • 10
5
votes
2 answers

SAXParser fails to parse some characters

I am doing some simple SAXParsing with SAXParser etc on android/java It can parse files properly, but hiccups when it encounters some special characters, for example if it parses this xml below:
Ahmad Mushtaq
  • 1,395
  • 1
  • 10
  • 32
5
votes
0 answers

Error deploying JAX-WS war in Tomcat: Cannot resolve the name 'cxf-beans:beanAttributes'

I am trying to deploy a JAX-WS webservice on Tomcat. I am generating the war in Eclipse. The error I am getting on running Tomcat is - SEVERE: Exception sending context initialized event to listener instance of class…
user2689782
  • 747
  • 14
  • 31
4
votes
1 answer

SaxParseException in XSD validation does not give element name

I have an xsd file and an xml file, I am validating the xml file against the xsd file using the following code DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); factory.setAttribute( …
Adithya Puram
  • 303
  • 2
  • 6
  • 23
4
votes
0 answers

org.xml.sax.SAXParseException JASypt conflict when upgrading Spring beyond 4.2.1 using Java

I am trying to upgrade my spring version from "4.1.5.RELEASE" to "5.0.3.RELEASE" (the latest). When I go to any version beyond "4.2.1.RELEASE", I am getting the following error: Caused by:…
Garet Jax
  • 1,091
  • 3
  • 17
  • 37
4
votes
1 answer

Getting the line number and column number from a org.w3c.dom.Node

I know that you can get the line number and column number from a org.xml.sax.SAXParseException. Is it possible to get the line number and column number from a org.w3c.dom.Node?
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
4
votes
0 answers

org.xml.sax.saxparseexception; character reference &#

I am parsing an XML using Java DOM parser. The XML text contains - (in its Unicode reprsentation -) at many places. The parser fails with this exception: [Fatal Error] :55479:87: Character reference "&# org.xml.sax.SAXParseException; lineNumber:…
user3538357
  • 41
  • 1
  • 4
1
2 3
8 9