|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: embedded html
Title: embedded html hey,
i
tried to do what you said but it doesn't seem to work...What am i still doing
wrong?
the
code just takes the first tags and the rest of html code in the text is not
shown, it is omitted.
so
when parsing string: "<root>tested before link <SITELINK><a
href='test.html'>tests</a></SITELINK>after
link</root>";
we get
<root>tested before link after link</root>
what
should i do to get the whole thing parsed?
source
code:
//
Java imports
import java.io.File; import java.io.FileInputStream; import java.io.*; import java.io.IOException; //
JDOM imports
import org.jdom.Document; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jdom.output.XMLOutputter; import org.jdom.Element; public
class SAXtoJDOM {
public
Document convert() throws JDOMException, IOException {
String input="<root>tested
before link <SITELINK><a
href='javascript:void(0);'>tests</a></SITELINK>after
link</root>";
byte[] bytes = input.getBytes(); ByteArrayInputStream bais = new ByteArrayInputStream(bytes); SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(bais); return doc; } public static void main(String[]
args) {
try { SAXtoJDOM tester = new SAXtoJDOM(); Document doc = tester.convert();
// Output the document to
System.out
XMLOutputter outputter = new XMLOutputter(); outputter.output(doc, System.out); } catch (Exception e) { e.printStackTrace(); } } } regards, bart
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








