You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a complexType is defined with mixed="true", it should collect the innerXml or CDATA in addition to the tags. The examples in this ticket are generated using the SFCC catalog.xsd which also requires the xml.xsd file from https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/current/xsd/.
In most cases from SFCC files, this is presented as <custom-attribute attribute-id="foo">bar</custom-attribute>, and using xgen there's no way to get access to the bare contents of the optional<value/> tag.
Steps to reproduce the issue:
Use the XSD files mentioned above.
Run xgen -i catalog.xsd -l Go -o tmp/catalog
Describe the results you received:
Note that there's no way of getting the inner XML, only Value[].
Describe the results you expected:
A way to get the inner XML in addition to Value[].
Output of go version:
go version go1.22.3 darwin/arm64
xgen version or commit ID:
0.1.0
Environment details (OS, physical, etc.):
macOS 14.5
The text was updated successfully, but these errors were encountered:
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:
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.)
Description
If a
complexType
is defined withmixed="true"
, it should collect theinnerXml
or CDATA in addition to the tags. The examples in this ticket are generated using the SFCCcatalog.xsd
which also requires thexml.xsd
file from https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/current/xsd/.Inside of it, the following types are declared:
This generates the following Go code:
In most cases from SFCC files, this is presented as
<custom-attribute attribute-id="foo">bar</custom-attribute>
, and using xgen there's no way to get access to the bare contents of the optional<value/>
tag.Steps to reproduce the issue:
xgen -i catalog.xsd -l Go -o tmp/catalog
Describe the results you received:
Note that there's no way of getting the inner XML, only
Value[]
.Describe the results you expected:
A way to get the inner XML in addition to
Value[]
.Output of
go version
:xgen version or commit ID:
Environment details (OS, physical, etc.):
macOS 14.5
The text was updated successfully, but these errors were encountered: