• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Missing method: streaming a file as to SAX2 parser

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Salooners !
For the last 4 months I have had lot of pleasure and success concerning SAX2.
So far I'm still missing a method that is able to parse a file as a stream like the method below - including java.security functionalty, threading etc. .
Should'nt such a method be mandatory when developing Internet-applications anyway.

public void parseString(String s) throws SAXException, IOException
{
StringReader reader = new StringReader(s);
InputSource source = new InputSource(reader);
parser.parse(source);
}
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, we already that


InputSource(InputStream byteStream)
Create a new input source with a byte stream.
InputSource(Reader characterStream)
Create a new input source with a character stream.


Let me know if I have understood your query wrongly.
 
author
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My own XOM API has such a method, but it's ot like it's that hard to wrap a Stringreader around a String in any of the other APIs, as your post demonstrates. The main reason most of the other APIs don't do this is that it's not easy to distinguish between a string that contains a URL of a document and a String that contains the document itself. XOM gets around this by requiring the method that takes a a String containing the document to provide a second argument that contains the document's base URI so the overloaded methods' argument lists don't conflict.
XOM is not discussed explicitly in Effective XML, but it was designed with adherence to the Efective XML prinicples very much in mind.
 
Tom Stevns
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Elliotte & Pradeep
Thanks for your reply.
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic