Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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! :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...