Default Handler implementation breaking on nbsp

I have an implementation of default handler. When it gets to a   in the character data it stops parsing. Is there any reason that it is doing this? Are there additional properties that I need to set in order for it to deal with &nbsp?

Asked by: Fenton538 | Posted: 28-01-2022

Answer 1

This breaks because the XML entity is not defined. You could add

<!DOCTYPE document  SYSTEM "document.dtd" [ 
<!ENTITY nbsp "&#160;"> 

Or just use &#160; instead. (Note the ";" at the end)

Also see here.

Answered by: Julian668 | Posted: 01-03-2022

Answer 2

&nbsp; is not a valid xml entity. You might try replacing it with &#160; instead, it does the same thing (non-breaking space).

Answered by: Sophia124 | Posted: 01-03-2022

Similar questions

java - Should we @Override an interface's method implementation?

Should a method that implements an interface method be annotated with @Override? The javadoc of the Override annotation says: Indicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotated with this annotation type ...

data structures - KDTree Implementation in Java

I'm looking for a KDTree implementation in Java. I've done a google search and the results seem pretty haphazard. There are actually lots of results, but they're mostly just little one-off implementations, and I'd rather find something with a little more "production value". Something like apache collections or the excellent C5 collection library for .NET. Something where I can see the public bug tracker and check to se...

java - is there a merged iterator implementation?

Is there an Iterator implementation that merges multiple iterators? class MergedIterator&lt;T&gt; implements Iterator&lt;T&gt; { MergedIterator(Iterator&lt;T&gt;... iters) .... } And the next method should move on to iters[1] when !iters[0].hasNext() etc

java - Is there a free (LGPL, BSD, etc) implementation of XML editor swing component

I need a JComponent thad enables editing xml documents so I can embed it in my application. It doesnt need to bee fancy. Plain text editing and highlighting would bee enough. Thank in advance

jsp - Is there an openID implementation in Java?

Java: Specifying generics on Type AND Implementation

Most references I've seen, and my IDE's code completion all have my specifying a Generic type on both a variables type and its implementation eg. List&lt;String&gt; string = new ArrayList&lt;String&gt;(); Recently I've started skipping the generic type on the implementation eg. List&lt;String&gt; strings = new ArrayList(); assuming that the compiler is onl...

java - Interface implementation through different JVMs

Lets say you have interface definition. That interface can be Operation. Then you have two applications running in different JVMs and communicating somehow remotely by exchanging Operation instances. Lets call them application A and application B. If application A implements Operation with the class that is not available in the classpath...

java - How to simplify a null-safe compareTo() implementation?

I'm implementing compareTo() method for a simple class such as this (to be able to use Collections.sort() and other goodies offered by the Java platform): public class Metadata implements Comparable&lt;Metadata&gt; { private String name; private String value; // Imagine basic constructor and accessors here // Irrelevant parts omitted } I want the natu...

MPI implementation for Java

Is there a current Java MPI implementation. I have programmed in MPI a bit, and I enjoy programming in Java. I have seen this implementation in Java, but it seems dated. Is there a more up to date Java implementation that is being kept up?

How can I translate printf("%c",M); from C to Java for my DES implementation?

I'm a German student and for computer classes I need to implement the DES-encryption in Java (by myself, not by using the Java-API) and explain it in detail. I didn't find any Java-code-examples using google, however I did find an easy implementation in C. (I do not know C, I know a little C++, but not that well, pointer...

Still can't find your answer? Check out these amazing Java communities for help...

Java Reddit Community | Java Help Reddit Community | Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)