Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 23815 invoked from network); 17 Nov 2000 19:09:44 -0000 Received: from mta02-svc.ntlworld.com (62.253.162.42) by locus.apache.org with SMTP; 17 Nov 2000 19:09:44 -0000 Received: from tinypc ([213.104.48.13]) by mta02-svc.ntlworld.com (InterMail vM.4.01.02.27 201-229-119-110) with SMTP id <20001117190939.SVUY270.mta02-svc.ntlworld.com@tinypc>; Fri, 17 Nov 2000 19:09:39 +0000 Message-ID: <001b01c050c9$8084a880$0298a8c0@tinypc> Reply-To: "anthony.dodd" From: "anthony.dodd" To: , Cc: "Anthony Dodd" Subject: EntityResolver - too slow for use with schemas Date: Fri, 17 Nov 2000 19:06:30 -0000 Organization: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0017_01C050C9.7E532280" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0017_01C050C9.7E532280 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0018_01C050C9.7E532280" ------=_NextPart_001_0018_01C050C9.7E532280 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ----- Original Message -----=20 From: anthony.dodd=20 To: Anthony Dodd=20 Sent: Thursday, November 16, 2000 11:04 PM Subject: EntityResolver - too slow for use with schemas Hi I'm using an EntityResolver to resolve the name and location of my = schema which is contained in the same jar file as the xml source. = (attached SRulesEntityResolver.java). Everything works fine the xml = source is validated with respect the schema. The problems lies with the = length of time it takes to perform the validation and arsing of the xml = souce. Without the schema the xml source is parsed in a matter of = milliseconds with the schema included we're looking at between 20 and 30 = seconds.=20 Is there any way of speeding up the process, e.g. preloadng schema's = using XMLReader, or am I simply going about it the wrong way. Any help = would be gladly accepted. I've attached a sample of the xml source = (TSTAT01.xml) and the schema (dax.xsd) associated with it.=20 I'm using xeces-j 1.2.0, J2SE 1.3 on windows NT 4.0 SP6, Intel P3 = 733Mhz. =20 Thanks in advance. Anthony Dodd ------=_NextPart_001_0018_01C050C9.7E532280 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
----- Original Message -----=20
From: anthony.dodd
Sent: Thursday, November 16, 2000 11:04 PM
Subject: EntityResolver - too slow for use with = schemas

Hi
 
    I'm using an = EntityResolver to=20 resolve the name and location of my schema which is contained in the = same jar=20 file as the xml source. (attached SRulesEntityResolver.java). Everything = works=20 fine the xml source is validated with respect the schema. The problems = lies with=20 the length of time it takes to perform the validation and arsing of = the xml=20 souce. Without the schema the xml source is parsed in a matter of = milliseconds=20 with the schema included we're looking at between 20 and 30 seconds.=20
 
    Is there any way of = speeding up=20 the process, e.g. preloadng schema's using XMLReader, or am I simply = going about=20 it the wrong way. Any help would be gladly accepted. I've attached a = sample of=20 the xml source (TSTAT01.xml) and the schema (dax.xsd) associated with = it.=20
 
    I'm using xeces-j=20 1.2.0, J2SE 1.3 on windows NT 4.0 SP6, Intel P3=20 733Mhz.   
 
Thanks in advance.
Anthony Dodd
------=_NextPart_001_0018_01C050C9.7E532280-- ------=_NextPart_000_0017_01C050C9.7E532280 Content-Type: application/octet-stream; name="SRulesSchemaEntityResolver.java" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="SRulesSchemaEntityResolver.java" /* * SRulesSchemaEntityResolver.java * * Created on 11 September 2000, 22:07 */ package com.synergy.rules; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import java.io.*; /** A simple entity resolver to resolve the location of the rules schema = (xsd) file * * @author Default * @version */ public class SRulesSchemaEntityResolver implements EntityResolver { //Implements EntityResolver =20 public org.xml.sax.InputSource resolveEntity(java.lang.String = publicId, java.lang.String systemId) throws org.xml.sax.SAXException, = java.io.IOException { try { if (true) throw new Exception("here i am"); } catch (java.lang.Exception e) { e.printStackTrace(); } =20 =20 =20 InputSource source =3D null; //The schema is to be found in the same location as this file if (systemId.equals("http://www.synergy-fs.com/dax.xsd") || = systemId.equals("dax.xsd")) { System.out.println("publicId=3D"+publicId+", = systemId=3D"+systemId);=20 source =3D new = InputSource(getClass().getResourceAsStream("/com/synergy/rules/dax.xsd"))= ; source.setPublicId(publicId); source.setSystemId(systemId); } return source; } } ------=_NextPart_000_0017_01C050C9.7E532280 Content-Type: text/xml; name="TSTAT01.xml" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="TSTAT01.xml" ------=_NextPart_000_0017_01C050C9.7E532280 Content-Type: application/octet-stream; name="dax.xsd" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dax.xsd" =09 =09 =09 =09 =09 =20 =09 =09 =09 =09 =20 =09 =09 =09 =09 =20 =09 =20 =09 =09 =09 =09 =09 =09 =20 =09 =09 =09 =09 =09 = =09 = =20 =09 =20 =09 =09 =09 =09 =09 =20 =20 ------=_NextPart_000_0017_01C050C9.7E532280--