<!--  ***************************************************************  -->
<!--  ******* Public DTD for Open Financial Connectivity (OFC) ******  -->
<!--  ***************************************************************  -->

<!--  DTD Version 2 - OFC Version 2 - Last modified June 18, 1996 -->

<!--  Comments contain the words client and server, as well as user and
	provider, and request/response. 
	
	These terms have the following relationships:

		client == user == request
		server == provider == response
-->

<!DOCTYPE OFC [

<!--  ***************************************************************  -->
<!--  **************** Parsed Character Definitions *****************  -->
<!--  ***************************************************************  -->

<!--  The following entities are defined to
	differentiate between data types
	during document creation and parsing. 
	This is the only section of the DTD where 
	#PCDATA is allowed to occur in the content
	model. These entity tags will never occur 
	in the OFC document instance itself.

	The formatting rules are described in the 
	OFC Build & Parse Specification, which
	can be obtained from Microsoft.   
-->

<!--  Character Stream: Used for transmitting
	character based streams.
-->
<!ENTITY % CHARSTR 	"(#PCDATA)">

<!--  Number: Used for specifying a number.  
	Must be made up of numeric characters 
	that can be converted to a positive 
	integer value greater than 0.
-->
<!ENTITY % NUMSTR 	"(#PCDATA)">

<!--  ID: Used for specifying a unique id.
	Must be composed of alphanumeric
	characters. It may contain the 
	following delimiters: ()-,.;:/\#
	as well as spaces.
-->
<!ENTITY % IDSTR 	"(#PCDATA)">

<!--  Amount: Used for specifying an amount.
	Must be made up of numeric characters
	plus the following delimiters for 
	indicating the decimal place: ., 
	If the amount is negative (a debit with 
	respect to the user's account), then the
	first character must the following: -

	The following formats are accepted:
		 XXXX.XX (credit w/ period)
		 XXXX,XX (credit w/ comma)
		-XXXX.XX (debit w/ period)
		-XXXX,XX (debit w/ comma)
-->
<!ENTITY % AMTSTR 	"(#PCDATA)">

<!--  Date and Time: Used for specifying
	the date and time. All date-time pairs
	are based on local time of the server or client.

	The following formats are accepted:
		YYYYMMDDHHMMSS 
		YYYYMMDD (no time)
-->
<!ENTITY % DTSTR 	"(#PCDATA)">

<!--  ***************************************************************  -->
<!--  ***************** OFC DOCUMENT TYPE DEFINITION ****************  -->
<!--  ***************************************************************  -->

<!-- OFC Document: This describes the legal "batched" OFC
	transaction content (and ordering) found in an OFC 
	document instance. These documents are transmitted 
	during HTTP client/server sessions or on the WWW 
	as downloaded files. The document is contextually 
	modeled as a list of OFC Transaction Records.

-->
<!ELEMENT OFC		- -	(DTD, CPAGE, 
	((SONRQ, (MAINTRQ*), (TRNRQ*)) |
	(SONRS, (MAINTRS*), (TRNRS*)) |
	(ACCTSTMT+))			
	)> 

<!--  ***************************************************************  -->
<!--  ******************** OFC Transaction Records ******************  -->
<!--  ***************************************************************  -->

<!--  Signon Transaction: Always sent as the first
	transaction in an HTTP POST for a given session on 
	an OFC client/server system. SESSKEY must be set to 
	0 for initial enrollement or when resetting a 
	user/provider relationship. A valid SESSKEY is 
	required at all other times. A USERID is always required. 
	This transaction is also used for changing passwords.
	If the user is new to the system, the response must 
	contain values for OFC services available on this server, 
	as well as the default days to pay and the default days 
	before withdrawal on new payees, when using the 
	U.S. payment service model. The server returns 
	the SESSKEY to be used during the next OFC HTTP session.
-->
<!ELEMENT SONRQ		- o	(SESSKEY, DTCLIENT, USERID,
	USERPASS, NEWPASS?)>
<!ELEMENT SONRS		- o	(STATUS, DTSERVER, ERROR?, SESSKEY,  
	((SERVICE+), DAYSREQD?, DAYSWITH?)?)>

<!--  Batched Maintenance Transaction: This is used to 
	specify transactions that are used to maintain the 
	user/service relationship, such as adding on-line 
	accts, registering billpay payees with a bill 
	payment system, or sending general mail in regards 
	to a given OFC service. The CLTID is used to match 
	batched	responses to batched requests during the session.  
-->
<!ELEMENT MAINTRQ	- o	(CLTID, ACTION, 
	(ACCTRQ | PAYEERQ | MAILRQ))>
<!ELEMENT MAINTRS	- o	(CLTID, STATUS, ERROR?, 
	(ACCTRS | PAYEERS | MAILRS)?)>

<!--  Batched Financial Transactions: This is used to
	specify financial transactions to be performed
	on the user's account(s) during a given OFC HTTP Session. 
	The CLTID is used to match batched responses to batched
	requests during the session.  
-->
<!ELEMENT TRNRQ		- o	(CLTID, ACTION,
	(STMTRQ | INTRARQ | INTERRQ | PAYMTRQ | PAYIQRQ))>
<!ELEMENT TRNRS		- o	(CLTID, STATUS, ERROR?,
	(STMTRS | INTRARS | INTERRS | PAYMTRS | PAYIQRS)?)>

<!--  Account Statement: This is used for statement
	downloads and file exchange. 
-->
<!ELEMENT ACCTSTMT	- o	(ACCTFROM, STMTRS)>

<!--  ***************************************************************  -->
<!--  ********** OFC Client/Server Maintenance Transactions *********  -->
<!--  ***************************************************************  -->

<!--  Account Transaction: Sent to enable or change services
	for a particular account belonging to a user.
-->
<!ELEMENT ACCTRQ	- o	(ACCTFROM, (SERVRQST+))>
<!ELEMENT ACCTRS	- o	(SERVAUTH+)>

<!--  Payee Transaction: Sent to request to add a payee
	to the bill payment service, or update information
	regarding the payee.  
-->
<!ELEMENT PAYEERQ	- o	(PAYEE, PAYEEID?, PAYACCT)>
<!ELEMENT PAYEERS	- o	(PAYEEID, PAYEE?, DAYSREQD, DAYSWITH)>

<!--  Mail Transaction: Sent to inquire about 
	services for a particular account belonging to
	a user.  
-->
<!ELEMENT MAILRQ	- o	(SERVICE, ACCTFROM?, (MEMO+))>
<!ELEMENT MAILRS	- o	(MEMO*)>

<!--  ***************************************************************  -->
<!--  ****************** OFC Financial Transactions *****************  -->
<!--  ***************************************************************  -->

<!--  ******* OFC Banking Transaction Elements *******  -->

<!--  Statement Transaction: Sent to request statement
	details of a given user's account at a financial
	institution. The server must return the ledger
	balance for the account. Statement requests can 
	be based on starting and ending dates.
-->
<!ELEMENT STMTRQ	- o	(ACCTFROM, DTSTART?, DTEND?)>
<!ELEMENT STMTRS	- o	(DTSTART, DTEND, LEDGER, (STMTTRN*))>

<!--  Intra-bank Transfer Transaction: Sent to request
	an intra-bank transfer. If the server returns
	a status indicating success, and no date/time
	is specified, it will be assumed the funds are 
	immediately available. The user's account
	must have been previously enabled for banking 
	services using the ACCTRQ/ACCTRS transactions. 
-->
<!ELEMENT INTRARQ	- o	(ACCTFROM, TRNAMT, ACCTTO, (MEMO*))>
<!ELEMENT INTRARS	- o	(SRVRTID, DTPOSTED?)>

<!--  ******* OFC Payment Transaction Elements *******  -->

<!--  Inter-bank Transfer Transaction: Sent to request
	an inter-bank transfer. If the server returns
	a status indicating success, and no date/time
	is specified, it will be assumed the funds are 
	immediately available. The user's account
	must have been previously enabled for bill payment 
	services using the ACCTRQ/ACCTRS transactions. 
	The NAME and PAYACCT fields are for the "payee" 
	corresponding to the ACCTTO.
-->
<!ELEMENT INTERRQ	- o	(ACCTFROM, TRNAMT, (PAYEEID | ACCTTO), NAME, PAYACCT, 
	DTDUE, SRVRTID?, (MEMO*))>
<!ELEMENT INTERRS	- o	(SRVRTID, DTPOSTED?, CHKNUM?)>

<!--  Bill Payment Transaction: Sent to request for a payment to be made
	from a user's account to a payee registered with a bill payment
	service. The user's account must have been previously enabled 
	for bill payment services using the ACCTRQ/ACCTRS transactions. 
	The payee must be specified by a payee id based on a previous 
	PAYEERQ/PAYEERS transaction sequence, or the due date must 
	be at least the default days to pay for a given payment provider.
	If a payee id is not specified, then the server may return
	a payee id, matching one in a previous PAYEERS transaction 
	within the same client/server session.
-->
<!ELEMENT PAYMTRQ	- o	(ACCTFROM, TRNAMT, (PAYEEID | PAYEE), PAYACCT, 
	DTDUE, SRVRTID?, (MEMO*))>
<!ELEMENT PAYMTRS	- o	(SRVRTID, PAYEEID?)>

<!--  Payment Inquiry Transaction: Sent to request information
	regarding a payment from a user's account to a payee. 
	A successful PAYMTRQ/PAYMTRS transaction set must have 
	previously occurred in a prior session before a payment
	request is possible. The SRVRTID for that payment must be 
	known to inquire on a payment.
-->
<!ELEMENT PAYIQRQ	- o	(SRVRTID, (MEMO+))>
<!ELEMENT PAYIQRS	- o	(SRVRTID, (MEMO*))>

<!--  ***************************************************************  -->
<!--  **************** Multiple Element Definitions *****************  -->
<!--  ***************************************************************  -->

<!--  ******* OFC Aggregate Elements *******  -->

<!--  Statement Transaction Detail: Used for returning
	the details of a bank statement transaction.
-->
<!ELEMENT STMTTRN	- -	(GENTRN)>

<!--  Account From: Used for specifying an account
	from which funds will be/have been withdrawn.  
-->
<!ELEMENT ACCTFROM	- -	(ACCOUNT)>

<!--  Account To: Used for specifying an account
	into which funds will be/have been deposited.
-->
<!ELEMENT ACCTTO	- -	(ACCOUNT)>

<!--  Payee: Used for specifying
	a payee.  
-->
<!ELEMENT PAYEE		- -	(ENTITY)>

<!--  Service Request: Used for specifying
	the services which are being resquested
	for a given user. 
-->
<!ELEMENT SERVRQST	- -	(SERVICE, ACTION)>

<!--  Service Authorized: Used for specifying
	which services are currently authorized
	for a given user. 
-->
<!ELEMENT SERVAUTH 	- -	(SERVICE, STATUS)>

<!--  ******* Generic Aggregate Elements *******  -->

<!--  The following aggregate elements are defined
	at a generic level to aid in the parsing of
	element aggregates. These element tags will 
	never occur in an OFC document instance.  
-->

<!--  Generic Transaction: Used for specifying
	the details of a financial transaction.
-->
<!ELEMENT GENTRN	o o	(TRNTYPE, DTPOSTED, TRNAMT, 
	FITID?, CLTID?, SRVRTID?, CHKNUM?, SIC?, PAYEEID?, (PAYEE | NAME)?, ACCTTO?, (MEMO*))>

<!--  Entity: Used for specifying
	the personal data for a given entity.
	A maximum of three name fields, three address fields,
	and two phone fields will be allowed.
-->
<!ELEMENT ENTITY	o o	((NAME+), (ADDRESS+), CITY, STATE, POSTALID, (PHONE+))>

<!--  Account: Used for specifying an account
	at a given financial institution.  
-->
<!ELEMENT ACCOUNT	o o	(BANKID, BRANCHID?, ACCTID, ACCTTYPE)>

<!--  ***************************************************************  -->
<!--  ***************** Single Element Definitions ******************  -->
<!--  ***************************************************************  -->

<!--  ******* OFC header elements *******  -->

<!--  OFC Data Version Number: Used to indicate the
	version of the OFC DTD.  
--> 
<!ELEMENT DTD		- o	%NUMSTR>

<!--  Code page: Used to indicate the ANSI code page 
	of the	character set used in all of the 
	CDATA elements (default to 1252).  
--> 
<!ELEMENT CPAGE		- o	%IDSTR>

<!--  ******* OFC Session/Transaction Elements *******  -->

<!--  Session Key: Used for indicating the index
	of the session relative to the user/provider. 
	This key is used for crash recovery purposes. 
	The server returns the initial key in the
	signoff response of the enrollment session. 
	This key is unique for a given user/provider 
	relationship and for every session for a given 
	USERID.	This key is stored by both the client and 
	the server. The stored key is always sent by 
	the client in the signon request. The server will 
	expect the key to match the key sent in the 
	signoff response of the previous session. If the 
	key contained in the signon request does not match 
	the key	expected by the server, then this indicates 
	that the server is being attacked or the
	user is in crash-recovery mode. The server
	should verify that this is a crash recovery by
	comparing the session key against the key of the
	previous session. If the keys match, then it can be 
	assumed that the client did not receive the 
	transaction response of the previous session, 
	and return the response transactions of the previous
	session. This key is always assigned by the
	server, and returned by the client.	 
-->
<!ELEMENT SESSKEY	- o	%IDSTR>

<!--  User ID: Used for identifying a user. 
	This id is always assigned by the server, 
	within an enrollment response.  
-->
<!ELEMENT USERID	- o	%IDSTR>

<!--  Client Transaction Id: Used for matching
	a request transaction to a response transaction, 
	when multiple transactions are sent in batch mode.
	Each id must be	a unique value within a given 
	client-server session.  This id is always assigned
	by the client, and returned by the server.
	If the server is sending an unsolicated response
	transaction, CLTID must be set to 0.  
-->
<!ELEMENT CLTID		- o	%IDSTR>

<!--  Server Transaction ID: Used for
	identifying a unique financial transaction. 
	This id is always assigned by the server.
	This can be thought of as a confirmation
	number that should be a unique id that the
	user can reference in a phone conversation
	with the customer service desk at the 
	server location.  
-->
<!ELEMENT SRVRTID	- o	%IDSTR>

<!--  Transaction Action: Used for specifying
	the requested action for a given transaction.

	0, add
	1, delete
	2, change
-->
<!ELEMENT ACTION	- o	%NUMSTR>

<!--  Transaction Status: Used for specifying
	the resultant status for a given response.  
	
	normal status

	0, request accepted 
	1, request rejected 
	2, account pending
	3, account closed
	4, no CLTID (unsolicited transaction)
	5, password change required
	
	error status

	100, undefined error - error text in ERROR 
	101, USERID not recognized
	102, USERPASS not recognized
	103, SESSKEY not recognized
	104, account not recognized
	105, bank not recognized
	106, PAYEEID not recognized

-->
<!ELEMENT STATUS	- o	%NUMSTR>

<!--  ******* OFC Data Elements *******  -->

<!--  Transaction Amount: Used for specifying
	an amount for a given transaction.  
-->
<!ELEMENT TRNAMT	- o	%AMTSTR>

<!--  Ledger Balance: Used for specifying
	a ledger balance for a given account.  
-->
<!ELEMENT LEDGER	- o	%AMTSTR>

<!--  Payee ID: Used for identifying a payee. 
	This id is always assigned by the server, 
	within a payee response. 
-->
<!ELEMENT PAYEEID	- o	%IDSTR>

<!--  Financial Institution Transaction ID: Used for
	identifying a unique financial transaction. 
	This id is always assigned by the financial
	institution.   
-->
<!ELEMENT FITID		- o	%IDSTR>

<!--  Bank ID: Used for	identifying a unique financial 
	institution. This id is typically a routing
	number or BIN.   
-->
<!ELEMENT BANKID	- o	%IDSTR>

<!--  Branch ID: Used for identifying a unique financial 
	institution branch. This id is typically only used
	in international banking systems.   
-->
<!ELEMENT BRANCHID	- o	%IDSTR>

<!--  Account ID: Used for identifying a unique financial 
	account. This id is typically an account number
	or credit card number.   
-->
<!ELEMENT ACCTID	- o	%IDSTR>

<!--  Account Type: Used for identifying the type of financial 
	account. 

	0, Checking
	1, Savings
	2, Credit Card
	3, Money Market
	4, Credit Line
	5, Loan
	6, Inter-bank transfer payee
	7, Other
-->
<!ELEMENT ACCTTYPE	- o	%NUMSTR>

<!--  Transaction Type: Used for specifying
	the type of a given transaction.

	0, Credit
	1, Debit
	2, Interest
	3, Dividend
	4, Service Charge
	5, Deposit
	6, ATM Withdrawal
	7, Transfer
	8, Check
	9, Electronic Payment
	10, Cash Withdrawal
	11, Electronic Payroll Deposit
	12, Other
-->
<!ELEMENT TRNTYPE	- o	%NUMSTR>

<!--  Standard Industry Classification: Used for 
	specifying the SIC for a given transaction.  
-->
<!ELEMENT SIC		- o	%NUMSTR>

<!--  Check number: Used for specifying the 
	check number for a given transaction.  
-->
<!ELEMENT CHKNUM	- o	%IDSTR>

<!--  Account with payee: Used for specifying the 
	account number that represents a user's 
	account with a payee or business.  
-->
<!ELEMENT PAYACCT	- o	%CHARSTR>

<!--  Days required for payment: Used for specifying the 
	number of days required prior to the due date
	for a bill payment request using this payee.
-->
<!ELEMENT DAYSREQD	- o	%NUMSTR>

<!--  Withdrawal date: Used for specifying the number of 
	days before funds will be withdarwn from a user's 
	account prior to the due date of the payment.
-->
<!ELEMENT DAYSWITH	- o	%NUMSTR>

<!--  Client Date and Time: Used for specifying
	the date and time on the client machine.  
-->
<!ELEMENT DTCLIENT	- o	%DTSTR>

<!--  Server Date and Time: Used for specifying
	the date and time on the server machine.  
-->
<!ELEMENT DTSERVER	- o	%DTSTR>

<!--  Starting Date and Time: Used for specifying
	the date and time for the first statement
	transaction.  
-->
<!ELEMENT DTEND		- o	%DTSTR>

<!--  Ending Date and Time: Used for specifying
	the date and time for the last statement
	transaction.  
-->
<!ELEMENT DTSTART	- o	%DTSTR>

<!--  Posting Date and Time: Used for specifying
	the posting date (effective date).  
-->
<!ELEMENT DTPOSTED	- o	%DTSTR>

<!--  Due Date and Time: Used for specifying
	the due date for a payment or inter-bank
	transfer.  
-->
<!ELEMENT DTDUE		- o	%DTSTR>

<!--  Service: Used for specifying a service.
	These services are either banking services,
	or billpayment services.

	0, Banking Services
	1, Billpay Services (Service Model)
	2. Payee Id/Acct Info (Interbank Transfer Model)
	3. Payee Id Only (Interbank Transfer Model)
	4. Acct Info Only (Interbank Transfer Model)
-->
<!ELEMENT SERVICE	- o	%NUMSTR>

<!--  Name: Used for specifying a
	name. This is typically a user's name
	or a payee's name.  
-->
<!ELEMENT NAME		- o	%CHARSTR>

<!--  Address: Used for specifying an
	address. This is typically the user's address
	or the payee's mailing address.  
-->
<!ELEMENT ADDRESS	- o	%CHARSTR>

<!--  City: Used for specifying the name of
	a city. This is typically the city in
	which the user resides or the city 
	contained in the payee's mailing address.  
-->
<!ELEMENT CITY		- o	%CHARSTR>

<!--  Postal Code: Used for specifying the postal code of
	a city. This is typically the city in
	which the user resides or the city 
	contained in the payee's mailing address.  
-->
<!ELEMENT POSTALID	- o	%IDSTR>

<!--  State: Used for specifying the name of
	a state. This is typically the state in
	which the user resides or the state 
	contained in the payee's mailing address.  
-->
<!ELEMENT STATE		- o	%CHARSTR>

<!--  Phone: Used for specifying a phone
	number. This is typically the user's phone
	or the payee's phone.  
-->
<!ELEMENT PHONE		- o	%CHARSTR>

<!--  Memo: Used for specifying a memo.
-->
<!ELEMENT MEMO		- o	%CHARSTR>

<!--  Error: Used for specifying an error string if the
	error is not supported in the list of valid
	status values. If this field is used, STATUS
	must be set to 100.
-->
<!ELEMENT ERROR		- o	%CHARSTR>

<!--  User Password: Used for specifying
	an existing password for a given user.  
-->
<!ELEMENT USERPASS	- o	%CHARSTR>

<!--  New Password: Used for changing
	an existing password for a given user.  
-->
<!ELEMENT NEWPASS	- o	%CHARSTR>

]> 
