Additions to the GN4.XSD schema for the WriteEditionDate

Build 1501 on 14/Nov/2017  This topic last edited on: 7/Nov/2016, at 14:47

Add the parts, highlighted in yellow, to the GN4.XSD schema file. This adds an auto-computed variable ed_dateEx that returns the edition date in format dd/mm/yyyy where day and month are zero padded, e.g. will appear as 02/06/2013, instead as the default value 2/6/2013.

<xs:group name="editionExtra">

    <xs:annotation>

      <xs:documentation>Additional attributes of the 'edition' object type that are rendered as XML element</xs:documentation>

      <xs:appinfo>

        <gs:compute inherit="true">

          <edition xmlns:tagscripts="urn:teradp-com:externaldll:TagScripts:Editions">

            <dateEx>

              <xsl:value-of select="tagscripts:WriteEditionDate(gn4:titleRef/*/gn4:title/@name, @date, 'dnd/mnd/yyyy')"/>

            </dateEx>

          </edition>

        </gs:compute>

      </xs:appinfo>

    </xs:annotation>

    <xs:sequence>

      <xs:element name="NumberOrd" type="tName" minOccurs="0" nillable="true">

        <xs:annotation>

          <xs:documentation>NumberOrd of the edition</xs:documentation>

        </xs:annotation>

      </xs:element>

      <xs:element name="dateEx" type="tDescription" gs:compute="true">

        <xs:annotation>

          <xs:documentation>Publication date calculated with the custom dll</xs:documentation>

        </xs:annotation>

      </xs:element>

    </xs:sequence>

  </xs:group>

Please note that this addition to the schema determines also the date format. The actual format is defined in the 'dnd/mnd/yyyy' parameter, that - if you look at the WriteEditionDate function, returns the date as dd/mm/yyyy, where dd and mm are zero-padded

Should you need more formats, add more elements  to the schema (e.g. dateEx2, dateEx3 etc).

Have in mind that the variable name contains a prefix: ed_ for edition variables, pg_ for page variables. Therefore, if the element name is dateEx, the variable name to use in >writes..< GNML tag will be ed_dateEx.

To be able to use the ed_dateEx variable (that contains the results of the calculations based on the WriteEditionDate custom function) in your >writes..< tags, add the above to the schema, save the changed schema, and then reload it in the database as explained in Importing schemas from a file.