Read xml file that is subdivided in two xml

1

I am trying to read an xml file which is divided into two parts, it is as follows:

<?xml version="1.0" encoding="utf-8"?>
<CPU_ConfigData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <VersTablaCnf>
    <VersTabla>3</VersTabla>
    <IdInstalacion>0</IdInstalacion>
    <EdDatosCnf>3</EdDatosCnf>
  </VersTablaCnf>
  <SysCnf>
    <AddressMicroA>0</AddressMicroA>
    <AddressMicroB>32768</AddressMicroB>
    <CnfSopAddress>8192</CnfSopAddress>
  </SysCnf>
  <AppsCnf>
    <NumApps>2</NumApps>
    <AppCnf>
      <sAppCnf>
        <SafeOutputMask>AAAAAAAAAAAAAAAAAAA=</SafeOutputMask>
        <AuxOutputMask>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
        </AuxOutputMask>
      </sAppCnf>
      <sAppCnf>
        <SafeOutputMask>AAAAAAAAAAAAAAAAAAA=</SafeOutputMask>
        <AuxOutputMask>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
        </AuxOutputMask>
      </sAppCnf>
      <sAppCnf>
        <SafeOutputMask>AAAAAAAAAAAAAAAAAAA=</SafeOutputMask>
        <AuxOutputMask>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
        </AuxOutputMask>
      </sAppCnf>
    </AppCnf>
  </AppsCnf>
  <BusLocalCnf>
    <SlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>0</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>1</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>2</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>3</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>CPU</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>4</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>5</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>6</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>7</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>8</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>9</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>10</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>11</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>12</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>13</DeviceAddress>
      </sSlotCnf>
    </SlotCnf>
    <GpibCycleTime>50</GpibCycleTime>
    <GpibTimeout>5</GpibTimeout>
  </BusLocalCnf>
  <UartsCnf>
    <NumUarts>1</NumUarts>
    <ArrayUarts>
      <sUartCnf>
        <IdUart>1</IdUart>
        <BaudRate>57600</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>8</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
    </ArrayUarts>
  </UartsCnf>
  <DpCnf>
    <DPRAM0_NumChannels>2</DPRAM0_NumChannels>
    <DPRAM1_NumChannels>2</DPRAM1_NumChannels>
  </DpCnf>
  <RoutingTable>
    <NumRoutes>6</NumRoutes>
    <ArrayRoutes>
      <sRoute>
        <OrigenAdd>65535</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>QVBQMAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>32768</DestinoAdd>
        <MailBoxId>RFBSQU0xMAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>65535</OrigenAdd>
        <DestinoAdd>8192</DestinoAdd>
        <MailBoxId>RFBSQU0wMAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>65535</OrigenAdd>
        <DestinoAdd>12</DestinoAdd>
        <MailBoxId>QVBQMQAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>12</OrigenAdd>
        <DestinoAdd>16397</DestinoAdd>
        <MailBoxId>RFBSQU0wMQA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>12</OrigenAdd>
        <DestinoAdd>10</DestinoAdd>
        <MailBoxId>Q09NMQAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
    </ArrayRoutes>
  </RoutingTable>
  <CrcInstance>
    <CRCp>0</CRCp>
  </CrcInstance>
