Mandatory attributes

Olivier POTONNIEE <[email protected]> Tue, 06 Jan 2004 11:52:56 +0100
Newsgroups gmane.editors.pollo.devel
Message-ID <[email protected]>
Hello

I'm using Pollo to edit XML document based on XML Schema grammars.
I realizes Pollo source code could detect "mandatory" schema attributes (by displaying a '!' sign in editor pane), but this option was not activated. Does anybody knows why ? I reactivated it by modifying org.outerj.pollo.xmleditor.schema.MsvSchema.init() method, where "trackOptionalAttributes" was only set to true if the grammar was a DTD. I moved the assignment out of the 'if':

 trackOptionalAttributes = true;
 if (type != null && type.equals("dtd"))
 {
     grammar =  DTDReader.parse(inputSource, new PolloMsvController());
 }
 else
 {
     // let MSV autodetect
     grammar = GrammarLoader.loadSchema(inputSource, 
                 new PolloMsvController(), saxParserFactory);
 }

I'm pretty sure that doesn't work in all cases, in particular if grammar is null, or not a XML Schema. Is there a cleaner way to do it ?

--
Olivier






-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click