XSD faces and indicators with SDL Tridion

Tridion SDL uses XML schema definitions to define content stored in Tridion components. XSD can use constraints / faces or indicators to limit the validity for XML nodes.

Chris Summers accidentally discovered some of these in the learning process, in particular, we can establish indicators minOccursand maxOccursin SDL Tridion in 2011:

<xsd:element name="someField" minOccurs="2" maxOccurs="5" type="xsd:normalizedString">

Andrei Marchuk mentions additional options in the same post:

Indicators

  • MaxValue
  • MinValue

Limitations

  • FractionDigits
  • MaxLength
  • MinLength
  • Pattern
  • TotalDigits

Btw, are these XSD-specific?

  • IsMaxValueExclusive
  • IsMinValueExclusive

How can I get the constraints * in the following Tridion schema (source)? *

<xsd:schema xmlns="http://createandbreak.net/schema/example" xmlns:tcmi="http://www.tridion.com/ContentManager/5.0/Instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://createandbreak.net/schema/example">
    <xsd:import namespace="http://www.tridion.com/ContentManager/5.0/Instance"></xsd:import>
    <xsd:annotation>
        <xsd:appinfo>
            <tcm:Labels xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
                <tcm:Label ElementName="someField" Metadata="false">someField</tcm:Label>
            </tcm:Labels>
        </xsd:appinfo>
    </xsd:annotation>
    <xsd:element name="Content">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="someField" minOccurs="2" maxOccurs="5" type="xsd:normalizedString">
                    <xsd:annotation>
                        <xsd:appinfo>
                            <tcm:ExtensionXml xmlns:tcm="http://www.tridion.com/ContentManager/5.0"></tcm:ExtensionXml>
                        </xsd:appinfo>
                    </xsd:annotation>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

W3Schools, XSD , 5 :

<xs:element name="prodid">
  <xs:simpleType>
    <xs:restriction base="xs:integer">
      <xs:pattern value="[0-9][0-9][0-9][0-9][0-9]"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

xs xsd, , XSD (Tridion).

+3
3

, XS XSD . , . .

, (http://www.w3schools.com/schema/default.asp), , xs http://www.w3.org/2001/XMLSchema, xsd Tridion.

.

  • XMLNS: XSD = "http://www.w3.org/2001/XMLSchema"
  • XMLNS: = "http://www.w3.org/2001/XMLSchema"

xsd xs.

?

, , SDL Tridion (, ):

<xsd:element name="NumberFieldWithMultipleFacets">
    <xsd:simpleType>
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="4"/>
            <xsd:fractionDigits value="2"/>
            <xsd:minInclusive value="10"/>
            <xsd:maxInclusive value="20"/>
        </xsd:restriction>
    </xsd:simpleType>
</xsd:element>
+4

Xml Schema, . , , / Tridion

+1

xsd: ID, , WebForms (, 1.0), SDL Tridion ( 2013, ).

, xsd Tridion.

And, for example, content editors will see a counter when you limit the text field min = "30" max = "70" characters.

It would be a very nice GUI update. Because it will make WebForms possible in the regular (!) Tridion GUI. After that, content management will be possible when creating new fields. Creating new HTML5 web forms (verified!) Takes less than 2 minutes.

Therefore, please upgrade your GUI to full xsd support.

+1
source

All Articles