在Codeigniter中解析xml文件

时间:2019-06-29 16:45:24

标签: xml codeigniter

我正在尝试使用Codeigniter解析xml文件。基本上,我需要读取上传到远程服务器的xml文件。

问题是xml文件非常复杂(至少对我而言),因此我无法从中获取一些相关数据。

xml文件内容如下:

for i in 0..<self.itemSpecificsArray.count {
                    let itemSpecificName = UILabel()
                    let itemSpecificValue = UILabel()

                    itemSpecificName.textColor = UIColor(red: 236.0 / 255.0, green: 91.0 / 255.0, blue: 110.0 / 255.0, alpha: 1.0)
                    itemSpecificName.textAlignment = .left
                    itemSpecificName.font = UIFont.boldSystemFont(ofSize: 18.0)

                    itemSpecificValue.textColor = UIColor.black
                    itemSpecificValue.textAlignment = .left
                    itemSpecificValue.font = UIFont.systemFont(ofSize: 15.0)

                    print(self.itemSpecificsArray[i].itemSpecificName)
                    print("** \(self.itemSpecificsArray[i].itemSpecificValue)")
                    itemSpecificName.text = self.itemSpecificsArray[i].itemSpecificName
                    itemSpecificValue.text = self.itemSpecificsArray[i].itemSpecificValue

                    self.mainSectionItemSpecifics.addArrangedSubview(itemSpecificName)
                    self.mainSectionItemSpecifics.addArrangedSubview(itemSpecificValue)
                     if (i == self.itemSpecificsArray.count) {
                        let view = UIView()
                        self.mainSectionItemSpecifics.addArrangedSubview(view)
                    }
                }

