From: erjdriver on 22 Jul 2010 21:34 i'm using java 1.4 and the swing parser javax.swing.text.html.parser. i've got a simple text file with a SPAN element - it does not parse it. if i replace the SPAN with P - it works. what do i need to do for the parser to parse SPAN. help?
From: markspace on 22 Jul 2010 22:08 erjdriver wrote: > i'm using java 1.4 and the swing parser > > javax.swing.text.html.parser. > > i've got a simple text file with a SPAN element - it does not parse > it. > > if i replace the SPAN with P - it works. > > what do i need to do for the parser to parse SPAN. > > help? I dunno if this is the same parser, but the HTML parser for JEditorPane says HTML 3.2 is supported, which is pretty old and primitive. No <span> element in 3.2 that I can see. http://www.w3.org/TR/REC-html32
From: Christian Kaufhold on 23 Jul 2010 04:31 erjdriver <erjdriver(a)gmail.com> wrote: > i'm using java 1.4 and the swing parser Why still Java 1.4? > javax.swing.text.html.parser. > > i've got a simple text file with a SPAN element - it does not parse > it. A text file cannot contain a SPAN element :-) > if i replace the SPAN with P - it works. > what do i need to do for the parser to parse SPAN. There is SPAN even in Java 1.4, but it is not recognized by the default HTMLDocument.HTMLReader. You just need the line registerTag(HTML.Tag.SPAN, new CharacterAction()); in a subclass of HTMLReader; but to set up things so that this Reader is actually used requires a lot of other code (certainly I posted something like that somewhen in comp.lang.java.gui). But just upgrade.
|
Pages: 1 Prev: How to remotely construct a remote object with RMI Next: MappedByteBuffer |