0

I'm having namespace problems with the root element of this document. My XML declarations match the documentation file, but I think the Schema may have been updated without updating the documentation.

I see in the Base Schema there is an element EFilingMegabatchXML which encloses EFilingBatchXML. EFilingBatchXML is also defined in the Base Schema file. Is that a problem?

My error:

Error: cvc-elt.1.a: Cannot find the declaration of element 'fc2:EFilingBatchXML'.

My XML:

<?xml version="1.0" encoding="UTF-8"?>
<fc2:EFilingBatchXML xmlns:fc2="www.fincen.gov/base"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="www.fincen.gov/base https://www.fincen.gov/sites/default/files/schema/base/EFL_CTRXBatchSchema.xsd"
ActivityCount="10" TotalAmount="100000" PartyCount="60">

Documentation here: https://bsaefiling.fincen.treas.gov/docs/XMLUserGuide_FinCENCTR.pdf

Base schema here: www.fincen.gov/base

Batch schema here: https://www.fincen.gov/base/EFL_CTRXBatchSchema.xsd

Excerpt from batch schema:

<xsd:schema xmlns="www.fincen.gov/base" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" targetNamespace="www.fincen.gov/base" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1">

<xsd:redefine schemaLocation="BSA_XML_2.0.xsd">
...
</xsd:redefine>

<xsd:element name="EFilingBatchXML">
...
</xsd:element>

...

</xsd:schema>
Womprat
  • 133
  • 11

1 Answers1

1

How do I know what my XML namespace should be from reading the XSD files?

The XML namespace of the root element of the XML document should match the targetNamespace attribute value of the governing XSD.

I see in the Base Schema there is an element EFilingMegabatchXML which encloses EFilingBatchXML. EFilingBatchXML is also defined in the Base Schema file. Is that a problem?

The root element must be defined at the top level of the associated XSD, so you would not be able to have an XML document with a EFilingBatchXML root element validate against the base schema since it doesn't have such an element at the top level.

From what you've posted (assuming it's representative of your actual case), fc2:EFilingBatchXML as the root element of your XML document with the fc2 namespace prefix bound to www.fincen.gov/base ought to associated with https://www.fincen.gov/sites/default/files/schema/base/EFL_CTRXBatchSchema.xsd per your xsi:schemaLocation attribute value. It's defined at the top-level there, so it should be accessible for documents for which it is a root element.

Sample Valid XML

The XSD seems to suffer from paper-form era requirements such as a minimum of six fc2:Party elements, so this "minimal" example is a bit long, but the following XML is valid against the XSD indicated in the xsi:schemaLocation attribute.