有很多行没有用,我只需要像下面的代码那样提取数据:

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>Microsoft Corporation</Author>
  <LastAuthor>e37180</LastAuthor>
  <LastPrinted>2019-01-08T09:14:46Z</LastPrinted>
  <Created>1996-11-05T10:16:36Z</Created>
  <LastSaved>2019-01-08T09:15:43Z</LastSaved>
  <Company>Microsoft Corporation</Company>
  <Version>12.00</Version>
 </DocumentProperties>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>6600</WindowHeight>
  <WindowWidth>11895</WindowWidth>
  <WindowTopX>0</WindowTopX>
  <WindowTopY>1545</WindowTopY>
  <TabRatio>601</TabRatio>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Arial"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s16" ss:Name="Calcolo">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#7F7F7F"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#7F7F7F"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#7F7F7F"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#7F7F7F"/>
   </Borders>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#FA7D00"
    ss:Bold="1"/>
   <Interior ss:Color="#F2F2F2" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="m82096448">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="14" ss:Bold="1"/>
   <Interior ss:Color="#FFFF00" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s17">
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Bold="1"/>
  </Style>
  <Style ss:ID="s18">
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Bold="1"/>
  </Style>
  <Style ss:ID="s19">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
   <NumberFormat ss:Format="@"/>
  </Style>
  <Style ss:ID="s20">
   <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
   <NumberFormat ss:Format="@"/>
  </Style>
  <Style ss:ID="s21">
   <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Bold="1"/>
  </Style>
  <Style ss:ID="s22">
   <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Bold="1"/>
  </Style>
  <Style ss:ID="s23" ss:Parent="s16">
   <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
   <Borders/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Bold="1"/>
   <Interior/>
  </Style>
  <Style ss:ID="s24">
   <Alignment ss:Vertical="Center" ss:WrapText="1"/>
   <Borders/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s25">
   <Borders/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Bold="1"/>
  </Style>
  <Style ss:ID="s26">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Italic="1"/>
   <NumberFormat ss:Format="@"/>
  </Style>
  <Style ss:ID="s27">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Bold="1"/>
   <Interior ss:Color="#FFFFCC" ss:Pattern="Solid"/>
   <NumberFormat ss:Format="@"/>
  </Style>
  <Style ss:ID="s28">
   <Borders>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Bold="1"/>
   <Interior ss:Color="#FFFFCC" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s29">
   <Borders>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Bold="1"/>
   <Interior ss:Color="#FFFFCC" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s36">
   <Alignment ss:Vertical="Center"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11"/>
   <Interior/>
  </Style>
  <Style ss:ID="s37">
   <Alignment ss:Vertical="Center"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11"/>
   <Interior/>
  </Style>
  <Style ss:ID="s38">
   <Alignment ss:Vertical="Center"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"
     ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11"/>
   <Interior/>
  </Style>
  <Style ss:ID="s39">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11"/>
  </Style>
  <Style ss:ID="s40">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11"/>
  </Style>
  <Style ss:ID="s41">
   <Alignment ss:Vertical="Center" ss:WrapText="1"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s42">
   <Alignment ss:Vertical="Center" ss:WrapText="1"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s43">
   <Alignment ss:Vertical="Center" ss:WrapText="1"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"
     ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s44">
   <Alignment ss:Vertical="Center" ss:WrapText="1"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"
     ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s45">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous"/>
   </Borders>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11" ss:Italic="1"/>
   <NumberFormat ss:Format="@"/>
  </Style>
  <Style ss:ID="s49">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="14" ss:Bold="1"/>
  </Style>
  <Style ss:ID="s50">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Bold="1"/>
  </Style>
  <Style ss:ID="s51">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="12" ss:Bold="1"/>
  </Style>
 </Styles>
 <Worksheet ss:Name="CN_gennaio 2017">
  <Names>
   <NamedRange ss:Name="Print_Area" ss:RefersTo="='CN_gennaio 2017'!R1C1:R15C6"/>
  </Names>
  <Table ss:ExpandedColumnCount="10" ss:ExpandedRowCount="15" x:FullColumns="1"
   x:FullRows="1" ss:StyleID="s17" ss:DefaultRowHeight="15">
   <Column ss:StyleID="s19" ss:AutoFitWidth="0" ss:Width="20.25"/>
   <Column ss:StyleID="s17" ss:Width="301.5"/>
   <Column ss:StyleID="s18" ss:Width="248.25"/>
   <Column ss:StyleID="s18" ss:Width="105"/>
   <Column ss:StyleID="s17" ss:Width="103.5"/>
   <Column ss:StyleID="s17" ss:Width="124.5"/>
   <Row ss:Height="18">
    <Cell ss:MergeAcross="5" ss:StyleID="m82096448"><Data ss:Type="String">Certificati di Navigabilità rilasciati nel mese di dicembre 2018</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:Index="8" ss:MergeAcross="2" ss:StyleID="s49"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="16.5">
    <Cell ss:StyleID="s27"><Data ss:Type="String">N°</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s28"><Data ss:Type="String">Esercente </Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s28"><Data ss:Type="String">Costruttore</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s28"><Data ss:Type="String">Modello</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s28"><Data ss:Type="String">Marche</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s29"><Data ss:Type="String">Tipo C.N.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:Index="8" ss:MergeAcross="2" ss:StyleID="s50"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">1</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s39"><Data ss:Type="String">ESERCENTE PRIVATO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s40"><Data ss:Type="String">PIPER AIRCRAFT CORPORATION</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s40"><Data ss:Type="String">PA-28RT-201T</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s40"><Data ss:Type="String">I-JALU</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s36"><Data ss:Type="String">STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">2</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">ASTERAVIATION S.R.L.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">PIPER AIRCRAFT CORPORATION</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">PA-28-151</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">I-ASTV</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">3</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">LEONARDO S.P.A.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">AGUSTAWESTLAND S.P.A.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">AW139</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">I-AWTV</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">4</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">A.D.B. - AMICI DEL BUCKER</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">BÜCKER BERLIN UND F.A.A.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">BÜ 131 JUNGANN</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">I-BUCK</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">SPECIALE/STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">5</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">ALIDAUNIA TRAINING S.R.L.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">ROBINSON HELICOPTER COMPANY</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">R44</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">I-LIDH</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">6</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">ESERCENTE ESTERO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">COSTRUZIONI AERONAUTICHE TECNAM S.P.A</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">P2006T</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">P2006T NC264/US</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">EXPORT/US</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">7</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">ESERCENTE ESTERO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">COSTRUZIONI AERONAUTICHE TECNAM S.P.A</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">P-2010</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">P2010 NC 059</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">EXPORT</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">8</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">ASTERAVIATION SRL</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">REIMS AVIATION</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">CESSNA F 150 L</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">I-PROS</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">9</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">AERO CLUB DI VARESE A.S.D.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">CESSNA AIRCRAFT COMPANY</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">172S</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">I-ROCO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s26"><Data ss:Type="String">10</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s41"><Data ss:Type="String">ESERCENTE PRIVATO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">COSTRUZIONE AMATORIALE</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">MIDGET MUSTANG</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s42"><Data ss:Type="String">I-ROKO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s37"><Data ss:Type="String">SPECIALE/STANDARD</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s45"><Data ss:Type="String">11</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s43"><Data ss:Type="String">ESERCENTE ESTERO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s44"><Data ss:Type="String">VULCANAIR S.P.A.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s44"><Data ss:Type="String">VULCANAIR V1.0</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s44"><Data ss:Type="String">VH-VOI</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s38"><Data ss:Type="String">EXPORT</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:Height="14.25">
    <Cell ss:Index="2" ss:StyleID="s24"><NamedCell ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s24"><NamedCell ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s24"><NamedCell ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s24"><NamedCell ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s25"><NamedCell ss:Name="Print_Area"/></Cell>
   </Row>
   <Row ss:Height="15.75" ss:StyleID="s21">
    <Cell ss:StyleID="s20"><NamedCell ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s23"><Data ss:Type="String">TOTALE CN dicembre 2018: 11</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s22"><NamedCell ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s22"><NamedCell ss:Name="Print_Area"/></Cell>
    <Cell ss:Index="8" ss:MergeAcross="2" ss:StyleID="s51"/>
   </Row>
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Layout x:Orientation="Landscape" x:CenterHorizontal="1"/>
    <Header x:Margin="0.23622047244094491" x:Data="&amp;L&amp;12&amp;G"/>
    <Footer x:Margin="0.15748031496062992"
     x:Data="&amp;L&amp;9Funzione Organizzativa Contatti con la Stampa&amp;R&amp;9Documento aggiornato al &amp;D"/>
    <PageMargins x:Bottom="0.31496062992125984" x:Left="0.23622047244094491"
     x:Right="0.23622047244094491" x:Top="1.2598425196850394"/>
   </PageSetup>
   <FitToPage/>
   <Print>
    <ValidPrinterInfo/>
    <PaperSizeIndex>9</PaperSizeIndex>
    <Scale>85</Scale>
    <HorizontalResolution>600</HorizontalResolution>
    <VerticalResolution>600</VerticalResolution>
   </Print>
   <Zoom>85</Zoom>
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>28</ActiveRow>
     <ActiveCol>1</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="Foglio1">
  <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"
   x:FullRows="1">
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>36</ActiveRow>
     <ActiveCol>1</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>

我需要ESERCENTE ESTERO,VULCANAIR S.P.A.,VULCANAIR V1.0,VH-VOI和EXPORT。

使用Codeigniter,我在控制器中使用以下代码来读取整个文件:

<Row ss:AutoFitHeight="0" ss:Height="24.5625">
    <Cell ss:StyleID="s45"><Data ss:Type="String">11</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s43"><Data ss:Type="String">ESERCENTE ESTERO</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s44"><Data ss:Type="String">VULCANAIR S.P.A.</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s44"><Data ss:Type="String">VULCANAIR V1.0</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s44"><Data ss:Type="String">VH-VOI</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
    <Cell ss:StyleID="s38"><Data ss:Type="String">EXPORT</Data><NamedCell
      ss:Name="Print_Area"/></Cell>
   </Row>

之后,我将$ xml对象传递到视图中,直到尝试使用以下命令打印所有内容:

$xml = simplexml_load_file($path_to_file);

但是我得到:

foreach($xml->children() as $child)
{
    echo $child->getName() . ": " . $child . "<br />";
}

感谢您的帮助,以了解我在做什么错。

0 个答案:

没有答案