-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Question - Set default / fixed value for an attribute #100
Comments
Hi, Is there a way of initialising by default and attribute or a const in the php class through the schema? It would be useful to define something like:
And produce: |
Hi, currently is not yet implemented, but should be not too hard to add it. A good starting point is xsd2php/src/Php/PhpConverter.php Line 376 in 5258cf8
Pull requests are welcome |
Hi, I wouldn't mind to do it however I can only work as a user of this library. If is not too hard to add it, could you label it as "feature request" or implement it? It would be really handful for integrating data coming from different sources. For instance, if raw data is stored in a different XML, this feature streamlines the self-filling of values by writing only few lines of code. Thus makes sense to describe the id of the source of the data in the schema. |
marked as feature request. feel free to submit an implementation for this feature. |
Hi,
Is it possible to set a default or fixed value for an attribute? I can set it in the xsd but then I cannot see it initialised in the PHP class.
Many thanks.
The text was updated successfully, but these errors were encountered: