Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

AnyContent not definable #113

Open
hcw70 opened this issue Apr 2, 2019 · 0 comments
Open

AnyContent not definable #113

hcw70 opened this issue Apr 2, 2019 · 0 comments

Comments

@hcw70
Copy link

hcw70 commented Apr 2, 2019

When i define an element of "TDocumentable" with the below type, i get an error

Unable to convert DOM node {http://deuta.de/config/DeutaMsgDatabase}shortdesc at [14:36] to binding

when i create a node like this:

                            <doc content-type="dita-topic">
                                <shortdesc>My data types</shortdesc>
                            </doc>

How can i define a type which is loaded by pyxb but not further validated?

Type definition:

    <xs:complexType name="TDocumentable" abstract="true">
        <xs:complexContent>
            <xs:extension base="TBase">
                <xs:choice minOccurs="0" maxOccurs="1">
                    <xs:element name="doc" type="TDoc"/>
                </xs:choice>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="TAnyContent" mixed="true">
        <xs:complexContent>
            <xs:extension base="TBase">
                <xs:sequence>
                    <xs:any minOccurs="0" maxOccurs="unbounded"
                        processContents="skip"></xs:any>
                </xs:sequence>
                <xs:anyAttribute/>
            </xs:extension>            
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="TDoc">
        <xs:complexContent>
            <xs:extension base="TAnyContent">
                <xs:attribute name="content-type" use="required">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:enumeration value="html-para">
                                <xs:annotation><xs:documentation>HTML content type within "p" tag
                                </xs:documentation></xs:annotation>
                            </xs:enumeration>
                            <xs:enumeration value="dita-section">
                                <xs:annotation><xs:documentation>DITA content type within "topic/section" tag
                                </xs:documentation></xs:annotation>
                            </xs:enumeration>
                            <xs:enumeration value="dita-topic">
                                <xs:annotation><xs:documentation>DITA content type within "topic" tag
                                </xs:documentation></xs:annotation>
                            </xs:enumeration>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant