Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2591

BeansXmlStreamParser does not correctly handle namespaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.2.Final
    • 3.1.1.Final, 3.0.6.Final
    • None
    • None
    • Hide

      Attempt to use alternatives in the following XML file:

      beans.xml
      <beans
              xmlns="http://java.sun.com/xml/ns/javaee" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xmlns:weld="http://jboss.org/schema/weld/beans">
          <weld:scan>
              <weld:exclude name="my.package.ExcludeThis"/>
          </weld:scan>
          <alternatives>
              <class&gt;
                  my.package.UseThis
              </class&gt;
          </alternatives>
      </beans>
      
      Show
      Attempt to use alternatives in the following XML file: beans.xml <beans xmlns= "http: //java.sun.com/xml/ns/javaee" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xmlns:weld= "http: //jboss.org/schema/weld/beans" > <weld:scan> <weld:exclude name= "my. package .ExcludeThis" /> </weld:scan> <alternatives> < class& gt; my. package .UseThis </ class& gt; </alternatives> </beans>

      When parsing a beans.xml, and entering /beans/scan, the XML stream parser accepts a number of namespaces defined in org.jboss.weld.xml.BeansXmlStreamParser.SCANNING_URIS.

      When a matching element is found, execution will jump to parseScan. This method in turn will continue until the expression isEnd(event, SCAN) is true. isEnd(XMLEvent, String) will call isEnd(event, name, JAVAEE_URIS).

      SCANNING_URIS is a super set of JAVAEE_URIS with the additional entry http://jboss.org/schema/weld/beans_; it is thus possible to start parsing a scan element, but if using the _weld namespace, parsing will not stop until the end of the stream is reached. Because of the forgiving nature of the parser, no error messages will be generated.

              manovotn Matěj Novotný
              henpal_truesec Henrik Palmér (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: