skfd
skfd

Reputation: 2596

Defining pattern of text() node of complex mixed element

This question is related to that one. But somewhat extended.

Let's assume we have an xml:

<field name="test_field_0">
    Some text that is texty text.
    <subfield>Some text.</subfield>
</field>

The Scheme for it from related question:

<xs:element name="field">
    <xs:complexType mixed="true">
        <xs:sequence>
                <xs:element ref="subfield" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" />
    </xs:complexType>
</xs:element>

Now the additional requirement is that text() node of field element should be regulated by some pattern, for example, this: \p{Lu}(\p{Ll}\p{P}\p{Z})+

Upvotes: 1

Views: 222

Answers (1)

George Bina
George Bina

Reputation: 1161

XML Schema does not allow to put any constraints on the text of an element that contains mixed content.

Upvotes: 1

Related Questions