You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <da...@yahoo.com> on 2006/06/01 03:01:42 UTC

The evil of mixed content rears its ugly head in the config.xml local-attributes-1.1 schema

Now that we have a schema for config.xml it's become more painfully  
obvious that we are putting mixed content into the attribute elements  
of config.xml.  You can override an xml-attribute in a gbean such as  
the <defaultEnvironment> elements in the builders by putting the  
override xml right into an attribute element in config.xml.  This  
works great and we use it in the tck setup.

The schema validation we now seem to be doing is emitting warnings like:

Booting Geronimo Kernel (in Java 1.4.2_09)...
Warning: validation was turned on but an org.xml.sax.ErrorHandler was  
not
set, which is probably not what is desired.  Parser will use a default
ErrorHandler to print the first 10 errors.  Please call
the 'setErrorHandler' method to fix this.
Error: URI=null Line=105: cvc-complex-type.2.2: Element 'attribute'  
must have no element [children], and the value must be valid.
Error: URI=null Line=125: cvc-complex-type.2.2: Element 'attribute'  
must have no element [children], and the value must be valid.
Error: URI=null Line=149: cvc-complex-type.2.2: Element 'attribute'  
must have no element [children], and the value must be valid.
Error: URI=null Line=179: cvc-complex-type.2.2: Element 'attribute'  
must have no element [children], and the value must be valid.
Error: URI=null Line=207: cvc-complex-type.2.2: Element 'attribute'  
must have no element [children], and the value must be valid.

so... what to do??

1. ignore these messages, after all it works
2. Try to modify the attributes-1.1 schema to allow mixed content.   
Today anyway this is beyond my schema-fu.  In any case mixed content  
is pretty evil, we should try to avoid it if possible.
3. Introduce an xml-attribute element in config.xml.  This is going  
to require bigger changes in the object model holding the values:  
we'll need either a new element or a flag to tell it to write out  
<xml-attribute...> rather than <attribute...>

(3) is probably the most plausible way to go, but I'm not  
enthusiastic about cramming this into 1.1.  I think (1) for 1.1  
followed by more thought and perhaps (3) for 1.2 is the way to go.

Thoughts?

thanks
david jencks


Re: The evil of mixed content rears its ugly head in the config.xml local-attributes-1.1 schema

Posted by John Sisson <jr...@gmail.com>.
FYI, you will pronably get a bit more error output with my recent 
changes in

http://svn.apache.org/viewvc?rev=410704&view=rev 

but my changes will get rid of the errorhandler warning messages. See

http://issues.apache.org/jira/browse/GERONIMO-2069?page=all for details.


John

David Jencks wrote:
>
> On May 31, 2006, at 7:52 PM, Matt Hogstrom wrote:
>
>> I think waiting makes sense except I think the ugly message will 
>> confuse users.  Is there a fix to at least eliminate this message in 
>> the interim ?
>
> java -jar bin/server.jar >/dev/null :-)
>
> I'm not sure this is an immediate problem.  You won't override the 
> default environment elements unless you are setting up a really big 
> system with extreme customization: i.e. only really advanced users are 
> likely to encounter this.  We encountered this in the tck setup 
> because we modified the default environments to include basic setup 
> modules that otherwise would have to be added to every plan.  I don't 
> think this is a normal use case.
>
> thanks
> david jencks
>
>>
>> David Jencks wrote:
>>> Now that we have a schema for config.xml it's become more painfully 
>>> obvious that we are putting mixed content into the attribute 
>>> elements of config.xml.  You can override an xml-attribute in a 
>>> gbean such as the <defaultEnvironment> elements in the builders by 
>>> putting the override xml right into an attribute element in 
>>> config.xml.  This works great and we use it in the tck setup.
>>> The schema validation we now seem to be doing is emitting warnings 
>>> like:
>>> Booting Geronimo Kernel (in Java 1.4.2_09)...
>>> Warning: validation was turned on but an org.xml.sax.ErrorHandler 
>>> was not
>>> set, which is probably not what is desired.  Parser will use a default
>>> ErrorHandler to print the first 10 errors.  Please call
>>> the 'setErrorHandler' method to fix this.
>>> Error: URI=null Line=105: cvc-complex-type.2.2: Element 'attribute' 
>>> must have no element [children], and the value must be valid.
>>> Error: URI=null Line=125: cvc-complex-type.2.2: Element 'attribute' 
>>> must have no element [children], and the value must be valid.
>>> Error: URI=null Line=149: cvc-complex-type.2.2: Element 'attribute' 
>>> must have no element [children], and the value must be valid.
>>> Error: URI=null Line=179: cvc-complex-type.2.2: Element 'attribute' 
>>> must have no element [children], and the value must be valid.
>>> Error: URI=null Line=207: cvc-complex-type.2.2: Element 'attribute' 
>>> must have no element [children], and the value must be valid.
>>> so... what to do??
>>> 1. ignore these messages, after all it works
>>> 2. Try to modify the attributes-1.1 schema to allow mixed content.  
>>> Today anyway this is beyond my schema-fu.  In any case mixed content 
>>> is pretty evil, we should try to avoid it if possible.
>>> 3. Introduce an xml-attribute element in config.xml.  This is going 
>>> to require bigger changes in the object model holding the values: 
>>> we'll need either a new element or a flag to tell it to write out 
>>> <xml-attribute...> rather than <attribute...>
>>> (3) is probably the most plausible way to go, but I'm not 
>>> enthusiastic about cramming this into 1.1.  I think (1) for 1.1 
>>> followed by more thought and perhaps (3) for 1.2 is the way to go.
>>> Thoughts?
>>> thanks
>>> david jencks
>
>


