I think this comes from the fact that it&#39;s theoretically possible to have multiple beans.xml entries for a single BDA currently and that is sort of a cross-beans.xml-check. If Pete nukes the multiple beans.xml support that should rightfully disappear, I think.<br>
<br><div class="gmail_quote">On Sun, Jun 6, 2010 at 10:54 PM, Marcin Mieszek <span dir="ltr">&lt;<a href="mailto:marcin.mieszek@gmail.com">marcin.mieszek@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I am working right now on issue:<br>
Weld WELD-379Use beans.xsd for validation of beans.xml<br>
<br>
1. Currently in MergedElements class there is a logic that checks<br>
ifsome elements occur more then once, which is not allowed:<br>
<br>
   private List&lt;BeansXmlElement&gt; getNamedElement(URL url, Element<br>
beans, String name, XmlMessage multipleViolationMessage)<br>
   {<br>
      List&lt;BeansXmlElement&gt; elements = new ArrayList&lt;BeansXmlElement&gt;();<br>
      NodeList nodeList = beans.getElementsByTagName(name);<br>
      if (nodeList.getLength() &gt; 1)<br>
      {<br>
         throw new WeldXmlException(multipleViolationMessage);<br>
      }<br>
      else if (nodeList.getLength() == 1)<br>
      {<br>
         BeansXmlElement element = BeansXmlElement.of(url, nodeList.item(0));<br>
         elements.add(element);<br>
      }<br>
      return elements;<br>
   }<br>
<br>
<br>
Such files arenot valid according to XSD schema neither. I am planning<br>
to add XSD validation during parsing of the file - it means that it<br>
won&#39;t be possible to get error with message one of:<br>
   @MessageId(&quot;001203&quot;) MULTIPLE_ALTERNATIVES,<br>
   @MessageId(&quot;001204&quot;) MULTIPLE_DECORATORS,<br>
   @MessageId(&quot;001205&quot;) MULTIPLE_INTERCEPTORS,<br>
<br>
Please let me know how you would like to proceed with it as it is more<br>
functional question then technical. For schema errors I will add new<br>
message XSD_SCHEMA_ERROR.<br>
<br>
2. Minor issue: all test beans.xml files must be changed after adding<br>
schema validation so that it references correct namespace:<br>
<br>
&lt;beans xmlns=&quot;<a href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a>&quot;<br>
   xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br>
   xsi:schemaLocation=&quot;<br>
      <a href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a><br>
      <a href="http://java.sun.com/xml/ns/javaee/beans_1_0.xsd" target="_blank">http://java.sun.com/xml/ns/javaee/beans_1_0.xsd</a>&quot;&gt;<br>
<br>
I will prepare the patch for this one as well.<br>
<br>
Cheers,<br>
<br>
Marcin<br>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>---<br>Nik<br>