Re: XML Parsing + SAX

2003-06-20 Thread Brian Delahunty
I don't actually have a file [Wish I did!]. It's a String with the XML
inside it that I get as a return value from a static method of a different
class. The XML itself is within the String. I could save it to file and then
use that but thats not very extensible.

Any ideas?


- Original Message - 
From: e nio [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 18, 2003 6:41 PM
Subject: RE: XML Parsing + SAX


   I believe a File object can be converted to a URL, look at the
 toURL() method.

 --- Carmona Perez, David [EMAIL PROTECTED] wrote:
  Why don't you use a java.io.StringBufferInputStream?
 
  
  David
 
  -Mensaje original-
  De: Brian Delahunty [mailto:[EMAIL PROTECTED]
  Enviado el: miércoles, 18 de junio de 2003 17:11
  Para: [EMAIL PROTECTED]
  Asunto: XML Parsing + SAX
 
  Hey,
 
  I have a String that contains an XML file [not a URL/URI that
  points to an XML file but the actual XML itself].
 
  I'm tying to use this string in a custom generator to produce
  sa exents. I'm using this code so far:
 
  XMLReader xmlr = XMLReaderFactory.createXMLReader();
  xmlr.setContentHandler(this.contentHandler);
  xmlr.parse( don't know what goes here );
 
  I can't get parse to work with a String.
 
  Any ideas?
 
  Brian
 
 


 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XML Parsing + SAX

2003-06-20 Thread Brian Delahunty
Thanks. That worked perfectly :-D


- Original Message - 
From: Merenidis, Grigorios [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 18, 2003 4:13 PM
Subject: AW: XML Parsing + SAX


Hi!

try this:

XMLReader parser =
XMLReaderFactory.createXMLReader(org.apache.xerces.parsers.SAXParser);
ContentHandler c1 = new ContentHandler();
ErrorHandler e1 = new ErrorHandler();
parser.setContentHandler(c1);
parser.setErrorHandler(e1);
parser.parse(new InputSource(new StringReader(your special
String!!)));

cheers

gregori

-Ursprüngliche Nachricht-
Von: Brian Delahunty [mailto:[EMAIL PROTECTED]
Gesendet am: Mittwoch, 18. Juni 2003 17:11
An: [EMAIL PROTECTED]
Betreff: XML Parsing + SAX

Hey,

I have a String that contains an XML file [not a URL/URI that points to an
XML file but the actual XML itself].

I'm tying to use this string in a custom generator to produce sa exents. I'm
using this code so far:

XMLReader xmlr = XMLReaderFactory.createXMLReader();
xmlr.setContentHandler(this.contentHandler);
xmlr.parse( don't know what goes here );

I can't get parse to work with a String.

Any ideas?

Brian



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: XML Parsing + SAX

2003-06-18 Thread Carmona Perez, David









Why dont you use a java.io.StringBufferInputStream?







David



-Mensaje
original-
De: Brian Delahunty
[mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 18 de junio
de 2003 17:11
Para: [EMAIL PROTECTED]
Asunto: XML Parsing + SAX



Hey,



I have a String that contains an XML file
[not a URL/URI that points to an XML file but the actual XML itself].



I'm tying to use this string in a custom
generator to produce sa exents. I'm using this code so far:


XMLReader xmlr = XMLReaderFactory.createXMLReader();
xmlr.setContentHandler(this.contentHandler);
xmlr.parse( don't know what goes here);



I can't get parse to work with a String.



Any
ideas?



Brian










RE: XML Parsing + SAX

2003-06-18 Thread e nio
  I believe a File object can be converted to a URL, look at the
toURL() method.

--- Carmona Perez, David [EMAIL PROTECTED] wrote:
 Why don't you use a java.io.StringBufferInputStream?
  
 
 David
  
 -Mensaje original-
 De: Brian Delahunty [mailto:[EMAIL PROTECTED]
 Enviado el: miércoles, 18 de junio de 2003 17:11
 Para: [EMAIL PROTECTED]
 Asunto: XML Parsing + SAX
  
 Hey,
  
 I have a String that contains an XML file [not a URL/URI that
 points to an XML file but the actual XML itself].
  
 I'm tying to use this string in a custom generator to produce
 sa exents. I'm using this code so far:
 
 XMLReader xmlr = XMLReaderFactory.createXMLReader();
 xmlr.setContentHandler(this.contentHandler);
 xmlr.parse( don't know what goes here );
  
 I can't get parse to work with a String.
  
 Any ideas?
  
 Brian
  
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]