xml.schema/src/org/netbeans/modules/xml/schema/wizard/templates/LoanApplication.xsd
author Milutin Kristofic <mkristofic@netbeans.org>
Mon, 30 Jan 2017 14:30:54 +0100
changeset 1583 fe20f672a61a
parent 685 b07028fb29c0
permissions -rw-r--r--
Added Missing copyright information in source files
     1 <?xml version="1.0"?>
     2 <!--
     3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 
     5 Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved.
     6 
     7 Oracle and Java are registered trademarks of Oracle and/or its affiliates.
     8 Other names may be trademarks of their respective owners.
     9 
    10 The contents of this file are subject to the terms of either the GNU
    11 General Public License Version 2 only ("GPL") or the Common
    12 Development and Distribution License("CDDL") (collectively, the
    13 "License"). You may not use this file except in compliance with the
    14 License. You can obtain a copy of the License at
    15 http://www.netbeans.org/cddl-gplv2.html
    16 or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    17 specific language governing permissions and limitations under the
    18 License.  When distributing the software, include this License Header
    19 Notice in each file and include the License file at
    20 nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    21 particular file as subject to the "Classpath" exception as provided
    22 by Oracle in the GPL Version 2 section of the License file that
    23 accompanied this code. If applicable, add the following below the
    24 License Header, with the fields enclosed by brackets [] replaced by
    25 your own identifying information:
    26 "Portions Copyrighted [year] [name of copyright owner]"
    27 
    28 Contributor(s):
    29 
    30 The Original Software is NetBeans. The Initial Developer of the Original
    31 Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun
    32 Microsystems, Inc. All Rights Reserved.
    33 
    34 If you wish your version of this file to be governed by only the CDDL
    35 or only the GPL Version 2, indicate your decision by adding
    36 "[Contributor] elects to include this software in this distribution
    37 under the [CDDL or GPL Version 2] license." If you do not indicate a
    38 single choice of license, a recipient has the option to distribute
    39 your version of this file under either the CDDL, the GPL Version 2 or
    40 to extend the choice of license to its licensees as provided above.
    41 However, if you add GPL Version 2 code and therefore, elected the GPL
    42 Version 2 license, then the option applies only if the new code is
    43 made subject to such option by the copyright holder.
    44 -->
    45 
    46 <xs:schema targetNamespace="http://xml.netbeans.org/examples/LoanApplication"
    47            xmlns="http://xml.netbeans.org/examples/LoanApplication"
    48            xmlns:xs="http://www.w3.org/2001/XMLSchema"
    49            elementFormDefault="qualified" 
    50            attributeFormDefault="unqualified">
    51     
    52     <xs:element name="autoLoanApplication">
    53         <xs:annotation>
    54             <xs:documentation>A loan application xml schema</xs:documentation>
    55         </xs:annotation>
    56         <xs:complexType>
    57             <xs:sequence>                
    58                 <xs:element name="loan" type="LoanType"/>                
    59                 <xs:element name="term" type="xs:integer"/>                
    60                 <xs:element name="amount">
    61                     <xs:simpleType>
    62                         <xs:restriction base="xs:decimal">
    63                             <xs:minInclusive value="5000.00"/>
    64                             <xs:maxInclusive value="10000.00"/>
    65                             <xs:fractionDigits value="2"/>
    66                         </xs:restriction>
    67                     </xs:simpleType>
    68                 </xs:element>
    69                 <xs:element name="application">
    70                     <xs:simpleType>
    71                         <xs:restriction base="xs:string">
    72                             <xs:enumeration value="individual"/>
    73                             <xs:enumeration value="joint"/>
    74                         </xs:restriction>
    75                     </xs:simpleType>
    76                 </xs:element>                
    77                 <xs:element name="state" type="StateType"/>                
    78                 <xs:element name="applicant" type="ApplicantType" maxOccurs="2"/>                
    79                 <xs:element name="tradeIn" minOccurs="0">
    80                     <xs:complexType>
    81                         <xs:sequence>
    82                             <xs:element name="vehicle" type="CarType"/>                            
    83                             <xs:element name="monthlyPayment">
    84                                 <xs:simpleType>
    85                                     <xs:restriction base="xs:decimal">
    86                                         <xs:fractionDigits value="2"/>
    87                                         <xs:minInclusive value="0.00"/>
    88                                     </xs:restriction>
    89                                 </xs:simpleType>
    90                             </xs:element>
    91                         </xs:sequence>
    92                     </xs:complexType>
    93                 </xs:element>
    94             </xs:sequence>
    95         </xs:complexType>
    96     </xs:element>
    97     
    98     <xs:simpleType name="LoanType">
    99         <xs:restriction base="xs:string">
   100             <xs:enumeration value="new"/>
   101             <xs:enumeration value="used dealer"/>
   102             <xs:enumeration value="used private"/>
   103             <xs:enumeration value="refinance"/>
   104             <xs:enumeration value="lease buyout"/>
   105         </xs:restriction>
   106     </xs:simpleType>
   107     
   108     <xs:simpleType name="StateType">
   109         <xs:restriction base="xs:string">
   110             <xs:enumeration value="AZ"/>
   111             <xs:enumeration value="CA"/>
   112             <xs:enumeration value="NY"/>
   113             <xs:enumeration value="TX"/>
   114         </xs:restriction>
   115     </xs:simpleType>
   116     
   117     <xs:complexType name="ApplicantType">
   118         <xs:sequence>
   119             <xs:element name="name">
   120                 <xs:complexType>
   121                     <xs:sequence>
   122                         <xs:element name="first" type="xs:string"/>
   123                         <xs:element name="middle" type="xs:string"/>
   124                         <xs:element name="last" type="xs:string"/>
   125                         <xs:element name="suffix">
   126                             <xs:simpleType>
   127                                 <xs:restriction base="xs:string">
   128                                     <xs:enumeration value="Jr"/>
   129                                     <xs:enumeration value="Sr"/>
   130                                     <xs:enumeration value="II"/>
   131                                     <xs:enumeration value="III"/>
   132                                     <xs:enumeration value="IV"/>
   133                                     <xs:enumeration value="V"/>
   134                                 </xs:restriction>
   135                             </xs:simpleType>
   136                         </xs:element>
   137                     </xs:sequence>
   138                 </xs:complexType>
   139             </xs:element>
   140             <xs:element name="SSID">
   141                 <xs:simpleType>
   142                     <xs:restriction base="xs:string">
   143                         <xs:pattern value="\d{3}-\d{2}-\d{4}"/>
   144                     </xs:restriction>
   145                 </xs:simpleType>
   146             </xs:element>
   147             <xs:element name="birthDate" type="xs:date"/>
   148             <xs:element name="homePhone" type="PhoneNumberType"/>
   149             <xs:element name="cellPhone" type="PhoneNumberType"/>
   150             <xs:element name="emailAddress">
   151                 <xs:simpleType>
   152                     <xs:restriction base="xs:string"/>
   153                 </xs:simpleType>
   154             </xs:element>
   155             <xs:element name="residence" type="ResidenceType" maxOccurs="unbounded"/>
   156             <xs:element name="employment">
   157                 <xs:complexType>
   158                     <xs:sequence>
   159                         <xs:element name="status">
   160                             <xs:simpleType>
   161                                 <xs:restriction base="xs:string">
   162                                     <xs:enumeration value="unemployed"/>
   163                                     <xs:enumeration value="employed"/>
   164                                     <xs:enumeration value="self employed"/>
   165                                 </xs:restriction>
   166                             </xs:simpleType>
   167                         </xs:element>
   168                         <xs:element name="detail" minOccurs="0">
   169                             <xs:complexType>
   170                                 <xs:sequence>
   171                                     <xs:element name="occupation" type="xs:string"/>
   172                                     <xs:element name="employer">
   173                                         <xs:complexType>
   174                                             <xs:sequence>
   175                                                 <xs:element name="name"/>
   176                                                 <xs:element name="address" type="AddressType"/>
   177                                                 <xs:element name="lengthOfEmployment" type="DurationType"/>
   178                                             </xs:sequence>
   179                                         </xs:complexType>
   180                                     </xs:element>
   181                                     <xs:element name="workPhone" type="PhoneNumberType"/>
   182                                     <xs:element name="grossMonthlyIncome">
   183                                         <xs:simpleType>
   184                                             <xs:restriction base="xs:decimal">
   185                                                 <xs:minInclusive value="0.00"/>
   186                                                 <xs:fractionDigits value="2"/>
   187                                             </xs:restriction>
   188                                         </xs:simpleType>
   189                                     </xs:element>
   190                                 </xs:sequence>
   191                             </xs:complexType>
   192                         </xs:element>
   193                     </xs:sequence>
   194                 </xs:complexType>
   195             </xs:element>
   196             <xs:element name="supplementalIncome">
   197                 <xs:complexType>
   198                     <xs:sequence>
   199                         <xs:element name="source">
   200                             <xs:simpleType>
   201                                 <xs:restriction base="xs:string">
   202                                     <xs:enumeration value="alimony"/>
   203                                     <xs:enumeration value="child support"/>
   204                                     <xs:enumeration value="investments"/>
   205                                     <xs:enumeration value="part time job"/>
   206                                     <xs:enumeration value="rental property"/>
   207                                     <xs:enumeration value="retirement income"/>
   208                                     <xs:enumeration value="social security"/>
   209                                 </xs:restriction>
   210                             </xs:simpleType>
   211                         </xs:element>
   212                         <xs:element name="grossMonthlyIncome">
   213                             <xs:simpleType>
   214                                 <xs:restriction base="xs:decimal">
   215                                     <xs:minInclusive value="0.00"/>
   216                                     <xs:fractionDigits value="2"/>
   217                                 </xs:restriction>
   218                             </xs:simpleType>
   219                         </xs:element>
   220                     </xs:sequence>
   221                 </xs:complexType>
   222             </xs:element>
   223         </xs:sequence>
   224     </xs:complexType>
   225     
   226     <xs:complexType name="AddressType">
   227         <xs:sequence>
   228             <xs:element name="address1"/>
   229             <xs:element name="address2"/>
   230             <xs:element name="city"/>
   231             <xs:element name="state" type="StateType"/>
   232             <xs:element name="zip">
   233                 <xs:simpleType>
   234                     <xs:restriction base="xs:string">
   235                         <xs:minLength value="5"/>
   236                         <xs:maxLength value="5"/>
   237                         <xs:pattern value="\d{5}"/>
   238                     </xs:restriction>
   239                 </xs:simpleType>
   240             </xs:element>
   241         </xs:sequence>
   242     </xs:complexType>
   243     
   244     <xs:complexType name="PhoneNumberType">
   245         <xs:sequence>
   246             <xs:element name="areaCode"/>
   247             <xs:element name="exchange"/>
   248             <xs:element name="number"/>
   249             <xs:element name="extension" minOccurs="0"/>
   250         </xs:sequence>
   251     </xs:complexType>
   252     
   253     <xs:complexType name="OccupancyType">
   254         <xs:sequence>
   255             <xs:element name="type">
   256                 <xs:simpleType>
   257                     <xs:restriction base="xs:string">
   258                         <xs:enumeration value="rent"/>
   259                         <xs:enumeration value="own"/>
   260                     </xs:restriction>
   261                 </xs:simpleType>
   262             </xs:element>
   263             <xs:element name="movedIn" type="xs:date"/>
   264             <xs:element name="lengthOfOccupancy" type="DurationType"/>
   265             <xs:element name="payment">
   266                 <xs:simpleType>
   267                     <xs:restriction base="xs:decimal">
   268                         <xs:fractionDigits value="2"/>
   269                         <xs:minInclusive value="0.00"/>
   270                     </xs:restriction>
   271                 </xs:simpleType>
   272             </xs:element>
   273         </xs:sequence>
   274     </xs:complexType>
   275     
   276     <xs:complexType name="ResidenceType">
   277         <xs:sequence>
   278             <xs:element name="address" type="AddressType"/>
   279             <xs:element name="occupancy" type="OccupancyType"/>
   280         </xs:sequence>
   281     </xs:complexType>
   282     
   283     <xs:complexType name="CarType">
   284         <xs:sequence>
   285             <xs:element name="year" type="xs:gYear"/>
   286             <xs:element name="make" type="xs:string"/>
   287             <xs:element name="model" type="xs:string"/>
   288             <xs:element name="VIN" type="xs:string"/>
   289         </xs:sequence>
   290     </xs:complexType>
   291     
   292     <xs:complexType name="DurationType">
   293         <xs:sequence>
   294             <xs:element name="years" type="xs:positiveInteger"/>
   295             <xs:element name="months">
   296                 <xs:simpleType>
   297                     <xs:restriction base="xs:positiveInteger">
   298                         <xs:minInclusive value="1"/>
   299                         <xs:maxInclusive value="12"/>
   300                     </xs:restriction>
   301                 </xs:simpleType>
   302             </xs:element>
   303         </xs:sequence>
   304     </xs:complexType>
   305     
   306 </xs:schema>