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

Does not work on attributes #1

Closed
michael-o opened this issue Mar 26, 2015 · 3 comments
Closed

Does not work on attributes #1

michael-o opened this issue Mar 26, 2015 · 3 comments
Assignees

Comments

@michael-o
Copy link

I have this in my code

<xs:attribute name="fuckYouMicrosoft" type="xs:boolean" fixed="true" />

to work around a bug in .NET. Unfortuantely, this default value is completely ignored. Can you make this work for attributes too?

@fbdo
Copy link
Owner

fbdo commented Mar 31, 2015

Hi Michael, I just saw your message, sorry for the delay. I will check and come back to you. I'm a bit busy last days so be a patient. See you!

@fbdo fbdo self-assigned this Mar 31, 2015
@fbdo
Copy link
Owner

fbdo commented Apr 1, 2015

Please, check the source code, more precisely the integration test, now you can find a external global binding in jaxb2-fixed-value/src/it/fixedvalue-it/src/main/resources/binding.xjb. I figured out that is possible to have fixed values for attributes using the basic xjc features, without any plugin, you only need to declare the element:

<jaxb:globalBindings fixedAttributeAsConstantProperty="true" />

Check also the schema.xsd and the Product.java file generated, you can see the attribute with the desired fixed value now.

Thanks to point out this missing feature, I will add a comment in the main page to help others.

@fbdo fbdo closed this as completed Apr 1, 2015
@michael-o
Copy link
Author

Hi Fabio,
sorry for the late response. The IT did the trick. Thank you. The doc update looks good, though you should link the note about attributes in the first paragraph directly to the heading at the bottom.

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

No branches or pull requests

2 participants