<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml">
	<xs:include schemaLocation="http://localhost/microloan/xsd/SBA_MicroloanTypes.xsd"/>
	<xs:include schemaLocation="http://localhost/library/xml/SBA_SimpleTypes.xsd"/>
	<xs:annotation>
		<xs:documentation>
			<xhtml:h1>XSD for SBA_MicroloanServicing 1.0, Microloan Update</xhtml:h1>
			<xhtml:h3>To view the full content, you must right click the page and select "View Page Source".</xhtml:h3>
			<xhtml:p>
				This is a format for Electronic Transfer of loan information, the original meaning of &quot;ETran&quot;.
				In that sense, it should not be too confusing that the SBA loan guaranty and direct loan programs
				are also colloquially called &quot;ETran&quot;.
			</xhtml:p>
			<xhtml:p>
				In SBA_MicroloanServicing format, there are 4 levels of tags:
				the root tag (&lt;SBA_MicroloanServicing&gt;),
				the transaction tag,
				table tags and
				column tags.
			</xhtml:p>
			<xhtml:p>
				<xhtml:b>&quot;Transaction Tags&quot;:</xhtml:b>
				In the SBA loan guaranty and direct loan programs,
				Servicing of new loan appications have transaction tag &lt;App&gt;,
				and Servicing of existing loans have transaction tag &lt;SBALoan&gt;.
				In the SBA Microloan program, the transaction tag is &lt;Microloan&gt;.
				Everything inside the transaction tag either commits to the SBA database (success)
				or rolls back (failure), together, as a unit.
			</xhtml:p>
			<xhtml:p>
				<xhtml:b>&quot;Table Tags&quot;:</xhtml:b>
				Within a transaction tag, table tags can occur in any order.
				Some tables allow only one occurrence, but for tables that allow multiple occurrences,
				giving more than one will result in multiple rows on the SBA database.
				There is no need to cluster together table tags of the same type.
			</xhtml:p>
			<xhtml:p>
				<xhtml:b>&quot;Column Tags&quot;:</xhtml:b>
				Like table tags in transaction tags, within a given table tag, column tags can occur in any order.
				Many column tags are optional.
				They will how up in this XSD with the attribute minOccurs="0".
			</xhtml:p>
		</xs:documentation>
	</xs:annotation>
	<xs:element name="SBA_MicroloanServicing">
		<xs:annotation><xs:documentation><xhtml:h2>
			The Root Element (&lt;SBA_MicroloanServicing&gt;)
		</xhtml:h2></xs:documentation></xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Microloan" type="Microloan" maxOccurs="unbounded">
					<xs:annotation>
						<xs:documentation>
							<xhtml:p>
								The SBA&apos;s &quot;root tag&quot; (&lt;SBA_MicroloanServicing&gt;) for
								Microloan initial data entry must contain
								at least one &lt;Microloan&gt; tag.
								It may contain more than one.
								If more than one &lt;Microloan&gt; tag is given,
								each &lt;Microloan&gt; tag will commit to the SBA&apos;s database,
								or roll back from it, independently of all other &lt;Microloan&gt; tags in the same submission.
								For this reason, &lt;Microloan&gt; is sometimes referred to as the
								&quot;transaction tag&quot; of Microloan.
							</xhtml:p>
						</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="version" type="SBA_MicroloanVersions">
				<xs:annotation>
					<xs:documentation>
						<xhtml:p>
							Your &quot;root tag&quot; should be &lt;SBA_MicroloanServicing version=&quot;m.1&quot;&gt;
							for XML that conforms to this XSD.
							See SBA_MicroloanTypes.xsd for an explanation of Microloan version numbers
							and their coding implications.
						</xhtml:p>
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="Microloan">
		<xs:annotation><xs:documentation><xhtml:h2>
			The Transaction Element (&lt;Microloan&gt;)
		</xhtml:h2></xs:documentation></xs:annotation>
		<xs:choice maxOccurs="unbounded">
			<xs:element name="Loan"				type="Loan">
				<xs:annotation>
					<xs:documentation>
						<xhtml:p>
							Because this element doesn&apos;t contain any minOccurs or maxOccurs attributes,
							both are left at their XSD default, which is 1.
							There must be at least one Loan element.
							There may be no more than one Loan element.
							(Exactly one per Microloan transaction.)
						</xhtml:p>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:choice>
	</xs:complexType>
	<xs:annotation><xs:documentation><xhtml:h2>
		The &quot;Table Tags&quot;
	</xhtml:h2></xs:documentation></xs:annotation>
	<xs:complexType name="Loan">
		<xs:annotation><xs:documentation><xhtml:h3>
			&lt;Loan&gt;
		</xhtml:h3></xs:documentation></xs:annotation>
		<xs:all>
			<xs:element name="LoanSeqNmb"				type="SBA_Num6"				minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>Sequence number returned when Microloan was originated (prime key), used here to update status.</xhtml:p>		</xs:documentation></xs:annotation></xs:element>
			<xs:element name="LoanNmb"					type="SBA_Str10"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>Used in conjunction with LenderLoanNmb as an alternative to Sequence Number (LoanSeqNmb)</xhtml:p>			</xs:documentation></xs:annotation></xs:element>
			<xs:element name="LenderLoanNmb"			type="SBA_Str50"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>Used in conjunction with LoanNmb as an alternative to Sequence Number (LoanSeqNmb)</xhtml:p>					</xs:documentation></xs:annotation></xs:element>
			<xs:element name="OutstandingBalance"		type="xs:decimal"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>If not given, value not changed.</xhtml:p>																	</xs:documentation></xs:annotation></xs:element>
			<xs:element name="Status"					type="SBA_Num1"				minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>If not given, value not changed.  1 = Current or up to 30 Days Delinquent, 3 = 31 to 60 Days Delinquent,
																																			  4 = 61 to 90 Days Delinquent, 5 = 91 to 120 Days Delinquent,
																																			  6 = Over 120 Days Delinquent/Defaulted, 7 = Paid In Full, 8 = Charged Off</xhtml:p>							</xs:documentation></xs:annotation></xs:element>
			<xs:element name="LoanAmt"					type="xs:decimal"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>If not given, value not changed.</xhtml:p>																	</xs:documentation></xs:annotation></xs:element>
			<xs:element name="CurrentlyInBusiness"		type="SBA_YesNoInd"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>Outcome value, only required for PIF and CO status.</xhtml:p>														</xs:documentation></xs:annotation></xs:element>
			<xs:element name="GrossRevenue"				type="xs:decimal"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>Outcome value, only required for PIF and CO status.</xhtml:p>														</xs:documentation></xs:annotation></xs:element>
			<xs:element name="JobsCreatedRetained"		type="SBA_Num4"				minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>Outcome value, only required for PIF and CO status.</xhtml:p>														</xs:documentation></xs:annotation></xs:element>
			<xs:element name="AnnualProfitLoss"			type="xs:decimal"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>Annual Profit/Loss (positive or negative number).Outcome value, only required for PIF and CO status.</xhtml:p>	</xs:documentation></xs:annotation></xs:element>
			<xs:element name="NoChangeDesc"				type="SBA_Str255"			minOccurs="0">	<xs:annotation><xs:documentation><xhtml:p>If not given, value not changed.</xhtml:p>																	</xs:documentation></xs:annotation></xs:element>			
		</xs:all>
		<xs:attribute name="action"						type="SBA_ActionUpdateOnly"	fixed="update">	<xs:annotation><xs:documentation><xhtml:p>For now, only insert is allowed.</xhtml:p>												</xs:documentation></xs:annotation></xs:attribute>
	</xs:complexType>
</xs:schema>
