Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested/recursed elements don't allow attributes #26

Open
iainism opened this issue Sep 1, 2014 · 4 comments
Open

Nested/recursed elements don't allow attributes #26

iainism opened this issue Sep 1, 2014 · 4 comments

Comments

@iainism
Copy link

iainism commented Sep 1, 2014

If my XSD has a structure where elements can be nested into themselves then it seems only the top-level element can have attributes added to it when editing, i.e. when using an XSD with a structure like:

myGroupType:groupElement
-->myGroupType:groupElement
-->myElementType:terminalElement

@iainism iainism changed the title Nesting elements don't inherit attributes Nested/recursed elements don't allow attributes Sep 1, 2014
@iainism
Copy link
Author

iainism commented Sep 1, 2014

Seems to be a regression (or closely related) to the issue in: #13

@bbpennel
Copy link
Member

bbpennel commented Sep 2, 2014

It seems to work correctly for the MODS demo with the relatedItem element. It may be a slightly different situation, could you share a schema that demonstrates the problem?

@iainism
Copy link
Author

iainism commented Sep 3, 2014

Hi, this is the XSD that's proving to be problematic for me:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2009 sp1 (http://www.altova.com) by Vector Employee (Vector Informatik GmbH) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:Requirements="Vector.CANoe.DiVa.Requirements" targetNamespace="Vector.CANoe.DiVa.Requirements" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="RequirementCollection">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Requirements:RequirementGroup" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="RequirementType">
        <xs:attribute name="Name" type="xs:string" use="required"/>
        <xs:attribute name="Number" type="xs:string"/>
        <xs:attribute name="Description" type="xs:string"/>
        <xs:attribute name="ExternalLink" type="xs:string"/>
    </xs:complexType>
    <xs:element name="RequirementGroup">
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="Requirements:RequirementType">
                    <xs:sequence>
                        <xs:element ref="Requirements:RequirementGroup" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="Requirements:Requirement" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="Requirement">
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="Requirements:RequirementType">
                    <xs:sequence>
                        <xs:element name="DiVaTestRef" minOccurs="0" maxOccurs="unbounded">
                            <xs:complexType>
                                <xs:attribute name="InstructionPath" type="xs:string" use="required"/>
                            </xs:complexType>
                        </xs:element>
                        <xs:element ref="Requirements:Requirement" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element name="Comment" minOccurs="0" maxOccurs="unbounded">
                            <xs:complexType>
                                <xs:attribute name="Text" type="xs:string" use="required"/>
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                    <xs:attribute name="GeneralRequirement" type="xs:boolean" default="false"/>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>
</xs:schema>

@iainism
Copy link
Author

iainism commented Jan 21, 2015

Bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants