Comments (1)
Note that GoComply/xsd2go generates this correctly. If xgen
were to generate this correctly, there would be another issue for xsd:extends
where the parent type has mixed="true"
and the child type has mixed="false"
or unspecified. Specifically, xgen
makes the choice to generate the following code for such an entry:
// SharedTypeCustomAttributes ...
type SharedTypeCustomAttributes struct {
XMLName xml.Name `xml:"sharedType.CustomAttributes"`
Customattribute []*SharedTypeCustomAttribute `xml:"custom-attribute"`
}
// SharedTypeCustomAttribute ...
type SharedTypeCustomAttribute struct {
XMLName xml.Name `xml:"sharedType.CustomAttribute"`
AttributeidAttr string `xml:"attribute-id,attr"`
XmlLangAttr string `xml:"xml:lang,attr,omitempty"`
Value []string `xml:"value"`
}
// SharedTypeSiteSpecificCustomAttributes ...
type SharedTypeSiteSpecificCustomAttributes struct {
XMLName xml.Name `xml:"sharedType.SiteSpecificCustomAttributes"`
Customattribute []*SharedTypeSiteSpecificCustomAttribute `xml:"custom-attribute"`
}
// SharedTypeSiteSpecificCustomAttribute ...
type SharedTypeSiteSpecificCustomAttribute struct {
XMLName xml.Name `xml:"sharedType.SiteSpecificCustomAttribute"`
SiteidAttr string `xml:"site-id,attr,omitempty"`
*SharedTypeCustomAttribute
}
If SharedTypeCustomAttribute
gets InnerXml
generated, then SharedTypeSiteSpecificCustomAttribute
will also implicitly get InnerXml
through the embedding. This is something not well defined in the XSD specification, but that discussions from 2005 on the XSD mailing list and 2012 on StackOverflow strongly suggest that the mixed
attribute is not inherited. That means that SharedTypeSiteSpecificCustomAttribute
would need to be implemented separately and not via embedded inheritance since the mixed
attribute differs (or, more specifically, that mixed=false
is stricter than mixed=true
). (The optimization could be kept if the mixed
attributes matched, and I believe that there is a bug in the SFCC impex XSD which I have reported into the SFCC black hole.)
from xgen.
Related Issues (20)
- Parsing the svg 1.1 xsd produces no code HOT 1
- Go Generator - Main type generates incorrect xml: tag HOT 1
- xgen not generating omitempty for minOccurs = 0 & not creating arrays when maxOccurs = 'unbounded'
- Go: infinite self-referencing type generated for embedded simpleType with base restriction
- Empty type on xsd:element not handled as anyType ?
- configurable TypeScript generators for specific xml parsers
- Errors in generated Go code: <modelName> redeclared in this block HOT 1
- Unexpected directory creation and wrong filename (extra extension) when using -o to specify a file
- xsd:byte should be int8 instead of byte in Go HOT 2
- Enums not generated properly in certain circumstances
- the generated go file contains a field in a struct that is not in the definition
- xs:union is interpreted wrongly
- obix xsd breaks xgen
- How to install?? HOT 1
- Julia language support.
- Update Rust Exporter
- Redeclaration in output go code
- Type overrides?
- Problem with parsing of ReqIF xsd specification
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xgen.