Liquid XML Studio
XsdEditorNotation OpenContent
See Also Send Feedback
XSD Editor > Graphical Notation Overview > XsdEditorNotation OpenContent

Glossary Item Box

ShowGraphical Representation

ShowSummary

The xs:openContent provides an mechanism for making XSD's extensible.

The xs:openContent node tells the validator the containing element (in the instance document) can contain additional XML elements that are not defined within this schema. Prior to XSD 1.1 the only way to do with was via the xs:any node, however xs:openContent allows a greater level of control and freedom.

ShowCreating

The xs:openContent node can be added to an xs:element or xs:complexType by right clicking on it and selecting the Open Content menu item, or selecting the () item from the toolbar.

The xs:schema element can also have a xs:defaultOpenContent node which works the same as the xs:openContent node, but is applied to all elements defined within the schema.

If an xs:defaultOpenContent node is defined for a schema then it can be turned off for a given element by declaring an xs:openContent node and setting the mode=none

ShowProperties

Id user defined ID to uniquely identify the entity within the schema
Mode

Valid values

  • none - no additional elements may be contained within the instance element
  • suffix - additional elements must appear after all the ones defined explicitly in the schema
  • interleave - additional elements can appear between elements defined within the schema.

 The xs:openContent node can have a child xs:any which defines the rules that additional elements must comply with.

ShowSample

The following XSD code 

XSD Sample Code Copy Code
    <element name="Book">
        <complexType>
            <openContent mode="interleave">
                <any namespace="http://www.book.org"
                     processContents="strict" />
            </openContent>
            <sequence>
                <element name="Title"
                         type="string" />
                <element name="Author"
                         type="string" />
                <element name="Date"
                         type="gYear" />
                <element name="ISBN"
                         type="string" />
                <element name="Publisher"
                         type="string" />
            </sequence>
        </complexType>
    </element>

Will be represented like this 

Resulting XML Document Copy Code
        <Book xmlns:bk="http://www.book.org">
                <bk:Binding>Hardcover</bk:Binding>
                <Title>My Life and Times</Title>
                <bk:Size>5 x 7</bk:Size>
                <Author>Paul McCartney</Author>
                <bk:InStock>true</bk:InStock>
                <Date>1998</Date>
                <bk:Category>Non-fiction</bk:Category>
                <ISBN>1-56592-235-2</ISBN>
                <bk:NumPages>299</bk:NumPages>
                <Publisher>McMillin Publishing</Publisher>
                <bk:AvailableOnTape>false</bk:AvailableOnTape>
        </Book>

ShowInline Properties

Properties that apply to a type are shown inline at the bottom of the items container.

Values that are inherited from the base types are shown in brackets, values specifically set against the item are shown without brackets.

If a facet is not valid for a given type (typically because of its data type), then its value is shown in red.

Inline properties can be disabled in the Options.

 

 

 

 

See Also