Skip to content
Permalink
Browse files

Merge pull request #205 from digipost/utvidelse_lenke

XSD-forslag til datatypen «Lenke»
  • Loading branch information...
marnormic committed Jan 11, 2018
2 parents 27e3965 + 78f6cdd commit 2573dc94333ebad8e6b787d1ef8c4f82d479b42c
Showing with 74 additions and 0 deletions.
  1. +9 −0 eksempler/utvidelser/lenke.xml
  2. +1 −0 eksempler/validate.sh
  3. +64 −0 xsd/utvidelser/lenke.xsd
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<lenke xmlns="http://begrep.difi.no/sdp/utvidelser/lenke"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://begrep.difi.no/sdp/utvidelser/lenke ../../xsd/utvidelser/lenke.xsd">
<url>https://www.avsender.no/svar</url>
<beskrivelse lang="no">Vennligst svar på denne viktige meldingen for videre saksbehandling.</beskrivelse>
<knappTekst lang="no">Svar på den viktige meldingen</knappTekst>
<frist>2017-10-01T12:00:00+02:00</frist>
</lenke>
@@ -19,6 +19,7 @@ for eksempel in ${eksempler}/sbdh.xml; do
validate ${eksempel} ${xsds}/SBDH20040506-02/StandardBusinessDocumentHeader.xsd || ((errors++))
done

validate ${eksempler}/utvidelser/lenke.xml ${xsds}/utvidelser/lenke.xsd || ((errors++))

if (( errors > 0 )); then
echo Fant ${errors} filer med valideringsfeil!
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema version="1.0" targetNamespace="http://begrep.difi.no/sdp/utvidelser/lenke"
xmlns="http://begrep.difi.no/sdp/utvidelser/lenke"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

<xsd:element name="lenke" type="Lenke"/>

<xsd:complexType name="Lenke">
<xsd:sequence>
<xsd:element name="url" type="HttpLenke" minOccurs="1" maxOccurs="1"/>
<xsd:element name="beskrivelse" type="LenkeBeskrivelseTekst" minOccurs="0" maxOccurs="1"/>
<xsd:element name="knappTekst" type="LenkeKnappTekst" minOccurs="0" maxOccurs="1"/>
<xsd:element name="frist" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="HttpLenke">
<xsd:restriction base="xsd:anyURI">
<xsd:pattern value="https?://.+"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="LenkeBeskrivelseTekst">
<xsd:simpleContent>
<xsd:extension base="LenkeBeskrivelseTekstString">
<xsd:attribute name="lang" type="Spraakkode" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="LenkeBeskrivelseTekstString">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="70"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="LenkeKnappTekst">
<xsd:simpleContent>
<xsd:extension base="LenkeKnappTekstString">
<xsd:attribute name="lang" type="Spraakkode" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="LenkeKnappTekstString">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="Spraakkode">
<xsd:annotation>
<xsd:documentation>
Språkkode ihht ISO-639-1 (2 bokstaver)
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:minLength value="2"/>
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>

</xsd:schema>

0 comments on commit 2573dc9

Please sign in to comment.
You can’t perform that action at this time.