Hello,

I am seeing a regression between the previous version of XmlSchema I was using 
(1.4) and the latest (1.4.3).

I have an XML schema where the schema element has these annotations:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://legstar.com/test/coxb/lsfileae";
xmlns="http://legstar.com/test/coxb/lsfileae";
xmlns:xsns="http://legstar.com/test/coxb/lsfileae";
xmlns:cb="http://www.legsem.com/xml/ns/coxb";
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb";
jaxb:version="2.0"
jaxb:extensionBindingPrefixes="cb"
elementFormDefault="qualified">
 <xs:annotation><xs:appinfo>
 <jaxb:schemaBindings>
 <jaxb:package  name="com.legstar.test.coxb.lsfileae"/>
 </jaxb:schemaBindings>
 </xs:appinfo></xs:annotation>

On return from reading the file, the XmlSchema has an XmlSchemaAnnotation but 
with no content.

This is due to this code in SchemaBuilder#handleAppInfo(Element content):

                if (!content.hasAttribute("source")) {
                        return null;
                }
 
This pretty much forces the appinfo element to hold a source attribute. But I 
don't believe the source attribute is mandatory. In 1.4, the code was like this:

                if (!content.hasAttribute("source")
                                && (markup == null || markup.getLength() <= 0)) 
{
                        return null;
                }

This is not the only issue. Even if I set a source attribute, I still don't get 
the markup completely. This is due to the fact that you replaced this code from 
1.4:

            NodeList markup = getChildren(content);

With this code (1.4.3):

            NodeList markup = new DocumentFragmentNodeList(content);

The issue is that DocumentFragmentNodeList doesn't process the appinfo children 
recursively, it just processes direct children of appinfo. In my case, the 
markup would contain jaxb:schemaBindings but not jaxb:package.

Any ideas or advice would be greatly appreciated.

Fady





Reply via email to