I have opened WSCOMMONS-436 and attached simple tests.

I was incorrect in the second issue mentioned. Once the source attribute is 
added, the markup is complete.

Thanks for your help.

Fady

-----Message d'origine-----
De : Benson Margulies [mailto:[email protected]] 
Envoyé : mercredi 4 février 2009 16:56
À : [email protected]
Objet : Re: Markup from annotations not returned with XmlSchema 1.4.3

Looks like you found a bug. I don't suppose you could contribute a unit test
that fails as a result of this? Please open a JIRA in any case, and I'll
look to make a fix.

On Wed, Feb 4, 2009 at 10:53 AM, Andreas Veithen
<[email protected]>wrote:

> Can you open a JIRA issue for this problem?
>
> Andreas
>
> On Wed, Feb 4, 2009 at 09:21, Fady Moussallam <[email protected]> wrote:
> > 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