OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Problems with EntityResolver

[ Lists Home | Date Index | Thread Index ]

Hi All,

I am having a strange problem with my XML Parser.  I want to use the DTD
validations when I am parsing my XML file.  My EntityResolver class looks
like this:

public class MyEntityResolver implements EntityResolver
{
 public InputSource resolveEntity(String publicId, String systemId) throws
SAXException
 {
  InputSource result = null;

   result = new InputSource("TRRQCR.dtd");

  return result;
 }
}

TRRQCR.dtd is the DTD file located in the same directory as
MyEntityResolver.

In the parser class I am setting EntityResolver this way:

    parser.setEntityResolver(new ExelEntityResolver());

When I parse my XML file it works without any problem.  But when I specify
an element which is not defiened in this TRRQCR.dtd also it parses fine.  I
expected the parser to throw an exception.  Am I missing something?



Thanks & Regards,
Rajesh
BEGIN:VCARD
VERSION:2.1
N:AVRS;Rajesh
FN:Rajesh AVRS
ORG:Wipro Technologies;EAI
TITLE:Programmer
TEL;WORK;VOICE:8520416 Ex: 6478
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;6th Tower,=0D=0A1st Floor, C Wing,=0D=0AECity-2;Bangalore;Karnataka;560001=
;India
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:6th Tower,=0D=0A1st Floor, C Wing,=0D=0AECity-2=0D=0ABangalore, Karnataka 56=
0001=0D=0AIndia
ADR;HOME;ENCODING=QUOTED-PRINTABLE:;;1/1, Ashraya,=0D=0AAnjaneya Temple Road,=0D=0A3rd Cross,=0D=0ANagasandra;B=
angalore;Karnataka;560032;India
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:1/1, Ashraya,=0D=0AAnjaneya Temple Road,=0D=0A3rd Cross,=0D=0ANagasandra=0D=
=0ABangalore, Karnataka 560032=0D=0AIndia
X-WAB-GENDER:2
URL;HOME:http://www.rajesh-avrs.com
URL;WORK:http://www.wipro.com
BDAY:20000331
EMAIL;PREF;INTERNET:rajesh.ram@wipro.com
REV:20020122T031012Z
END:VCARD

-----------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
------------------------------------------------------------------------------------------------------------------------




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS