hi
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...
public static Document transformXML(Document xmlDoc, Document xslDoc) throws XMLHelperException {
try {
Source xmlIn = new StreamSource(xmlDoc);
Source xslIn = new StreamSource(xslDoc);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StreamResult xmlOut = new StreamResult(baos);
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(xmlOut);
transformer.transform(xmlIn, xslIn, xmlOut);
baos.close();
String result = baos.toString();
return parseXMLFromString(result);
---------------
& the errors;
C:\>javac XMLHelper.java
XMLHelper.java:172: cannot find symbol
symbol : constructor StreamSource(org.w3c.dom.Document)
location: class javax.xml.transform.stream.StreamSource
Source xmlIn = new StreamSource(xmlDoc);
^
XMLHelper.java:173: cannot find symbol
symbol : constructor StreamSource(org.w3c.dom.Document)
location: class javax.xml.transform.stream.StreamSource
Source xslIn = new StreamSource(xslDoc);
^
XMLHelper.java:179: cannot find symbol
symbol : method newTransformer(javax.xml.transform.stream.StreamResult)
location: class javax.xml.transform.TransformerFactory
Transformer transformer = tFactory.newTransformer(xmlOut);
^
XMLHelper.java:180: transform(javax.xml.transform.Source,javax.xml.transform.Res
ult) in javax.xml.transform.Transformer cannot be applied to (javax.xml.transfor
m.Source,javax.xml.transform.Source,javax.xml.transform.stream.StreamResult)
transformer.transform(xmlIn, xslIn, xmlOut);
^
XMLHelper.java:389: cannot find symbol
symbol : method getDefaultTagTable()
location: class org.w3c.tidy.TagTable
org.w3c.tidy.TagTable tags = org.w3c.tidy.TagTab
le.getDefaultTagTable();
anyone any idea? it's going to be embarrassingly simple, i know it