i just cant seem to get this xml stuff working! i've got the imports, my classpath is correct, i'm using java 1.6, i've check the api's, i think i've decared all i need to etc but i'm still getting these errors that are starting to make me twitch. here's the errant snippet of code...
Well, you've just been rather creative with your code. For example, StreamSource reads from Readers and Streams, not from Document objects. You want to use a DOMSource to read from a Document. Transformer.newTransformer() can take a Source argument, but not a StreamResult. The code you're looking for is something like this
dang i'm perplexed, i see where i went wrong, bit overexcited! but now i've amended the code and i'm still getting an error. i googled it and a guy seems to have found a workaround using jdom - here's the link
XMLHelper.java:182: transform(javax.xml.transform.Source,javax.xml.transform.Res ult) in javax.xml.transform.Transformer cannot be applied to (org.w3c.dom.Docume nt,javax.xml.transform.stream.StreamResult) t.transform(xmlDoc, xmlOut); ^ XMLHelper.java:392: cannot find symbol symbol : method getDefaultTagTable() location: class org.w3c.tidy.TagTable org.w3c.tidy.TagTable tags = org.w3c.tidy.TagTab le.getDefaultTagTable();
if i try t.transform(new DOMSource(xmlDoc, xmlOut));