</CPU_ConfigData><?xml version="1.0" encoding="utf-8"?>
<CPU_ConfigData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <VersTablaCnf>
    <VersTabla>3</VersTabla>
    <IdInstalacion>0</IdInstalacion>
    <EdDatosCnf>3</EdDatosCnf>
  </VersTablaCnf>
  <SysCnf>
    <AddressMicroA>32768</AddressMicroA>
    <AddressMicroB>0</AddressMicroB>
    <CnfSopAddress>8192</CnfSopAddress>
  </SysCnf>
  <AppsCnf>
    <NumApps>2</NumApps>
    <AppCnf>
      <sAppCnf>
        <SafeOutputMask>AAAAAAAAAAAAAAAAAAA=</SafeOutputMask>
        <AuxOutputMask>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
          <unsignedInt>512</unsignedInt>
        </AuxOutputMask>
      </sAppCnf>
      <sAppCnf>
        <SafeOutputMask>AAAAAAAAAAAAAAAAAAA=</SafeOutputMask>
        <AuxOutputMask>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
        </AuxOutputMask>
      </sAppCnf>
      <sAppCnf>
        <SafeOutputMask>AAAAAAAAAAAAAAAAAAA=</SafeOutputMask>
        <AuxOutputMask>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
          <unsignedInt>0</unsignedInt>
        </AuxOutputMask>
      </sAppCnf>
    </AppCnf>
  </AppsCnf>
  <BusLocalCnf>
    <SlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>15</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>14</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>13</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>12</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>CPU</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>11</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>10</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>9</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>8</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>7</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>6</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>5</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>4</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>3</DeviceAddress>
      </sSlotCnf>
      <sSlotCnf>
        <DeviceType>None</DeviceType>
        <DeviceFunction>Device</DeviceFunction>
        <DeviceAddress>2</DeviceAddress>
      </sSlotCnf>
    </SlotCnf>
    <GpibCycleTime>50</GpibCycleTime>
    <GpibTimeout>5</GpibTimeout>
  </BusLocalCnf>
  <UartsCnf>
    <NumUarts>1</NumUarts>
    <ArrayUarts>
      <sUartCnf>
        <IdUart>1</IdUart>
        <BaudRate>57600</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>8</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
      <sUartCnf>
        <IdUart>0</IdUart>
        <BaudRate>0</BaudRate>
        <Parity>0</Parity>
        <StopBits>0</StopBits>
        <FlowControl>0</FlowControl>
        <DataBits>0</DataBits>
        <TransportProtocol>0</TransportProtocol>
      </sUartCnf>
    </ArrayUarts>
  </UartsCnf>
  <DpCnf>
    <DPRAM0_NumChannels>2</DPRAM0_NumChannels>
    <DPRAM1_NumChannels>2</DPRAM1_NumChannels>
  </DpCnf>
  <RoutingTable>
    <NumRoutes>6</NumRoutes>
    <ArrayRoutes>
      <sRoute>
        <OrigenAdd>65535</OrigenAdd>
        <DestinoAdd>32768</DestinoAdd>
        <MailBoxId>QVBQMAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>32768</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>RFBSQU0xMAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>65535</OrigenAdd>
        <DestinoAdd>8192</DestinoAdd>
        <MailBoxId>RFBSQU0wMAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>65535</OrigenAdd>
        <DestinoAdd>32780</DestinoAdd>
        <MailBoxId>QVBQMQAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>32780</OrigenAdd>
        <DestinoAdd>16397</DestinoAdd>
        <MailBoxId>RFBSQU0wMQA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>32780</OrigenAdd>
        <DestinoAdd>32778</DestinoAdd>
        <MailBoxId>Q09NMQAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
      <sRoute>
        <OrigenAdd>0</OrigenAdd>
        <DestinoAdd>0</DestinoAdd>
        <MailBoxId>AAAAAAAAAAA=</MailBoxId>
      </sRoute>
    </ArrayRoutes>
  </RoutingTable>
  <CrcInstance>
    <CRCp>0</CRCp>
  </CrcInstance>
</CPU_ConfigData>

That is, I want to read until you find me <?xml version=... For now my code is as follows:

public static Object LoadConfigFromXML(string psConfigFilePath, XmlSerializer loSerializerInstance)
{
     Object loReturn = null;

     // Lee la configuración a partir del fichero
     try
     {
         FileStream loReadFileECCEStream = new FileStream(psConfigFilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
         XmlSerializer loECCESerializerInstance = loSerializerInstance;

         loReturn = loECCESerializerInstance.Deserialize(loReadFileECCEStream);

         // Cleanup
         loReadFileECCEStream.Close();

         return loReturn;
     }
     catch (Exception)
     {
         return loReturn;
     }
 }

You are giving me the following error:

  
  • $ exception {"Error in XML document (363, 20)."} System.InvalidOperationException

  •   
  • InnerException {"Unexpected XML declaration." The XML declaration must be the first node in the document and blanks may not appear in front of it, line 363, position 20. "} System.Exception {System.Xml.XmlException}

  •   

Where loSerializerInstance = new XmlSerializer(typeof(CPU_ConfigData));

Does anyone know how I can read the file until it is? xml and close the file at that point? Thanks in advance for the help

    
asked by Xim123 13.09.2018 в 08:30
source

1 answer

1

What you must do is process the file first to divide it into the parts you have, to later deserialize it. For this you can use Split :

var xmltext=File.ReadAllText(ruta a tu archivo xml);
var dividido = xmltext.Split(new string[]{ "<?xml"},StringSplitOptions.RemoveEmptyEntries);
foreach(string xml in dividido)
{
     var xmlfinal = "<?xml" + xml; //añadimos esto porque split lo quita
     LoadConfigFromXml(xmlfinal);  //tendrás que cambiar el método para que lea el xml 
                                   //de un string en lugar de desde un archivo
}

This code would allow not only two, but several concatenated xml.

    
answered by 13.09.2018 / 09:55
source