0 Replies Latest reply: Mar 11, 2013 5:42 PM by 996172 RSS

    NXSD: How to ignore multiple ${eol} at the end of a flat file?

    996172
      Hi,

      I'm using the JDeveloper's "Native Format Builder Wizard" to generate an XSD from a flat file like this:

      1234     32     28042011     FBBFGBFGB     210359     FDGSDG     185464     28042011
      5234123     32     4534     DFS     210359     GNBHNRWVF     185464     28042011
      234123     32     3453415     DFS     210359     FGDFSVDFG     185464     28042011
      3434     32     345345     WREYW     210359     AFDGAD     345243     28042011
      234123     32     675367     GUIK     210359     EWRWAE     234     28042011
      234134     32     2804267567011     FFADS     210359     CV     185464     28042011
      1324     32     79089     BFB     210359     GNBHNRWVF     185464     28042011
      It's a TAB separated values file, at the end of each row there is and *${eol}* and at the end of the file there is another *${eol}*

      So, yes, I have two *${eol}* at the end of my file.

      I got the following XSD using de Native Format Builder Wizard:

      <?xml version="1.0" encoding="UTF-8" ?>


      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
      xmlns:tns="http://xmlns.sky.com.mx/sib/FormateaEfectivoPagosAnticipados/OficinaNICRFAdptr"
      targetNamespace="http://xmlns.sky.com.mx/sib/FormateaEfectivoPagosAnticipados/OficinaNICRFAdptr"
      elementFormDefault="qualified"
      attributeFormDefault="unqualified"
      nxsd:version="NXSD"
      nxsd:stream="chars"
      nxsd:encoding="UTF-8">


      <xsd:element name="payments">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="payment" nxsd:cellSeparatedBy="${eol}" minOccurs="1" maxOccurs="unbounded">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="Cuenta" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="\t" nxsd:quotedBy="&quot;" />
      <xsd:element name="Importe" type="xsd:decimal" nxsd:style="terminated" nxsd:terminatedBy="\t" nxsd:quotedBy="&quot;" />
      <xsd:element name="Fecha" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="\t" nxsd:quotedBy="&quot;" />
      <xsd:element name="Varios" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="\t" nxsd:quotedBy="&quot;" />
      <xsd:element name="Varios1" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="\t" nxsd:quotedBy="&quot;" />
      <xsd:element name="FormaPago" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="\t" nxsd:quotedBy="&quot;" />
      <xsd:element name="Varios2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="\t" nxsd:quotedBy="&quot;" />
      <xsd:element name="Varios3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:schema>
      But it's not working because of the two last *${eol}*.I'm getting this error:
      Error while reading native data.
      [Line=8, Col=1] Expected "\t" for the data starting at the specified position, while trying to read the data for "element with name Cuenta", using "style" as "terminated" and >"terminatedBy" as "\t", but not found.
      Ensure that "\t", exists for the data starting at the specified position.
      That's because my XSD is trying to get a new ROW from the last line.

      How should I manage this?



      I will really appreciate any help.

      Regards

      Edited by: 993169 on Mar 11, 2013 3:40 PM