On Apr 16, 2010, at 8:57 AM, Mohan.Radhakrishnan wrote: > > I need a filter that uses regex in log4j.xml. > > The XML validation complains. CDATA is understood by log4j ? > > param name="Expression" > value="^[<event\\-message\\-entry]([^>]+)>(.+?)</event-message-entry>"
log4j uses the current default parser provided by the java.xml.parsers.DocumentBuilderFactory. The actual parser in use will depend on the JVM being used. It is unlikely that it is a parser related bug. In your fragment, you have a literal "<" within an attribute value. In XML, a literal "<" can not appear there, it has to be represented by a "<" or equivalent. A CDATA section can not be used within an attribute value. It can be used in text content of an element, but log4j does not take any of its configuration from text contents of elements. The validation message should indicate the problem. Since it is likely generated by a commonly used parser, you should be able to search and find some relevant guidance. If you have an XML editor (Eclipse, NetBeans, Visual Studio, etc), it might give guide you a little better. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
