Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313566 - JAXB Externalized Metadata: Schema gen incorrect for XmlAnyAttribute containing xml-path without namespace
Summary: JAXB Externalized Metadata: Schema gen incorrect for XmlAnyAttribute containi...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 308677
  Show dependency tree
 
Reported: 2010-05-19 12:18 EDT by David McCann CLA
Modified: 2022-06-09 10:31 EDT (History)
0 users

See Also:


Attachments
Contains proposed fix and test case mods (11.73 KB, patch)
2010-05-19 13:20 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McCann CLA 2010-05-19 12:18:43 EDT
The schema gen for an XmlAnyAttribute with a non-namespace qualified xml-path is not working correctly.  The 'any' is being applied to the second last path element, as opposed to the last one.  For example, the following:

<xml-any-attribute java-attribute="stuff" xml-path="read-only/stuff" />

Should result in:

...
<xsd:element name="read-only">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="stuff">
        <xsd:complexType>
          <xsd:anyAttribute processContents="skip" namespace="##other"/>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>
...

But currently we get:

...
<xsd:element name="read-only">
  <xsd:complexType>
    <xsd:anyAttribute processContents="skip" namespace="##other"/>
  </xsd:complexType>
</xsd:element>
...
Comment 1 David McCann CLA 2010-05-19 13:20:00 EDT
Created attachment 169157 [details]
Contains proposed fix and test case mods

Modified SchemaGenerator such that if we are dealing with an 'any' we process the last path fragment, which is the one the 'any' will be applied to.

Added 2 XSD files with xml-path info for testing.

Modified AnyAttributeTests to validate against the exisgin and new XSD files to verify the last path element is being processed correctly.
Comment 2 David McCann CLA 2010-05-19 14:37:20 EDT
Reviewed by:  matt.macivor@oracle.com
Tests: unit tests pass as expected; AnyAttributeMappingTestCases
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:14:44 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:31:01 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink