title: How to read a XML file with spark that contains multiple namespaces?
body: <p>I'm using the spark-xml library in Azure-Databricks. But I can't get the options right to read this kind of file that contains multiple namespaces.</p>
  
  <p>So I'm looking for some help to get this coded in the options, or any other approach.</p>
  
  <p>Here is a stripped sample.</p>
  
  <pre><code>&lt;msg:TrainTrackingMessage xmlns:msg="be:brail:nmbs-it:esb:msg:traintraffic" xmlns:trtf="be:brail:nmbs-it:esb:traintraffic" xmlns:gene="be:brail:nmbs-it:esb:generalelements"&gt;
  &lt;gene:Event&gt;
      &lt;gene:EventType&gt;tracking&lt;/gene:EventType&gt;
      &lt;gene:EventMessage&gt;TrainTracking&lt;/gene:EventMessage&gt;
      &lt;gene:EventTimeStamp&gt;2018-09-27T14:13:15.458439&lt;/gene:EventTimeStamp&gt;
  &lt;/gene:Event&gt;
  &lt;gene:Train&gt;
      &lt;gene:TrainKey&gt;
          &lt;gene:CirculationType&gt;1&lt;/gene:CirculationType&gt;
          &lt;gene:Discriminator&gt;0&lt;/gene:Discriminator&gt;
          &lt;gene:DepartureDate&gt;2018-09-27&lt;/gene:DepartureDate&gt;
      &lt;/gene:TrainKey&gt;
      &lt;gene:TrainNumberEBP&gt;2E0xaZ12&lt;/gene:TrainNumberEBP&gt;
      &lt;gene:TrainDetails&gt;
          &lt;gene:TrainGroup&gt;1&lt;/gene:TrainGroup&gt;
      &lt;/gene:TrainDetails&gt;
  &lt;/gene:Train&gt;
  &lt;trtf:TrainTracking&gt;
      &lt;gene:ItineraryPoint&gt;
          &lt;gene:PtcarIdentification&gt;592&lt;/gene:PtcarIdentification&gt;
          &lt;gene:OrderNumber&gt;150&lt;/gene:OrderNumber&gt;
          &lt;gene:ItineraryPointDetails&gt;
              &lt;gene:OperationCode&gt;=&lt;/gene:OperationCode&gt;
              &lt;gene:CommercialStop&gt;2&lt;/gene:CommercialStop&gt;
          &lt;/gene:ItineraryPointDetails&gt;
          &lt;gene:ItineraryPointTimeInfo&gt;
              &lt;gene:ArrivalTime&gt;14:10:47&lt;/gene:ArrivalTime&gt;
              &lt;gene:DepartureTime&gt;14:10:54&lt;/gene:DepartureTime&gt;
          &lt;/gene:ItineraryPointTimeInfo&gt;
          &lt;gene:ItineraryTechnicalInfo&gt;
              &lt;gene:EngineType&gt;21&lt;/gene:EngineType&gt;
              &lt;gene:TractionCode&gt;E&lt;/gene:TractionCode&gt;
              &lt;gene:TractionOperator/&gt;
          &lt;/gene:ItineraryTechnicalInfo&gt;
      &lt;/gene:ItineraryPoint&gt;
      &lt;trtf:GPSPosition&gt;
          &lt;trtf:GPSAltitude&gt;51&lt;/trtf:GPSAltitude&gt;
      &lt;/trtf:GPSPosition&gt;
      &lt;trtf:Libelle&gt;E2412&lt;/trtf:Libelle&gt;
      &lt;trtf:TrackingPointInfo&gt;
          &lt;trtf:TrackingType&gt;2&lt;/trtf:TrackingType&gt;
          &lt;trtf:TrackingOrigin&gt;0&lt;/trtf:TrackingOrigin&gt;
      &lt;/trtf:TrackingPointInfo&gt;
      &lt;trtf:TrackingTimeInfo&gt;
          &lt;trtf:Delay&gt;1639&lt;/trtf:Delay&gt;
      &lt;/trtf:TrackingTimeInfo&gt;
  &lt;/trtf:TrainTracking&gt;
  </code></pre>
  
  <p></p>