[xsd-users] embedding and fgXercesLoadExternalDTD?

Mario Lang mlang at delysid.org
Mon Apr 20 19:18:08 EDT 2015


Boris Kolpackov <boris at codesynthesis.com> writes:

> DTDs, unlike Schema, serve dual purpose: they may supply entities
> (content) and grammar (validation). As a result, I would be weary
> of ignoring DTDs outright. The way I would handle your situation
> is by providing Xerces-C++ EntityResolver and returning a local
> DTD (you could probably even do the embedding, it just won't be
> parsed grammar).

In fact, the MusicXML DTDs do indeed define some entities, so your
suggestion is totally correct.  Thanks for pointing me in the right
direction.  I now use DOMLSResourceResolver and MemBufInputSource + a
small tool similar to xsdbin.cpp without the compression bits.  Works
just fine and is actually exactly what I wanted.  Since the public ID
includes the MusicXML version, I can support all 4 public versions of
MusicXML DTDs with a signel binary without any external resources.

P.S.: Any plans to make xsdbin's functionality part of the xsdcxx
installed tools?  While the source can be copied around into embedding
projects, it seems like the tool is flexible enough to be distributed by
default.  Something like "xsdcxx xsdbin ...".

-- 
CYa,
  ⡍⠁⠗⠊⠕



More information about the xsd-users mailing list