Re: The evil of mixed content rears its ugly head in the config.xml local-attributes-1.1 schema

Posted by David Jencks <da...@yahoo.com>.
On May 31, 2006, at 7:52 PM, Matt Hogstrom wrote:

> I think waiting makes sense except I think the ugly message will  
> confuse users.  Is there a fix to at least eliminate this message  
> in the interim ?

java -jar bin/server.jar >/dev/null :-)

I'm not sure this is an immediate problem.  You won't override the  
default environment elements unless you are setting up a really big  
system with extreme customization: i.e. only really advanced users  
are likely to encounter this.  We encountered this in the tck setup  
because we modified the default environments to include basic setup  
modules that otherwise would have to be added to every plan.  I don't  
think this is a normal use case.

thanks
david jencks

>
> David Jencks wrote:
>> Now that we have a schema for config.xml it's become more  
>> painfully obvious that we are putting mixed content into the  
>> attribute elements of config.xml.  You can override an xml- 
>> attribute in a gbean such as the <defaultEnvironment> elements in  
>> the builders by putting the override xml right into an attribute  
>> element in config.xml.  This works great and we use it in the tck  
>> setup.
>> The schema validation we now seem to be doing is emitting warnings  
>> like:
>> Booting Geronimo Kernel (in Java 1.4.2_09)...
>> Warning: validation was turned on but an org.xml.sax.ErrorHandler  
>> was not
>> set, which is probably not what is desired.  Parser will use a  
>> default
>> ErrorHandler to print the first 10 errors.  Please call
>> the 'setErrorHandler' method to fix this.
>> Error: URI=null Line=105: cvc-complex-type.2.2: Element  
>> 'attribute' must have no element [children], and the value must be  
>> valid.
>> Error: URI=null Line=125: cvc-complex-type.2.2: Element  
>> 'attribute' must have no element [children], and the value must be  
>> valid.
>> Error: URI=null Line=149: cvc-complex-type.2.2: Element  
>> 'attribute' must have no element [children], and the value must be  
>> valid.
>> Error: URI=null Line=179: cvc-complex-type.2.2: Element  
>> 'attribute' must have no element [children], and the value must be  
>> valid.
>> Error: URI=null Line=207: cvc-complex-type.2.2: Element  
>> 'attribute' must have no element [children], and the value must be  
>> valid.
>> so... what to do??
>> 1. ignore these messages, after all it works
>> 2. Try to modify the attributes-1.1 schema to allow mixed  
>> content.  Today anyway this is beyond my schema-fu.  In any case  
>> mixed content is pretty evil, we should try to avoid it if possible.
>> 3. Introduce an xml-attribute element in config.xml.  This is  
>> going to require bigger changes in the object model holding the  
>> values: we'll need either a new element or a flag to tell it to  
>> write out <xml-attribute...> rather than <attribute...>
>> (3) is probably the most plausible way to go, but I'm not  
>> enthusiastic about cramming this into 1.1.  I think (1) for 1.1  
>> followed by more thought and perhaps (3) for 1.2 is the way to go.
>> Thoughts?
>> thanks
>> david jencks


Re: The evil of mixed content rears its ugly head in the config.xml local-attributes-1.1 schema

Posted by Matt Hogstrom <ma...@hogstrom.org>.
I think waiting makes sense except I think the ugly message will confuse users.  Is there a fix to 
at least eliminate this message in the interim ?

