使用R从XML的CDATA部分提取数据

使用R从XML的CDATA部分提取数据,r,xml,cdata,data-extraction,R,Xml,Cdata,Data Extraction,我一直在努力使用R从XML的CDATA部分提取数据。下面是我一直在处理的文件部分 <DOCUMENT_INFO> <TEXT><![CDATA[ Management’s Discussion and Analysis Third quarter ended September 30, 2013 This Management?s Discussion and Analysis (“MD&A”) should be read in co

我一直在努力使用R从XML的CDATA部分提取数据。下面是我一直在处理的文件部分

<DOCUMENT_INFO>
<TEXT><![CDATA[




Management’s Discussion and Analysis  
Third quarter ended September 30, 2013    

This Management?s Discussion and Analysis (“MD&A”) should be read in conjunction with the  condensed interim  consolidated 
financial statements of First Quantum Minerals Ltd. (“First Quantum” or “the Company”) for the three months (“the quarter”) and 
nine  months  ended  September  30,  2013.  The  Company?s  results  have  been  prepared  in  accordance  with  International  Financial 
Reporting  Standards  (“IFRS”)  and  are  presented  in  United  States  dollars (“USD”),  tabular  amounts  in  millions,  except  where 
noted. Changes in accounting policies have been applied consistently to comparative periods unless otherwise noted. 

For  further  information  on  First  Quantum,  reference  should  be  made  to  its  public  filings  (including  its  most  recently  filed  AIF) 
which  are  available  on  SEDAR  at  www.sedar.com. Information  is  also  available  on  the  Company?s  website  at www.first-
quantum.com. This MD&A contains forward-looking information that is subject to risk factors, see “Regulatory Disclosures” for 
further  discussion. Information  on  risks  associated  with  investing  in  the  Company?s  securities  and  technical  and  scientific 
information under National Instrument 43-101 concerning the Company?s material properties, including information about mineral 
resources and reserves, are contained in its most recently filed AIF. This MD&A has been prepared as of October 30, 2013. 
SUMMARIZED OPERATING AND FINANCIAL RESULTS
1


Three months ended  
September 30 
Nine months ended  
September 30 
(USD millions unless otherwise noted) 
2013                 2012                 2013                 2012 
Copper production (tonnes)                                                                        114,488              84,144            297,490            222,198 
Copper sales (tonnes)                                                                                 105,859              77,396            290,459            217,896 
Cash cost of copper production (C1)
2
 (per lb)                                               $1.16                $1.44                $1.33                $1.51 
Realized copper price (per lb)                                                                      $3.10                $3.45                $3.22                $3.53 
Nickel production (contained tonnes)                                                          12,485                9,916              34,432              26,663 
Nickel sales (contained tonnes)                                                                    12,335                7,120              35,310              22,298 


我想使用R的XML包从这个文件中提取铜生产、铜销售等信息。

“挣扎”意味着代码尝试。所说的代码尝试在哪里?xml片段也是不完整的(因此无效)xml。您是否尝试过使用
xml
包?尝试使用
xmlParse()
解析完整的XML文件,并使用
xmlToList()
将该对象转换为列表。这个问题可能会帮助您:文本位于XML文档的CDATA部分这一事实肯定与此无关?以文本形式获取CDATA节的内容很简单,之后就没有标记,因此您不在XML标记或XML工具和技术可以帮助您的领域内。@hrbrmstr当然!我只是不想添加它,因为它是一个我不应该共享的文档。@MichaelKay我同意你的观点!