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 Jeffrey Rodriguez <je...@hotmail.com> on 2000/08/02 03:12:14 UTC

RE: DTD Error

Hi Jonathan!
I don't really think I understand your question.

Yes, you may be setting up an URL in your application but to
the parser, the dtd ldapfeedwriter.dtd is local unless
you provide your own entity resolver.

If that is the case then you may be resolving to your dtd
to an URL.

In any case even if you did not validate if you have your
own entity resolver you will pick up the dtd and read it
even in the case of only welformdness.

So to your original question which was why my document is not
validated?

> > >
> > >I am not getting a error??  can you please tell me why??  I would think
> > >that sax sees that for the first file no filename was set?

The reason is:

1) You need to turn validation ( read features in documentation) or
look at the sax.SAXCount sample.

2) You need to provide and error handler and you need to register it.
   ( Again sax.SAXCount is a good example).


Hope this helps.

         Jeffrey Rodriguez
         IBM Silicon Valley
         XML Development








>From: "Smith, Jonathan" <js...@PaineWebber.COM>
>To: "'Jeffrey Rodriguez'" <je...@hotmail.com>
>Subject: RE: DTD Error
>Date: Tue, 1 Aug 2000 14:51:11 -0400
>
>but I am setting a url
>
>Johnathan Mark Smith
>Messaging & Collaboration
>PaineWebber Incorporated
>1000 Harbor Boulevard, 6th Floor
>Weehawken, NJ 07087-6791
>Phone: 201.352.1387
>Fax: 201.902.5273
>E-mail: jsmith4@painewebber.com
>
>
>-----Original Message-----
>From: Jeffrey Rodriguez [mailto:jeffreyr_97@hotmail.com]
>Sent: Tuesday, August 01, 2000 2:47 PM
>To: Smith, Jonathan
>Subject: RE: DTD Error
>
>
>No,
>Validation just means that your XML file is validated against
>the grammar rules specified in the DTD.
>
>Hope this helps,
>
>                 Jeffrey Rodriguez
>                 IBM Silicon Valley
>                 XML Development
>
>
>
>
> >From: "Smith, Jonathan" <js...@PaineWebber.COM>
> >To: "'xerces-dev@xml.apache.org'" <xe...@xml.apache.org>
> >CC: "'Jeffrey Rodriguez'" <je...@hotmail.com>
> >Subject: RE: DTD Error
> >Date: Tue, 1 Aug 2000 14:13:26 -0400
> >
> >If I have validation does my program need internet access?
> >
> >Johnathan Mark Smith
> >Messaging & Collaboration
> >PaineWebber Incorporated
> >1000 Harbor Boulevard, 6th Floor
> >Weehawken, NJ 07087-6791
> >Phone: 201.352.1387
> >Fax: 201.902.5273
> >E-mail: jsmith4@painewebber.com
> >
> >
> >-----Original Message-----
> >From: Jeffrey Rodriguez [mailto:jeffreyr_97@hotmail.com]
> >Sent: Tuesday, August 01, 2000 1:59 PM
> >To: xerces-dev@xml.apache.org
> >Subject: Re: DTD Error
> >
> >
> >Hi Jonathan,
> >When I run your xml document through sax.SAXCount with validation
> >on with the latest cvs build I get:
> >
> >java sax.SAXCount -v ldapfeedwriter.xml
> >
> >[Error] ldapfeedwriter.xml:5:15: Element type "file-name2" must be
> >declared.
> >[Error] ldapfeedwriter.xml:13:10: The content of element type "file" must
> >match
> >"(file-name,file-server,file-user?,file-password?,file-filter?,file-base,file-attributes?,file-formater)".
> >ldapfeedwriter.xml: 1162 ms (37 elems, 0 attrs, 113 spaces, 809 chars)
> >
> >Is this what would you expect?
> >
> >Thanks,
> >             Jeffrey Rodriguez
> >             IBM Silicon Valley
> >             XML Development
> >
> >
> >
> > >From: "Smith, Jonathan" <js...@PaineWebber.COM>
> > >Reply-To: xerces-dev@xml.apache.org
> > >To: "'xerces-dev@xml.apache.org'" <xe...@xml.apache.org>
> > >Subject: DTD Error
> > >Date: Tue, 1 Aug 2000 11:10:44 -0400
> > >
> > >
> > >One thing that I would like to bring up. is that if I have a dtd file
> >like
> > >this one
> > >
> > ><!ELEMENT app (file+)>
> > ><!ELEMENT file (file-name,
> > >                 file-server,
> > >				file-user?,
> > >				file-password?,
> > >				file-filter?,
> > >				file-base,
> > >				file-attributes?,
> > >				file-formater)>
> > >
> > ><!ELEMENT file-name (#PCDATA)>
> > ><!ELEMENT file-server (#PCDATA)>
> > ><!ELEMENT file-user (#PCDATA)>
> > ><!ELEMENT file-password (#PCDATA)>
> > ><!ELEMENT file-filter (#PCDATA)>
> > ><!ELEMENT file-base (#PCDATA)>
> > ><!ELEMENT file-attributes (#PCDATA)>
> > ><!ELEMENT file-formater (#PCDATA)>
> > >
> > >and the following xml file
> > >
> > ><?xml version="1.0"?>
> > ><!DOCTYPE app SYSTEM "ldapfeedwriter.dtd">
> > ><app>
> > >	<file>
> > >		<file-name2>DavidRichards.csv</file-name2>
> > >		<file-server>pw411.pwj.com</file-server>
> > >		<file-user>cn=directory manager</file-user>
> > >		<file-password>333</file-password>
> > >		<file-filter>objectclass=painewebberperson</file-filter>
> > >		<file-base>o=painewebber,c=us</file-base>
> > >		<file-attributes>cn,uid,costcenter,departmentname</file-attributes>
> > 
> >		<file-formater>com.painewebber.messagingcollaboration.ldap.LDAPCSVEntryWriter</file-formater>
> > >	</file>
> > >	<file>
> > >		<file-name>tp01.txt</file-name>
> > >		<file-server>pw411.pwj.com</file-server>
> > >		<file-user>cn=directory manager</file-user>
> > >		<file-password>222</file-password>
> > >		<file-filter>objectclass=painewebberperson</file-filter>
> > >		<file-base>o=painewebber,c=us</file-base>
> > 
> >		<file-attributes>employeenumber,departmentname,socialsecurity,costcenter,employeetype</file-attributes>
> > >		<file-formater>LDAPPLFeed</file-formater>
> > >	</file>
> > >	<file>
> > >		<file-name>tp01.xml</file-name>
> > >		<file-server>pw411.pwj.com</file-server>
> > >		<file-user>cn=directory manager</file-user>
> > >		<file-password>444</file-password>
> > >		<file-filter>objectclass=painewebberperson</file-filter>
> > >		<file-base>o=painewebber,c=us</file-base>
> > 
> >		<file-attributes>employeenumber,departmentname,socialsecurity,costcenter,employeetype</file-attributes>
> > 
> >		<file-formater>com.painewebber.messagingcollaboration.ldap.LDAPXMLEntryWriter</file-formater>
> > >	</file>
> > >	<file>
> > >		<file-name>tp_dsml.xml</file-name>
> > >		<file-server>pw411.pwj.com</file-server>
> > >		<file-user>cn=directory manager</file-user>
> > >		<file-password>555</file-password>
> > >		<file-filter>objectclass=painewebberperson</file-filter>
> > >		<file-base>o=painewebber,c=us</file-base>
> > 
> >		<file-attributes>employeenumber,departmentname,socialsecurity,costcenter,employeetype</file-attributes>
> > 
> >		<file-formater>com.painewebber.messagingcollaboration.ldap.LDAPDSMLEntryWriter</file-formater>
> > >	</file>
> > ></app>
> > >
> > >I am not getting a error??  can you please tell me why??  I would think
> > >that sax sees that for the first file no filename was set?
> > >
> > >
> > >
> > >
> > >Johnathan Mark Smith
> > >Messaging & Collaboration
> > >PaineWebber Incorporated
> > >1000 Harbor Boulevard, 6th Floor
> > >Weehawken, NJ 07087-6791
> > >Phone: 201.352.1387
> > >Fax: 201.902.5273
> > >E-mail: jsmith4@painewebber.com
> > >
> > >
> > >-----Original Message-----
> > >From: Arnaud Le Hors [mailto:lehors@us.ibm.com]
> > >Sent: Monday, July 31, 2000 10:17 PM
> > >To: xerces-dev@xml.apache.org
> > >Cc: xalan-dev@xml.apache.org; xerces-j-dev@xml.apache.org
> > >Subject: Re: Problem building current XERCES / XALAN
> > >
> > >
> > >The addition of the hasAttributes() method was decided by the W3C DOM 
>WG
> > >last week on my request. I implemented it right away and didn't realize
> > >xalan depended on this interface and would break. Sorry about that.
> > >It is trivial to fix though.
> > >Note that the addition of this method was motivated by the fact that in
> > >some implementations, such as Xerces, smaller memory footprint can be
> > >achieved if instead of calling directly getAttributes(), you guard it
> > >with a test of hasAttributes(). The point is that on an element without
> > >any attributes you'll save the creation of a NamedNodeMap. I therefore
> > >recommend everybody to update their code along those lines.
> > >--
> > >Arnaud  Le Hors - IBM Cupertino, XML Technology Group
> > >
> > >PS: xerces-dev is dead. You should use xerces-j-dev instead.
> >
> >________________________________________________________________________
> >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com