1

i want to validate the following XML with XSD

    <ImportInstances>
        <NewInstances>
            <Instance Concept="ConceptName" SPInstanceId="SPInstanceId" Title="Title">
                <Properties>
                    <Property Name="Title" Type="Text">
                        <Values>
                            <Value>Value length max 255</Value> <!--    Value to validate -->
                        </Values>
                    </Property>
                    <Property Name="Contact" Type="User">
                        <Values>
                            <Value>user@domain.tld</Value>
                        </Values>
                    </Property>
                    <Property Name="refersToThing" Type="TypeMulti">
                        <Values>
                            <Value>Value 1</Value>
                            <Value>Value 2</Value>
                            <Value>Value 3</Value>
                            <Value>Value 4</Value>
                            <Value>Value 5</Value>
                        </Values>
                    </Property>
                    <Property Name="Description" Type="Text">
                        <Values>
                            <Value>Any text length</Value>
                        </Values>
                    </Property>
                </Properties>
            </Instance>
        </NewInstances>
        <UpdatedInstances/>
    </ImportInstances>

My Problem ist how to validate the element "Property". My condition to validate is: when the name of the element is 'Title' then the value of "Property>Values>Value" have a length of max 250. In other cases the length of the value is not important.

Is there a way how to validate this case using XSD? (version 1.0? any version?)

Benjamin

kjhughes
  • 106,133
  • 27
  • 181
  • 240
Benjamin
  • 11
  • 1

0 Answers0