David Jencks wrote:
> Now that we have a schema for config.xml it's become more painfully 
> obvious that we are putting mixed content into the attribute elements of 
> config.xml.  You can override an xml-attribute in a gbean such as the 
> <defaultEnvironment> elements in the builders by putting the override 
> xml right into an attribute element in config.xml.  This works great and 
> we use it in the tck setup.
> 
> The schema validation we now seem to be doing is emitting warnings like:
> 
> Booting Geronimo Kernel (in Java 1.4.2_09)...
> Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
> set, which is probably not what is desired.  Parser will use a default
> ErrorHandler to print the first 10 errors.  Please call
> the 'setErrorHandler' method to fix this.
> Error: URI=null Line=105: cvc-complex-type.2.2: Element 'attribute' must 
> have no element [children], and the value must be valid.
> Error: URI=null Line=125: cvc-complex-type.2.2: Element 'attribute' must 
> have no element [children], and the value must be valid.
> Error: URI=null Line=149: cvc-complex-type.2.2: Element 'attribute' must 
> have no element [children], and the value must be valid.
> Error: URI=null Line=179: cvc-complex-type.2.2: Element 'attribute' must 
> have no element [children], and the value must be valid.
> Error: URI=null Line=207: cvc-complex-type.2.2: Element 'attribute' must 
> have no element [children], and the value must be valid.
> 
> so... what to do??
> 
> 1. ignore these messages, after all it works
> 2. Try to modify the attributes-1.1 schema to allow mixed content.  
> Today anyway this is beyond my schema-fu.  In any case mixed content is 
> pretty evil, we should try to avoid it if possible.
> 3. Introduce an xml-attribute element in config.xml.  This is going to 
> require bigger changes in the object model holding the values: we'll 
> need either a new element or a flag to tell it to write out 
> <xml-attribute...> rather than <attribute...>
> 
> (3) is probably the most plausible way to go, but I'm not enthusiastic 
> about cramming this into 1.1.  I think (1) for 1.1 followed by more 
> thought and perhaps (3) for 1.2 is the way to go.
> 
> Thoughts?
> 
> thanks
> david jencks
> 
> 
> 
> 

Re: The evil of mixed content rears its ugly head in the config.xml local-attributes-1.1 schema

Posted by Jason Dillon <ja...@planet57.com>.
(3) seems like a good direction.

Probably safer to wait until 1.1 is out, so +1 to fixing this in 1.2

--jason


On 5/31/06, David Jencks <da...@yahoo.com> wrote:
> Now that we have a schema for config.xml it's become more painfully
> obvious that we are putting mixed content into the attribute elements
> of config.xml.  You can override an xml-attribute in a gbean such as
> the <defaultEnvironment> elements in the builders by putting the
> override xml right into an attribute element in config.xml.  This
> works great and we use it in the tck setup.
>
> The schema validation we now seem to be doing is emitting warnings like:
>
> Booting Geronimo Kernel (in Java 1.4.2_09)...
> Warning: validation was turned on but an org.xml.sax.ErrorHandler was
> not
> set, which is probably not what is desired.  Parser will use a default
> ErrorHandler to print the first 10 errors.  Please call
> the 'setErrorHandler' method to fix this.
> Error: URI=null Line=105: cvc-complex-type.2.2: Element 'attribute'
> must have no element [children], and the value must be valid.
> Error: URI=null Line=125: cvc-complex-type.2.2: Element 'attribute'
> must have no element [children], and the value must be valid.
> Error: URI=null Line=149: cvc-complex-type.2.2: Element 'attribute'
> must have no element [children], and the value must be valid.
> Error: URI=null Line=179: cvc-complex-type.2.2: Element 'attribute'
> must have no element [children], and the value must be valid.
> Error: URI=null Line=207: cvc-complex-type.2.2: Element 'attribute'
> must have no element [children], and the value must be valid.
>
> so... what to do??
>
> 1. ignore these messages, after all it works
> 2. Try to modify the attributes-1.1 schema to allow mixed content.
> Today anyway this is beyond my schema-fu.  In any case mixed content
> is pretty evil, we should try to avoid it if possible.
> 3. Introduce an xml-attribute element in config.xml.  This is going
> to require bigger changes in the object model holding the values:
> we'll need either a new element or a flag to tell it to write out
> <xml-attribute...> rather than <attribute...>
>
> (3) is probably the most plausible way to go, but I'm not
> enthusiastic about cramming this into 1.1.  I think (1) for 1.1
> followed by more thought and perhaps (3) for 1.2 is the way to go.
>
> Thoughts?
>
> thanks
> david jencks
>
>