Fady,

Looks like it was marked as fixed. But another user has complained
that it is still not fixed. Can you please do me a favor and upload
our schema to the JIRA below:
https://issues.apache.org/jira/browse/WSCOMMONS-153

i'll reopen the bug.

thanks,
dims

On 6/5/07, Fady Moussallam <[EMAIL PROTECTED]> wrote:
Hi,



It seems there is a bug in XmlSchemaSerializer from version 1.3.1 when
dealing with appInfo annotations which markup contains attributes and
sub-elements.



Instead of getting a serialized XML fragment like so:



<xs:annotation>

   <xs:appinfo>

      <jaxb:globalBindings generateIsSetMethod="true"/>

      <jaxb:schemaBindings>

          <jaxb:package  name="com.legstar.test.coxb.lsfileal"/>

      </jaxb:schemaBindings>

    </xs:appinfo>

</xs:annotation>



I am getting this:



<xs:annotation>

   <xs:appinfo>

      <jaxb:globalBindings/>

      <jaxb:schemaBindings/>

    </xs:appinfo>

</xs:annotation>



As you can see, attributes and inner-elements are not processed.



I traced back the issue to appendElement method where the following code:



        parent.appendChild(el);

        NamedNodeMap attributes = el.getAttributes();

        //check if child node has attribute

        //create new element and append it if found

        int attributeLength = attributes.getLength();

        for (int i = 0; i < attributeLength; i++) {

            Node n = attributes.item(i);

            //assuming attributes got to throw exception if not later

            el.setAttribute(n.getNodeName(),

                    n.getNodeValue());

        }



        //check any descendant of this node

        //if there then append its child

        NodeList decendants = el.getChildNodes();

        int decendantLength = decendants.getLength();



should probably read like this:



        parent.appendChild(el);

        NamedNodeMap attributes = elTmp.getAttributes();

        //check if child node has attribute

        //create new element and append it if found

        int attributeLength = attributes.getLength();

        for (int i = 0; i < attributeLength; i++) {

            Node n = attributes.item(i);

            //assuming attributes got to throw exception if not later

            el.setAttribute(n.getNodeName(),

                    n.getNodeValue());

        }



        //check any descendant of this node

        //if there then append its child

        NodeList decendants = elTmp.getChildNodes();

        int decendantLength = decendants.getLength();



Can anyone confirm if this is a known issue and how to get it fixed?



Thanks.



Fady










--
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to