InterviewSolution
| 1. |
I Have A (dtd Or Schema) That I Will Use To Validate Many Xml Documents. How Can I Avoid Having To Recompile It Every Time I Want To Validate A New Document? |
|
Answer» Xerces 1 does not currently support grammar CACHING. We EXPECT that Xerces 2 will support this functionality. Some users have reported success by registering an EntityResolver which handles reading the grammar from the disk and storing it in an efficient way (usually a byteArray), then passing the parser a reader for the efficiently-stored structure. While this does not AVOID recompiling the grammar for each instance document, it does avoid disk accesses. Xerces 1 does not currently support grammar caching. We expect that Xerces 2 will support this functionality. Some users have reported success by registering an EntityResolver which handles reading the grammar from the disk and storing it in an efficient way (usually a byteArray), then passing the parser a reader for the efficiently-stored structure. While this does not avoid recompiling the grammar for each instance document, it does avoid disk accesses. |
|