OK that sounds like the best fit then. regards Malcolm Edgar
On Tue, Jun 30, 2009 at 8:59 PM, WarnerJan Veldhuis<warnerjan.veldh...@qprcostcontrol.com> wrote: > Note: the #REQUIRED only says something about the attribute "classname" in > relation to the element. It does *not* say that log-service is requiredin > XML. > > On Tue, 2009-06-30 at 20:56 +1000, Malcolm Edgar wrote: > > This is a bit tricky I don't think there is a good DTD mapping here. > The XmlConfigService does not require a logger to be defined and will > default to the ConsoleLogService. I would guess most people wont > bother to configure a logger implementation and would just use the > default. So I think the enumerated value would be the best way to > describe this. > > <!ATTLIST log-service classname > (org.apache.click.service.ConsoleLogService|org.apache.click.extras.service.Log4JService|org.apache.click.extras.service.JdkLogService) > "org.apache.click.service.ConsoleLogService"> > > regards Malcolm Edgar > > On Tue, Jun 30, 2009 at 8:33 PM, WarnerJan > Veldhuis<warnerjan.veldh...@qprcostcontrol.com> wrote: >> Nope, a list of values means it's mandatory to pick one of those values. >> Entering a custom value will make the XML invalid. I assume DocumentParser >> or SAXParser won't puke, but an IDE will. >> >> As an alternative, you can make the attribute #REQUIRED, which would mean >> the attribute is, well required :). Looking at the semantics of the >> log-service element, it's is in fact required. The downside is you cannot >> give a default value. People who want to use a custom logger will have to >> use the docs available to find out what to enter in the attribute. >> >> My suggestion would be to do this: >> >> <!ELEMENT log-service (property*)> >> <!ATTLIST log-service classname CDATA #REQUIRED> >> >> Cheers, >> >> WarnerJan >> >> >> >> On Tue, 2009-06-30 at 11:51 +0200, Bob Schellink wrote: >> >> On 6/30/09, WarnerJan Veldhuis <warnerjan.veldh...@qprcostcontrol.com> >> wrote: >>> Edit: typo >>> >>> >>> <!-- Log Service. --> >>> <!ELEMENT log-service (property*)> >>> <!ATTLIST log-service classname >>> (org.apache.click.service.ConsoleLogService| >>> org.apache.click.extras.service.Log4JLogService| >>> org.apache.click.extras.service.JdkLogService) >>> "org.apache.click.service.ConsoleLogService"> >> >> >> Great thanks. Does this definition cater for a custom logger class? >> Say "com.mycorp.CustomLogService"? Or does IntelliJ complain? >> >