xsd2html2xml icon indicating copy to clipboard operation
xsd2html2xml copied to clipboard

Error on Enumerations

Open j-lixi opened this issue 6 years ago • 2 comments

Hi, I'm getting an error occurring during the transformation:

<string>:0:0:ERROR:XSLT:ERR_OK: RAN get-suffix                     ON xs:simpleType        NAMED yesNoList           
file:/C:/Users/john/Desktop/Repository/MichielCM.xsd2html2xml/handlers/enumerations.xsl:60:0:ERROR:XSLT:ERR_OK: runtime error, element 'attribute'
<string>:0:0:ERROR:XSLT:ERR_OK: xsl:attribute: Cannot add attributes to an element if children have been already added to the element.

Here is the part of the schema that is triggering the error:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
	<xs:element name="Package">
		<xs:complexType>
			<xs:attribute name="Address" type="yesNoList" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="yesNoList">
		<xs:restriction base="xs:token">
			<xs:enumeration value="No"/>
			<xs:enumeration value="Yes"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>

This error does not occur on versions 3.2 and earlier.

Thanks!

j-lixi avatar Jun 12 '19 04:06 j-lixi

Hi, this probably works fine in Release 3.3, right? Just not in the current commit?

If so, I fixed the problem in the latest commit.

MichielCM avatar Jun 13 '19 16:06 MichielCM

Thanks Michiel, the fix works great! The error does occur on 3.3 when I use our full schema. But, I'm happy to use the latest commit. Thankyou.

j-lixi avatar Jun 13 '19 22:06 j-lixi