You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Andy Clark <an...@apache.org> on 2001/01/17 11:36:49 UTC

Re: Cache xml schema file to improve performance.

Guoliang Cao wrote:
> Is there anybody interested in this?  If you have some good experiences
> already, please share with me. Thanks.

There are some problems with the following lines.

>             char chArr[] = new char[1000000];
>             InputStreamReader isReader = new InputStreamReader((new
> URL(url)).openStream());
>             int len = isReader.read(chArr);
>             isReader.close();
>             String str = (new String(chArr)).substring(0,len);
>             InputSource is = new InputSource(new StringReader(str));
>             Htable.put(systemId,str);

1) You should use a byte array instead of a char array so
   that you are able to handle files in various encodings.
2) Make the byte array size based on the the Content-Length 
   header and then store the array in a hashtable. Then, 
   when you need to read it, just wrap a ByteArrayInputStream
   around it.
3) Be careful about block reads from an input stream because
   there is no guarantee that you will read the entire amount
   in a single call. You have to loop until the value that is
   returned by InputStream#read(byte[]) is -1.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

HTML DOM

Posted by Shiva <Si...@informix.com>.
Hi,
	From the Xerces docs, I see that there is also a HTML DOM
in xerces.jar
	Are there any samples to use this ?

rgds,
Shiva




Re: Xerces 2

Posted by Elena Litani <hl...@jtcsv.com>.
Hi, Kevin,

> Where can I get the Xerces 2 code?

  set CVSROOT=:pserver:anoncvs@xml.apache.org:/home/cvspublic
  cvs login        (password: anoncvs)
  cvs checkout -d x2 -r xerces_j_2 xml-xerces/java 

Visit Andy Clark web site for more information:
http://www.apache.org/~andyc/

Any help with development is greatly appreciated. You can start by
posting patches to this mailing list.

Good Luck,
elena

Xerces 2

Posted by Kevin Steppe <ks...@pacbell.net>.
Where can I get the Xerces 2 code?

What should I do to get involved in its development?

Thanks,
Kevin