[xsde-users] Unwanted validation

Boris Kolpackov boris at codesynthesis.com
Mon Oct 4 07:46:25 EDT 2010


Hi Jamesm

James Sutton <jrs at jmsutton.co.uk> writes:

> I would like to provide a list of titles of my (large) MusicXML files, 
> which can be obtained by parsing just a few small elements. Currently
> it has to parse and validate each entire file just to get this information,
> and it is very slow.

Can you quantify the "vary slow" part? How big is the file, how long does
it take to parse, and what kind of hardware are you using?


> also it seems that must be decided at build time, so, since I will need 
> validation for reading the full files, I must also have validation when 
> I don't want it. Why can't I decide at runtime ?

That would make parsing slower.


> I am struggling to hand-edit the generated code to remove all the unwanted
> parsers (for notes etc) for the titles-only version, after reading in the
> documentation that this is possible. Is this going to work or am I wasting
> my time?

Yes, that's exactly how you should do it, except for the hand-editing the
generated code part. Rather, you should copy the generated aggregate class
and remove any parsers that you don't need. 


> I can't help feeling that if I remove parsers it's going to think that 
> unparsed elements must be invalid, so this approach is doomed.

No, if you don't provide a parser, the corresponding XML fragment will be
silently ignored, whether valid or not.

Boris



More information about the xsde-users mailing list