Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCD bindings do not support custom/vendor customization elements #1047

Open
Tomas-Kraus opened this issue Sep 28, 2014 · 5 comments
Open

SCD bindings do not support custom/vendor customization elements #1047

Tomas-Kraus opened this issue Sep 28, 2014 · 5 comments

Comments

@Tomas-Kraus
Copy link
Member

I wrote a number of XJC plugins, some of these plugins can be customized via binding files.

For instance, I can do the following:

<jaxb:bindings version="1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 	xmlns:xs="http://www.w3.org/2001/XMLSchema" 	xmlns:jsonix="http://jsonix.highsource.org/customizations" 	jaxb:extensionBindingPrefixes="jsonix">

	<jaxb:bindings schemaLocation="w3c/1999/xlink.xsd" node="/xs:schema">
		<jsonix:packageMapping packageName="org.hisrc.w3c.xlink.v_1_0" spaceName="XLink_1_0"/>
	</jaxb:bindings>
</jaxb:bindings>

If my Jsonix plugin is activated, XJC will know that jsonix:packageMapping is a customization element for Jsonix (plugin API allows saying what your customization namespace URI is and which local names you expect).

SCD seems to be a more advanced way to address schema elements. I.e.

<jaxb:bindings scd="x-schema::xlink" xmlns:xlink="http://www.w3.org/1999/xlink" ... />

addresses the XLink schema logically via namespace URI. Forget the files, this is perfect. Much more versatile than schemaLocation and node. I guess episodes would not work without SCD in first place. For my scenarios it would for instance help with #1047.

My problem is that SCD does not allow custom elements. So this:

<jaxb:bindings version="1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 	xmlns:xs="http://www.w3.org/2001/XMLSchema" 	xmlns:jsonix="http://jsonix.highsource.org/customizations" 	jaxb:extensionBindingPrefixes="jsonix">

	<jaxb:bindings scd="x-schema::xlink" xmlns:xlink="http://www.w3.org/1999/xlink"> 		<jsonix:packageMapping packageName="org.hisrc.w3c.xlink.v_1_0" spaceName="XLink_1_0"/>
	</jaxb:bindings>
</jaxb:bindings>

I get the following error:

[ERROR] Error while parsing schema(s).Location [ file:/C:/Projects/workspaces/ogc-ng/w3c-schemas/xlink/1999/src/main/resources/xlink-v_1_0.jsonix.xjb{8,89}].
org.xml.sax.SAXParseException; systemId: file:/C:/Projects/workspaces/ogc-ng/w3c-schemas/xlink/1999/src/main/resources/xlink-v_1_0.jsonix.xjb; lineNumber: 8; columnNumber: 89; cvc-elt.1: Cannot find the declaration of element 'jsonix:packageMapping'.

Clearly, SCD does not process custom configuration elements whereas schemaLocation plus node do process.

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Reported by lexi

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
Was assigned to yaroska

@Tomas-Kraus
Copy link
Member Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JAXB-1047

@Tomas-Kraus
Copy link
Member Author

@scodeman
Copy link

scodeman commented May 12, 2020

has there been any investigation on this item ?

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

No branches or pull requests

4 participants