logo       
Google Custom Search

Related Msgs: audio.musicbrai...    enbd.general/20...    ietf.idr/2002-0...    java.ant-contri...    gnu.make.genera...    qplus.devel/200...    video.freevo.cv...    os.netbsd.ports...    yellowdog.gener...    xfree86.cvs/200...    search.nutch.us...    freedesktop.xse...    programming.swi...    capabilities.ge...    telephony.pbx.a...    mail.sylpheed.c...    db.firebase.por...    boot-loaders.u-...    recreation.radi...    netbsd.bugs/200...    web.zope.plone....    user-groups.lin...   

Setting http://apache.org/xml/features/nonvalidating/load-dtd-grammar: msg#00034

Subject: Setting http://apache.org/xml/features/nonvalidating/load-dtd-grammar
Have a set of XML files that need some optional tags adding - so
they're being SAX parsed (xerces 2.6.0, jdk 1.4.1).

However - the important point is not to modify the XML more than
necessary - and that includes not adding default attributes for
attributes that have a default specified in the DTD. I've seen a
couple of mails that suggest removing these defaults from the DTD but
this is not an option - they are required by other parts of the
system.

So - I had a look at

http://xml.apache.org/xerces2-j/features.html#nonvalidating.load-dtd-grammar

and have the code:

  XMLReader reader = saxParser.getXMLReader();
  
reader.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar";,
 
                              false);

which from the docs looks like it should "not use the default
attributes and attribute types".

However - the attrs in startElement still contain the default values
for non-present attributes.

I've also tried setting validation to false (should be default) - no
difference.

Any ideas? Have I misunderstood the feature?

Regards

-- 
Chris Searle



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>