dbenoit64 Posted June 14, 2005 Posted June 14, 2005 import javax.xml.parsers.SAXParser.*; import javax.xml.parsers.SAXParserFactory.*; I did a search on the internet about this library and it said I needed java 2 sdk se v1.4.2_08 in order to get it to work. well i downloaded that and installed it and I can even see all the source code for the library that came with the download. But for some reason I just cant make it work. when I write import javax.xml.parsers.SAXParserFactory.*; I just keep getting errors: "Cannot find class 'SAXParser'"!!!!. I have no idea about what to do here. Im not familar with java and all this class stuff. So any help would be greatly appreciated. thanks dave Quote
Administrators PlausiblyDamp Posted June 14, 2005 Administrators Posted June 14, 2005 Not sure if J# supports the javax packages as standard and a search on google was less than helpful. Is this existing code you are attempting to compile or something you are developing yourself? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
dbenoit64 Posted June 14, 2005 Author Posted June 14, 2005 Im Running Existing Code. This is it: --------------------------------------------------------------------SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); -------------------------------------------------------------------- I get a "Cannot Find Class" error.... Yet they do it here: http://www.lowagie.com/iText/tutorial/ch07.html Just I cant implement it.... Quote
Administrators PlausiblyDamp Posted June 14, 2005 Administrators Posted June 14, 2005 That looks like pure Java code - not J# which is Microsoft's Java style language. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
dbenoit64 Posted June 14, 2005 Author Posted June 14, 2005 Okay, I've found an implementation for sax. import Org.System.Xml.Sax.*;//sax library for xml parsing import Org.System.Xml.Sax.InputSource; import Org.System.Xml.*; _________________________________________________________ // step 1: creation of a document-object Document documentA = new Document(PageSize.A4, 80, 50, 30, 65); // step 1: creation of a document-object Document documentB = new Document(PageSize.A4, 80, 50, 30, 65); try { // step 2: // we create a writer that listens to the document // and directs a XML-stream to a file PdfWriter.getInstance(documentA, new FileOutputStream("Chap0704a.pdf")); PdfWriter.getInstance(documentB, new FileOutputStream("Chap0704b.pdf")); //a test Org.System.Xml.Sax.InputSource source1 = new InputSource("C:/problema.xml"); // step 3: we parse the document //XmlParser.parse(documentA, source1); XmlParser.parse(documentB, "C:/Chap0703.xml", "tagmap0703.xml"); _________________________________________________________ so as a test the line: Org.System.Xml.Sax.InputSource source1 = new InputSource("C:/problema.xml"); works fine. But the line that generates an error: XmlParser.parse(documentB, "C:/Chap0703.xml", "tagmap0703.xml"); is telling me it cannot find the class 'org.xml.sax.InputSource' even though you can pass the file string as an argument. I know no one will answer this post so thanks to no body! :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.