<?xml version="1.0" encoding="UTF-8"?>
<fc2:EFilingBatchXML TotalAmount="35000" PartyCount="6" ActivityCount="1"
  xsi:schemaLocation="www.fincen.gov/base
  https://www.fincen.gov/sites/default/files/schema/base/EFL_CTRXBatchSchema.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fc2="www.fincen.gov/base">
  <fc2:FormTypeCode>CTRX</fc2:FormTypeCode>
  <fc2:Activity SeqNum="1">
    <fc2:EFilingPriorDocumentNumber>0</fc2:EFilingPriorDocumentNumber>
    <fc2:FilingDateText>20200804</fc2:FilingDateText>
    <fc2:ActivityAssociation SeqNum="2">
      <fc2:CorrectsAmendsPriorReportIndicator></fc2:CorrectsAmendsPriorReportIndicator>
      <fc2:FinCENDirectBackFileIndicator></fc2:FinCENDirectBackFileIndicator>
      <fc2:InitialReportIndicator></fc2:InitialReportIndicator>
    </fc2:ActivityAssociation>
    <fc2:Party SeqNum="3">
      <fc2:ActivityPartyTypeCode>35</fc2:ActivityPartyTypeCode>
      <fc2:PartyName SeqNum="4"></fc2:PartyName>
    </fc2:Party>
    <fc2:Party SeqNum="5">
      <fc2:ActivityPartyTypeCode>35</fc2:ActivityPartyTypeCode>
      <fc2:PartyName SeqNum="6"></fc2:PartyName>
    </fc2:Party>
    <fc2:Party SeqNum="7">
      <fc2:ActivityPartyTypeCode>35</fc2:ActivityPartyTypeCode>
      <fc2:PartyName SeqNum="8"></fc2:PartyName>
    </fc2:Party>
    <fc2:Party SeqNum="9">
      <fc2:ActivityPartyTypeCode>35</fc2:ActivityPartyTypeCode>
      <fc2:PartyName SeqNum="10"></fc2:PartyName>
    </fc2:Party>
    <fc2:Party SeqNum="11">
      <fc2:ActivityPartyTypeCode>35</fc2:ActivityPartyTypeCode>
      <fc2:PartyName SeqNum="12"></fc2:PartyName>
    </fc2:Party>
    <fc2:Party SeqNum="13">
      <fc2:ActivityPartyTypeCode>35</fc2:ActivityPartyTypeCode>
      <fc2:PartyName SeqNum="14"></fc2:PartyName>
    </fc2:Party>
    <fc2:CurrencyTransactionActivity SeqNum="15">
      <fc2:AggregateTransactionIndicator></fc2:AggregateTransactionIndicator>
      <fc2:ArmoredCarServiceIndicator></fc2:ArmoredCarServiceIndicator>
      <fc2:ATMIndicator></fc2:ATMIndicator>
      <fc2:MailDepositShipmentIndicator></fc2:MailDepositShipmentIndicator>
      <fc2:NightDepositIndicator></fc2:NightDepositIndicator>
      <fc2:SharedBranchingIndicator></fc2:SharedBranchingIndicator>
      <fc2:TotalCashInReceiveAmountText></fc2:TotalCashInReceiveAmountText>
      <fc2:TotalCashOutAmountText></fc2:TotalCashOutAmountText>
      <fc2:TransactionDateText>20200804</fc2:TransactionDateText>
      <fc2:CurrencyTransactionActivityDetail SeqNum="16">
        <fc2:CurrencyTransactionActivityDetailTypeCode>55</fc2:CurrencyTransactionActivityDetailTypeCode>
        <fc2:DetailTransactionAmountText></fc2:DetailTransactionAmountText>
        <fc2:OtherCurrencyTransactionActivityDetailText></fc2:OtherCurrencyTransactionActivityDetailText>
        <fc2:OtherForeignCurrencyCountryText></fc2:OtherForeignCurrencyCountryText>
      </fc2:CurrencyTransactionActivityDetail>
    </fc2:CurrencyTransactionActivity>
  </fc2:Activity>
</fc2:EFilingBatchXML>

If this guidance doesn't lead you to be able to successfully validate your XML against the XSD in the xsd:schemaLocation attribute, then post a Minimum Complete Example that fails to validate for further assistance.

See also

kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • Thanks. This was a good explanation. Even after I satisfy all the requirements for number of elements, required fields, etc., I still get "Error A15: Unknown file error. Please contact the BSA E-Filing Help Desk for assistance." The Help Desk offers very little assistance (government agency). "You need to fix the errors and resubmit the file we can not make the corrections for you." Does the A15 error come from the XSD file? Can I troubleshoot the error myself by looking through the schema? – Womprat Aug 05 '20 at 03:39
  • `Error A15` has nothing to do with XSD validation. It is an application-specific error issued from their application, for which their own documentation provides no other remedy than to contact the BSA E-Filing Help Desk. So, you contact them again, and don't let them off the phone until explain exactly what the error means and how to remedy it. If they don't want to be bothered, then they should have written better documentation or a more robust application. In any event, no, there's nothing at the XML/XSD level that will explain their application-level fatal error message. – kjhughes Aug 05 '20 at 03:46