Defining Fixed-Length Data Using Native Schema Constructs

6-12 Oracle Fusion Middleware Users Guide for Technology Adapters element name=country_code nxsd:style=fixedLength nxsd:length=2 nxsd:padStyle=none simpleType restriction base=string length value=2 restriction simpleType element element name=to_usd_rate nxsd:style=fixedLength nxsd:length=12 nxsd:padStyle=head nxsd:paddedBy=0 simpleType restriction base=string maxLength value=12 restriction simpleType element sequence complexType element schema Translated XML Using the Native Schema: With Padding fixedlength xmlns=http:www.oracle.comiasprocessconnect currency_codeGBPcurrency_code country_codeUKcountry_code to_usd_rate12550.00to_usd_rate fixedlength Native Data Format to Be Translated: Without Padding To define a fixed-length data in native schema, you can use the fixed-length style. In case the actual data is less than the length specified, the white spaces are not trimmed. The following is a sample native data to be translated: GBPUK000012550.00 Native Schema: Without Padding ?xml version=1.0 encoding=US-ASCII? schema xmlns=http:www.w3.org2001XMLSchema xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd targetNamespace=http:www.oracle.comiasprocessconnect elementFormDefault=qualified attributeFormDefault=unqualified nxsd:stream=chars nxsd:version=NXSD element name=fixedlength complexType sequence element name=currency_code nxsd:style=fixedLength nxsd:length=4 simpleType restriction base=string maxLength value=4 restriction simpleType element element name=country_code nxsd:style=fixedLength nxsd:length=2 simpleType restriction base=string Native Format Builder Wizard 6-13 length value=2 restriction simpleType element element name=to_usd_rate nxsd:style=fixedLength nxsd:length=12 simpleType restriction base=string maxLength value=12 restriction simpleType element sequence complexType element schema Translated XML Using the Native Schema: Without Padding fixedlength xmlns=http:www.oracle.comiasprocessconnect currency_codeGBPcurrency_code country_codeUKcountry_code to_usd_rate000012550.00to_usd_rate fixedlength Native Data Format to Be Translated: Actual Length Also Being Read from the Native Data When the length of the data is also stored in the native stream, this style is used to first read the length, and subsequently read the data according to the length read. The following is a sample native data to be translated: 03joe13DUZac.1HKVmIY Native Schema: Actual Length Also Being Read from the Native Data ?xml version=1.0 encoding=US-ASCII? schema xmlns=http:www.w3.org2001XMLSchema xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd targetNamespace=http:www.oracle.comiasprocessconnect elementFormDefault=qualified attributeFormDefault=unqualified nxsd:stream=chars nxsd:version=NXSD element name=fixedlength complexType sequence element name=user type=string nxsd:style=fixedLength nxsd:identifierLength=2 element name=encr_user type=string nxsd:style=fixedLength nxsd:identifierLength=2 sequence complexType element schema Translated XML Using the Native Schema: Actual Length Also Being Read from the Native Data fixedlength xmlns=http:www.oracle.comiasprocessconnect 6-14 Oracle Fusion Middleware Users Guide for Technology Adapters userjoeuser encr_userDUZac.1HKVmIYencr_user fixedlength

6.2.2.2 Defining Terminated Data

This format is used when the terminating mark itself is supposed to be treated as part of the actual data and not as a delimiter. When it is not clear whether the mark is part of actual data or not, you can use nxsd:quotedBy to be safe. Specifying nxsd:quotedBy means that the corresponding native data may or may not be quoted. If it is quoted, then the actual data is read from the begin quotation to the end quotation as specified in nxsd:quotedBy. Otherwise, it is read until the terminatedBy character is found. By default, the terminating mark is quot; . If your data includes this character, you must override this default even if the field is not quoted. For more information, see Native Data Format to Be Translated: Data Includes Default Quote Character on page 6-15. Examples for the Optionally quoted, Not quoted, and Includes default quote character scenarios are provided in the following sections: Native Data Format to Be Translated: Optionally Quoted The following is a sample native data to be translated: Fred,2 Old Street, Old Town,Manchester,20-08-1954,0161-499-1718 Native Schema: Optionally Quoted ?xml version=1.0 encoding=US-ASCII? schema xmlns=http:www.w3.org2001XMLSchema xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd targetNamespace=http:www.oracle.comiasprocessconnect elementFormDefault=qualified attributeFormDefault=unqualified nxsd:stream=chars nxsd:version=NXSD element name=terminated complexType sequence element name=PersonName type=string nxsd:style=terminated nxsd:terminatedBy=, element name=Address type=string nxsd:style=terminated nxsd:terminatedBy=, nxsd:quotedBy=quot; element name=DOB type=string nxsd:style=terminated nxsd:terminatedBy=, element name=Telephone type=string nxsd:style=terminated nxsd:terminatedBy={eol} sequence complexType element Translated XML Using the Native Schema: Optionally Quoted terminated xmlns=http:www.oracle.comiasprocessconnect PersonNameFredPersonName Address2 Old Street, Old Town,ManchesterAddress DOB20-08-1954DOB Telephone0161-499-1718Telephone terminated Native Format Builder Wizard 6-15 Native Data Format to Be Translated: Not Quoted This is used when the data is terminated by a particular string or character. The following is a sample native data to be translated: 1020,16,18,,1580.00 Native Schema: Not Quoted ?xml version=1.0 encoding=US-ASCII? schema xmlns=http:www.w3.org2001XMLSchema xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd targetNamespace=http:www.oracle.comiasprocessconnect elementFormDefault=qualified attributeFormDefault=unqualified nxsd:stream=chars nxsd:version=NXSD element name=terminated complexType sequence element name=product type=string nxsd:style=terminated nxsd:terminatedBy=, element name=ordered type=string nxsd:style=terminated nxsd:terminatedBy=, element name=inventory type=string nxsd:style=terminated nxsd:terminatedBy=, element name=backlog type=string nxsd:style=terminated nxsd:terminatedBy=, element name=listprice type=string nxsd:style=terminated nxsd:terminatedBy={eol} sequence complexType element schema Translated XML Using the Native Schema: Not Quoted terminated xmlns=http:www.oracle.comiasprocessconnect product1020product ordered16ordered inventory18inventory backlogbacklog listprice1580.00listprice terminated Native Data Format to Be Translated: Data Includes Default Quote Character The following is a sample native data to be translated: aaa,bbbbb,[cccc In this case, fields are terminated by commas, the character is part of the data in the second field, and the [ character is part of the data in the third field. Because the default nxsd:quotedBy terminating mark is quot; , the Oracle File Adapter will fail to translate field two even if you specify that this field is terminated by a comma character. To successfully translate this data, you must override the default nxsd:quotedBy terminating mark to any character that will not be part of the data for this field. In this example, we override the default nxsd:quotedBy terminating mark to lt; because we know that this character will never appear in field two: