You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by ne...@ca.ibm.com on 2002/06/20 22:58:49 UTC

RE: problem with DTD

Hi Dominique,

>From a purely technical standpoint, I think Xerces now has the
infrastructure to do what you want to do-we can now build a DTD grammar
from an external DTD independent of an instance document, and we can apply
that grammar to different instance documents.  (See the new xml-grammars
FAQ for details).  What's missing is a coherent API for doing this type of
thing:  Whether it's DTD's or schemas, we still need the instance document
to tell us, using schemaLocation attributes or DOCTYPE decls, that it wants
to be validated with a specific grammar.

Have you had a chance to look at XNI or any other Xerces API?  If so, I'd
be very interested to hear your views on just how we'd make this work.

At this moment, I think your best bet is to cache your external DTD and
then direct Xerces to use that grammar via some trick such as what John
Anderson suggested.

Cheers!
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  neilg@ca.ibm.com




|--------+------------------------>
|        |          Sauquet       |
|        |          Dominique     |
|        |          <dsauquet@pros|
|        |          odie.com>     |
|        |                        |
|        |          06/20/2002    |
|        |          09:51 AM      |
|        |          Please respond|
|        |          to            |
|        |          xerces-j-user |
|        |                        |
|--------+------------------------>
  >-----------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                       |
  |      To:     "'Gopal Sharma'" <Go...@Sun.COM>, xerces-j-user@xml.apache.org                                    |
  |      cc:                                                                                                              |
  |      Subject:     RE: problem with DTD                                                                                |
  |                                                                                                                       |
  |                                                                                                                       |
  >-----------------------------------------------------------------------------------------------------------------------|



Hi Gopal,

the formulation of my problem was not clear enough.
My question is :
I have a DTD (I have its URL) and I want to validate XML
documents(regarding
this
particular DTD) THAT DO NOT contain any <!DOCTYPE>.
How can I do that ?
A great thanks in advance

           Dominique

-----Message d'origine-----
De : Gopal Sharma [mailto:Gopal.Sharma@Sun.COM]
Envoyé : mercredi 19 juin 2002 14:11
À : dsauquet@prosodie.com; xerces-j-user@xml.apache.org
Objet : Re: problem with DTD


 Hi Sauquet,

 You need not to do anything extra, just create a parser instance and use
 parse() on that, if you don't require to validate w/ DTD. In case,
 you need to validate it, use
 <!DOCTYPE (roottag) [PUBLIC|SYSTEM] "..location of external dtd file" >
 in your instance file and turn the validation (dtd) property ON.

 It will be good to see Xerces *Samples* to know more about it.

 Thanks
 - Gopal

 PS: BTW, It's not clear whether you need separate parse or one parse to
     parse all XML instance documents.

Sauquet Dominique wrote:-
|
| Hi
|
| I want to parse several XML Documents with a DOM Parser to get DOM tree
| representations for my documents.
| My DTD is in an external file. It is the same for all the documents.
| The Documents do not contain the DTD !!
|
| How can I do ?
| I am not sure that I have understood this FAQ.
|
|
|            How do I more efficiently parse several documents sharing a
common
| DTD?
|
|           DTDs are not currently cached by the parser. The common DTD,
since
| it is specified in each XML document, will be re-parsed once for each
| document.
|
| However, there are things that you can do now, to make the process of
| reading DTD's more efficient:
|
| *        keep your DTD and DTD references local
| *        use internal DTD subsets, if possible
| *        load files from server to local client before parsing
| *        Cache document files into a local client cache. You should do an
| HTTP header request to check whether the document has changed, before
| accessing it over the network.
| *        Do not reference an external DTD or internal DTD subset at all.
In
| this case, no DTD will be read.
| *        Use a custom EntityResolver and keep common DTDs in a memory
buffer.
|
|
|
| Could you send me the corresponding example or any other example ?
| Thanks a lot
|          Dominique
|
|
|
| > Dominique Sauquet
| > Direction des Moyens Informatiques
| > Tel : 01 46 84 13 12
| > <ma...@prosodie.com>
| >
| > Prosodie
| > 150, rue Galliéni
| > 92100 Boulogne
| > <http://www.prosodie.com/>
| >
| >
| >
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
| For additional commands, e-mail: xerces-j-user-help@xml.apache.org
|

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org