<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.cienciavitae.pt/ns/person-info" xmlns:person-info="http://www.cienciavitae.pt/ns/person-info"
    xmlns:common="http://www.cienciavitae.pt/ns/common" xmlns:common-enum="http://www.cienciavitae.pt/ns/common-enum">

    <xs:annotation>
        <xs:documentation>...</xs:documentation>
    </xs:annotation>

    <xs:import namespace="http://www.cienciavitae.pt/ns/common" schemaLocation="../../common/common.xsd"/>
    <xs:import namespace="http://www.cienciavitae.pt/ns/common-enum" schemaLocation="../../common/common-enum.xsd"/>


    <xs:element name="person-info">
        <xs:annotation>
            <xs:documentation>Person Info element.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="full-name" type="common:string-80-stype"/>
                <xs:element name="names" type="common:string-80-stype" minOccurs="0"/>
                <xs:element name="surnames" type="common:string-80-stype" minOccurs="0"/>
                <xs:element name="presented-name" type="common:string-80-stype"/>
                <xs:element name="date-of-birth" type="person-info:date-of-birth-ctype"/>
                <xs:element name="gender" type="person-info:gender-ctype"/>
                <xs:element name="photography" type="person-info:photography-ctype"/>
                <xs:element name="displayName" type="common:string-80-stype" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="person-info-narrative">
        <xs:annotation>
            <xs:documentation>Person Info element.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="full-name" type="common:string-80-stype"/>
                <xs:element name="names" type="common:string-80-stype" minOccurs="0"/>
                <xs:element name="surnames" type="common:string-80-stype" minOccurs="0"/>
                <xs:element name="presented-name" type="common:string-80-stype"/>
                <xs:element name="date-of-birth" type="person-info:date-of-birth-ctype"/>
                <xs:element name="gender" type="person-info:gender-ctype"/>
                <xs:element name="photography" type="person-info:photography-ctype"/>
                <xs:element name="displayName" type="common:string-80-stype" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="has-narrative-cv" type="xs:boolean"/>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="date-of-birth-ctype">
        <xs:complexContent>
        	<xs:extension base="common:date-ctype">
                <xs:attribute name="privacy-level" type="common-enum:privacy-level-enum" use="required"/>
        	</xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="gender-ctype">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="code" type="common-enum:gender-enum" use="required"/>
                <xs:attribute name="privacy-level" type="common-enum:privacy-level-enum" use="required"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    
    <xs:complexType name="photography-ctype">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="privacy-level" type="common-enum:privacy-level-enum" use="required"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
  
</xs:schema>
