Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

xs:any namespace="##any" processContents="skip" not returning data #16

Closed
glassfishrobot opened this issue Apr 8, 2004 · 17 comments
Closed

Comments

@glassfishrobot
Copy link
Contributor

Weekly build 20031215.
I am trying to specify that an element can contain anything with (see request.xsd):

<xs:element name="Request">
xs:complexType
xs:sequence
<xs:element name="Input">
xs:complexType
xs:sequence
<xs:any namespace="##any"
processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="req:requestAttributeGroup"/>
</xs:complexType>
</xs:element>

The reason for this is that we have some legacy XML that we need to integrate in
a containing document. That legacy XML can be pretty much anything and has its
own pile of non-Jaxb code to handle it.

I want to use Jaxb for the containing document and then pass on the string or
DOM Node or /whatever/ down to our other code pile.

This Schema snippet allows my example document to be validated in XMLSpy as well
as parsed by the generated Jaxb code but the "contents" are
null in the attached Java example.

Is it possible to get Jaxb to give me /something/ for the contents of ?

Thank you,
Gary

Environment

Operating System: Windows XP
Platform: PC

Affected Versions

[JWSDP1.6 (JAXB1.0.5)]

@glassfishrobot
Copy link
Contributor Author

Reported by ggregory

@glassfishrobot
Copy link
Contributor Author

Was assigned to kohsuke

@glassfishrobot
Copy link
Contributor Author

ggregory said:
Created an attachment (id=8)
XML Schema

@glassfishrobot
Copy link
Contributor Author

File: request.xsd
Attached By: ggregory

@glassfishrobot
Copy link
Contributor Author

ggregory said:
Created an attachment (id=9)
Java example using the generated schema.

@glassfishrobot
Copy link
Contributor Author

File: ResultSetJaxbParser.java
Attached By: ggregory

@glassfishrobot
Copy link
Contributor Author

ryan_shoemaker said:
Verified problem, investigating cause....

@glassfishrobot
Copy link
Contributor Author

ryan_shoemaker said:
Created an attachment (id=10)
new version of text.xsd with necessary customizations

@glassfishrobot
Copy link
Contributor Author

File: test.xsd
Attached By: ryan_shoemaker

@glassfishrobot
Copy link
Contributor Author

ggregory said:
Created an attachment (id=11)
For completness' sake, I am including our external binding.xjb, which Ryan found missing and noted by his addition of test.xsd.

@glassfishrobot
Copy link
Contributor Author

File: bindings.xjb
Attached By: ggregory

@glassfishrobot
Copy link
Contributor Author

kohsuke said:
Taking over this bug...

@glassfishrobot
Copy link
Contributor Author

kohsuke said:
This is not a bug.

The JAXB 1.0 spec doesn't support the mapping to DOM, so the RI is not
allowed to do this in the strict mode. When releasing JAXB RI 1.0.2, we
did consider doing this automatically in the extension mode (-extension switch),
but we had a concern regarding future backward compatibility support problem,
and decided to pull it off at the last moment.

The good news is, you can do this by using XJC vendor customization.
See the attached schema for how you can do this. Also check out the mailing
list archive and the release notes for more info.

AFAIK, the JAXB 2.0 spec is indeed considering this sort of binding as a default
behavior for .

@glassfishrobot
Copy link
Contributor Author

kohsuke said:
Created an attachment (id=12)
Shows how you can use xjc:dom customization to avoid this problem.

@glassfishrobot
Copy link
Contributor Author

File: test.xsd
Attached By: kohsuke

@glassfishrobot
Copy link
Contributor Author

Marked as incomplete on Thursday, April 14th 2005, 10:28:43 am

@glassfishrobot
Copy link
Contributor Author

This issue was imported from java.net JIRA JAXB-16

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant