Hi,
I have an issue where an element seems to be mapped to the wrong type. I'm
not sure if this is an issue with the upstream xsl or with generateDS,
since both are pretty complex. After some digging however, I'm leaning
towards an error with generateDS.
The xsl sources I'm using are available here
http://www.accellera.org/XMLSchema/IPXACT/1685-2014/ The issue I'm looking
at in particular can be found in memoryMap.xsl. In that file, there's a
type called MemoryMapType with a child element called addressBlock
If I'm using the original sources I will get something like this in the
generated MemoryMapType class
elif nodeName_ == 'addressBlock':
obj_ = bankedBlockType.factory()
obj_.build(child_)
self.addressBlock.append(obj_)
obj_.original_tagname_ = 'addressBlock'
elif nodeName_ == 'bank':
obj_ = localBankedBankType.factory()
obj_.build(child_)
self.bank.append(obj_)
obj_.original_tagname_ = 'bank'
This doesn't work with my XML files as they expect and addressBlockType
instead of bankedBlockType.
If I remove a frew lines in memoryMap.xsd as in the diff below, I get the
result I expect
diff --git a/2014/memoryMap.xsd b/2014/memoryMap.xsd
index bd72631..1caefd7 100644
--- a/2014/memoryMap.xsd
+++ b/2014/memoryMap.xsd
@@ -117,7 +117,6 @@
</xs:complexType>
</xs:element>
<xs:group ref="ipxact:addressSpecifier"/>
- <xs:group ref="ipxact:bankBase"/>
</xs:sequence>
<xs:attribute name="bankAlignment"
type="ipxact:bankAlignmentType" use="required">
<xs:annotation>
@@ -140,7 +139,6 @@
</xs:complexType>
</xs:element>
<xs:group ref="ipxact:addressSpecifier"/>
- <xs:group ref="ipxact:localBankBase"/>
</xs:sequence>
<xs:attribute name="bankAlignment"
type="ipxact:bankAlignmentType" use="required">
<xs:annotation>
@@ -206,7 +204,6 @@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:group ref="ipxact:bankBase"/>
</xs:sequence>
<xs:attribute name="bankAlignment"
type="ipxact:bankAlignmentType" use="required"/>
<xs:attributeGroup ref="ipxact:id.att"/>
@@ -224,7 +221,6 @@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:group ref="ipxact:localBankBase"/>
</xs:sequence>
<xs:attribute name="bankAlignment"
type="ipxact:bankAlignmentType" use="required"/>
<xs:attributeGroup ref="ipxact:id.att"/>
elif nodeName_ == 'addressBlock':
obj_ = addressBlockType.factory()
obj_.build(child_)
self.addressBlock.append(obj_)
obj_.original_tagname_ = 'addressBlock'
elif nodeName_ == 'bank':
obj_ = addressBankType.factory()
obj_.build(child_)
self.bank.append(obj_)
obj_.original_tagname_ = 'bank'
Could this be an issue with the type resolving in generateDS, or is it an
upstream error? I'm sorry that I haven't got a better isolated testcase.
Still trying to figure things out
//Olof
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users