我觉得我在这里疯了。
我正在尝试将XML数据导入到我使用xpathApply从usaspending.gov下载的R中。现在,我只是想隔离DateSigned attiribute。我觉得我的xpath语法是正确的,但我正在绘制一个空白列表。有什么想法吗?
require(XML)
file1 <- "FY12.xml"
download.file("http://usaspending.gov/fpds/fpds.php?detail=b&fiscal_year=2012&maj_agency_cat=97&max_records=10", file1, method="auto")
doc <- xmlTreeParse(file1, useInternalNode = TRUE)
top <- xmlRoot(doc)
test <- xpathApply(top, "/usaspendingSearchResults/result/doc/DateSigned", xmlValue)
编辑添加XML代码:
<?xml version="1.0" encoding="utf-8"?>
<usaspendingSearchResults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://usaspending.gov/schemas/" xsi:noNamespaceSchemaLocation="http://usaspending.gov/schemas/PrimeBasicContracts.xsd">
<search_criteria>
<search_criterion field="fiscal_year" value="2012"/>
<search_criterion field="maj_contracting_agency" value="97*"/>
<search_criterion field="Contracts" value="c"/>
<search_criterion field="sortby" value="DOLLARS_OBLIGATED desc"/>
<search_criterion field="records_from" value="0"/>
<search_criterion field="max_records" value="10"/>
</search_criteria>
<result numFound="1463044" max_records="10">
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Firm Fixed Price</ContractPricing>
<ContractingAgency>DEPT OF THE AIR FORCE</ContractingAgency>
<DUNSNumber>149879157</DUNSNumber>
<parentDUNSNumber>009256819</parentDUNSNumber>
<DateSigned>2012-03-08T05:00:00Z</DateSigned>
<ContractDescription>RSAF F-15 FLEET MODERNIZATION PROGRAM</ContractDescription>
<ReasonForModification/>
<DollarsObligated>3373879999.98</DollarsObligated>
<ExtentCompeted>NOT AVAILABLE FOR COMPETITION</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>14</TransactionNumber>
<FundingAgency>5700</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>5700</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>0</ModificationNumber>
<PSCCategoryCode>1510</PSCCategoryCode>
<ParentRecipientOrCompanyName>THE BOEING COMPANY</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>MO01</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>MISSOURI</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>631341939</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336411</PrincipalNAICSCode>
<ProcurementInstrumentID>FA863412C2651</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1510</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>8242</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>97</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>6200 JS MCDONNELL BLVD, , </RecipientAddressLine123>
<RecipientCity>SAINT LOUIS</RecipientCity>
<RecipientCongressionalDistrict>MO01</RecipientCongressionalDistrict>
<RecipientCountyName>SAINT LOUIS</RecipientCountyName>
<RecipientName>BOEING COMPANY, THE</RecipientName>
<RecipientOrContractorName>BOEING COMPANY, THE</RecipientOrContractorName>
<RecipientState>MO</RecipientState>
<RecipientZipCode>631341939</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Combination (two or more)</ContractPricing>
<ContractingAgency>DEPT OF THE NAVY</ContractingAgency>
<DUNSNumber>963737366</DUNSNumber>
<parentDUNSNumber>001381284</parentDUNSNumber>
<DateSigned>2012-01-31T05:00:00Z</DateSigned>
<ContractDescription>CONSTRUCTION OF SSN 784 (FY 09)</ContractDescription>
<ReasonForModification>FUNDING ONLY ACTION</ReasonForModification>
<DollarsObligated>2712135779.00</DollarsObligated>
<ExtentCompeted>NOT COMPETED</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>0</TransactionNumber>
<FundingAgency>1700</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>1700</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>P00022</ModificationNumber>
<PSCCategoryCode>1904</PSCCategoryCode>
<ParentRecipientOrCompanyName>GENERAL DYNAMICS CORPORATION</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>CT02</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>CONNECTICUT</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>063404909</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336611</PrincipalNAICSCode>
<ProcurementInstrumentID>N0002409C2104</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1904</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>1611</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>17</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>75 EASTERN POINT RD, , </RecipientAddressLine123>
<RecipientCity>GROTON</RecipientCity>
<RecipientCongressionalDistrict>CT02</RecipientCongressionalDistrict>
<RecipientCountyName>NEW LONDON</RecipientCountyName>
<RecipientName>ELECTRIC BOAT CORPORATION</RecipientName>
<RecipientOrContractorName>ELECTRIC BOAT CORPORATION</RecipientOrContractorName>
<RecipientState>CT</RecipientState>
<RecipientZipCode>063404905</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Cost Plus Fixed Fee</ContractPricing>
<ContractingAgency>DEPT OF THE NAVY</ContractingAgency>
<DUNSNumber>830135799</DUNSNumber>
<parentDUNSNumber>967362331</parentDUNSNumber>
<DateSigned>2012-05-31T04:00:00Z</DateSigned>
<ContractDescription>AWARD OF LHA 7 DETAIL DESIGN AND CONSTRUCTION.</ContractDescription>
<ReasonForModification>ADDITIONAL WORK (NEW AGREEMENT,FAR PART 6 APPLIES)</ReasonForModification>
<DollarsObligated>2156714483.00</DollarsObligated>
<ExtentCompeted>NOT COMPETED</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>0</TransactionNumber>
<FundingAgency>1700</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>1700</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>P00016</ModificationNumber>
<PSCCategoryCode>1911</PSCCategoryCode>
<ParentRecipientOrCompanyName>Huntington Ingalls Industries Inc.</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>MS04</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>MISSISSIPPI</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>395680149</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336611</PrincipalNAICSCode>
<ProcurementInstrumentID>N0002410C2229</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1911</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>1611</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>17</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>1000 ACCESS RD, , </RecipientAddressLine123>
<RecipientCity>PASCAGOULA</RecipientCity>
<RecipientCongressionalDistrict>MS00</RecipientCongressionalDistrict>
<RecipientCountyName>JACKSON</RecipientCountyName>
<RecipientName>NORTHROP GRUMMAN SHIPBUILDING, INC.</RecipientName>
<RecipientOrContractorName>NORTHROP GRUMMAN SHIPBUILDING, INC.</RecipientOrContractorName>
<RecipientState>MS</RecipientState>
<RecipientZipCode>395670149</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Firm Fixed Price</ContractPricing>
<ContractingAgency>DEPT OF THE AIR FORCE</ContractingAgency>
<DUNSNumber>832963495</DUNSNumber>
<parentDUNSNumber>009256819</parentDUNSNumber>
<DateSigned>2012-06-22T04:00:00Z</DateSigned>
<ContractDescription>F-15 S/SA CONVERSION&PROVISIOING</ContractDescription>
<ReasonForModification/>
<DollarsObligated>1828165500.00</DollarsObligated>
<ExtentCompeted>NOT AVAILABLE FOR COMPETITION</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>6</TransactionNumber>
<FundingAgency>5700</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>5700</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>0</ModificationNumber>
<PSCCategoryCode>J016</PSCCategoryCode>
<ParentRecipientOrCompanyName>THE BOEING COMPANY</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>MO01</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>MISSOURI</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>631341939</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336413</PrincipalNAICSCode>
<ProcurementInstrumentID>FA850512C0001</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>J016</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>8242</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>97</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>6200 J S MCDONNELL BLVD, , </RecipientAddressLine123>
<RecipientCity>SAINT LOUIS</RecipientCity>
<RecipientCongressionalDistrict>MO01</RecipientCongressionalDistrict>
<RecipientCountyName>SAINT LOUIS</RecipientCountyName>
<RecipientName>BOEING COMPANY, THE</RecipientName>
<RecipientOrContractorName>BOEING COMPANY, THE</RecipientOrContractorName>
<RecipientState>MO</RecipientState>
<RecipientZipCode>631341939</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Fixed Price Incentive</ContractPricing>
<ContractingAgency>DEPT OF THE NAVY</ContractingAgency>
<DUNSNumber>106632750</DUNSNumber>
<parentDUNSNumber>106632750</parentDUNSNumber>
<DateSigned>2011-11-23T05:00:00Z</DateSigned>
<ContractDescription>LOT 16 MV FULL FUNDING</ContractDescription>
<ReasonForModification>FUNDING ONLY ACTION</ReasonForModification>
<DollarsObligated>1681280764.36</DollarsObligated>
<ExtentCompeted>NOT COMPETED</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>0</TransactionNumber>
<FundingAgency>1700</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>1700</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>P00173</ModificationNumber>
<PSCCategoryCode>1520</PSCCategoryCode>
<ParentRecipientOrCompanyName>BELL BOEING JOINT PROJECT OFFICE</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>TX13</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>TEXAS</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>791111200</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336411</PrincipalNAICSCode>
<ProcurementInstrumentID>N0001907C0001</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1520</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>1506</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>17</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>401 TILTROTOR DR, , </RecipientAddressLine123>
<RecipientCity>AMARILLO</RecipientCity>
<RecipientCongressionalDistrict>TX13</RecipientCongressionalDistrict>
<RecipientCountyName>POTTER</RecipientCountyName>
<RecipientName>BELL BOEING JOINT PROJECT OFFICE</RecipientName>
<RecipientOrContractorName>BELL BOEING JOINT PROJECT OFFICE</RecipientOrContractorName>
<RecipientState>TX</RecipientState>
<RecipientZipCode>791111200</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Firm Fixed Price</ContractPricing>
<ContractingAgency>DEPT OF THE NAVY</ContractingAgency>
<DUNSNumber>039267141</DUNSNumber>
<parentDUNSNumber>009256819</parentDUNSNumber>
<DateSigned>2012-09-21T04:00:00Z</DateSigned>
<ContractDescription>DEFINITIZE P-8A LRIP III AIRCRAFT</ContractDescription>
<ReasonForModification>OTHER ADMINISTRATIVE ACTION</ReasonForModification>
<DollarsObligated>1600492644.00</DollarsObligated>
<ExtentCompeted>NOT COMPETED</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>0</TransactionNumber>
<FundingAgency>1700</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>1700</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>P00045</ModificationNumber>
<PSCCategoryCode>1560</PSCCategoryCode>
<ParentRecipientOrCompanyName>THE BOEING COMPANY</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>WA09</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>WASHINGTON</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>980322316</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336411</PrincipalNAICSCode>
<ProcurementInstrumentID>N0001909C0022</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1560</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>1506</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>17</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>20403 68TH AVE S MS 8K-10, , </RecipientAddressLine123>
<RecipientCity>KENT</RecipientCity>
<RecipientCongressionalDistrict>WA09</RecipientCongressionalDistrict>
<RecipientCountyName>KING</RecipientCountyName>
<RecipientName>THE BOEING COMPANY</RecipientName>
<RecipientOrContractorName>THE BOEING COMPANY</RecipientOrContractorName>
<RecipientState>WA</RecipientState>
<RecipientZipCode>980322316</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Fixed Price Incentive</ContractPricing>
<ContractingAgency>DEPT OF THE NAVY</ContractingAgency>
<DUNSNumber>008016958</DUNSNumber>
<parentDUNSNumber>834951691</parentDUNSNumber>
<DateSigned>2011-12-09T05:00:00Z</DateSigned>
<ContractDescription>AUTHORIZE EFFORTS ASSOCIATED WITH LRIP 5 PRODUCTION UNDEFINITIEZED CONTRACT ACTION (UCA)</ContractDescription>
<ReasonForModification>ADDITIONAL WORK (NEW AGREEMENT,FAR PART 6 APPLIES)</ReasonForModification>
<DollarsObligated>1592408644.00</DollarsObligated>
<ExtentCompeted>NOT COMPETED</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>0</TransactionNumber>
<FundingAgency>1700</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>1700</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>P00014</ModificationNumber>
<PSCCategoryCode>1510</PSCCategoryCode>
<ParentRecipientOrCompanyName>LOCKHEED MARTIN CORPORATION</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>TX12</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>TEXAS</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>761017450</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336411</PrincipalNAICSCode>
<ProcurementInstrumentID>N0001910C0002</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1510</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>3010</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>57</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>LOCKHEED BLVD, , </RecipientAddressLine123>
<RecipientCity>FORT WORTH</RecipientCity>
<RecipientCongressionalDistrict>TX00</RecipientCongressionalDistrict>
<RecipientCountyName>TARRANT</RecipientCountyName>
<RecipientName>LOCKHEED MARTIN CORPORATION</RecipientName>
<RecipientOrContractorName>LOCKHEED MARTIN CORPORATION</RecipientOrContractorName>
<RecipientState>TX</RecipientState>
<RecipientZipCode>761087450</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Firm Fixed Price</ContractPricing>
<ContractingAgency>DEPT OF THE ARMY</ContractingAgency>
<DUNSNumber>835551474</DUNSNumber>
<parentDUNSNumber>001344142</parentDUNSNumber>
<DateSigned>2012-06-06T04:00:00Z</DateSigned>
<ContractDescription>MULTI SERVICE, 5 YR, MULTI-YR CONTRACT FOR H-60 HELICOPTERS. FY2012 ¿ FY2016 PRODUCTION CONTRACT FOR ARMY/NAVY/FMS UH/HH/MH-60 HELICOPTERS TO INCLUDE PROCUREMENT OF UP TO 916 EACH AIRCRAFT AND RELATED SUPPORT, SERVICES, SYSTEMS/PROJECT MANAGEMENT, PUBLICATIONS, AND TECHNICAL DATA. FMS COUNTRIES INCLUDE SAUDI ARABIAN NATIONAL GUARD (SANG), TAIWAN, THAILAND AND ROYAL AUSTRALIAN NAVY (RAN).</ContractDescription>
<ReasonForModification/>
<DollarsObligated>1543229958.00</DollarsObligated>
<ExtentCompeted>NOT COMPETED</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>1</TransactionNumber>
<FundingAgency>2100</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>2100</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>0</ModificationNumber>
<PSCCategoryCode>1520</PSCCategoryCode>
<ParentRecipientOrCompanyName>UNITED TECHNOLOGIES CORPORATION</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>CT03</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>CONNECTICUT</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>066141385</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336411</PrincipalNAICSCode>
<ProcurementInstrumentID>W58RGZ12C0008</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1520</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>2031</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>21</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>6900 MAIN ST, , </RecipientAddressLine123>
<RecipientCity>STRATFORD</RecipientCity>
<RecipientCongressionalDistrict>CT03</RecipientCongressionalDistrict>
<RecipientCountyName>FAIRFIELD</RecipientCountyName>
<RecipientName>SIKORSKY AIRCRAFT CORPORATION</RecipientName>
<RecipientOrContractorName>SIKORSKY AIRCRAFT CORPORATION</RecipientOrContractorName>
<RecipientState>CT</RecipientState>
<RecipientZipCode>066141385</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Delivery Order</AwardType>
<ContractPricing>Fixed Price with Economic Price Adjustment</ContractPricing>
<ContractingAgency>DEFENSE LOGISTICS AGENCY</ContractingAgency>
<DUNSNumber>004294737</DUNSNumber>
<parentDUNSNumber>423792808</parentDUNSNumber>
<DateSigned>2012-09-20T04:00:00Z</DateSigned>
<ContractDescription>AWARD JP5
CLIN 0101 FOR 82,349,000 FOB ORIGIN DEER PARK, TX BY TANKER
CLIN 0201 FOR 212,860,000 FOB ORIGIN DEER PARK, TX BY PIPELINE
AWARD JP8
CLIN 0301 FOR 118,701,000 FOB ORIGIN DEER PARK, TX BY PIPELINE</ContractDescription>
<ReasonForModification/>
<DollarsObligated>1358320745.62</DollarsObligated>
<ExtentCompeted>FULL AND OPEN COMPETITION</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>0</TransactionNumber>
<FundingAgency>97AS</FundingAgency>
<IDVProcurementInstrumentID>SP060012D0510</IDVProcurementInstrumentID>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>97AS</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>0</ModificationNumber>
<PSCCategoryCode>9130</PSCCategoryCode>
<ParentRecipientOrCompanyName>ROYAL DUTCH SHELL PLC</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>TX18</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>TEXAS</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>770024916</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>324110</PrincipalNAICSCode>
<ProcurementInstrumentID>B001</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>9130</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>4930</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>97</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>910 LOUISIANA ST STE 2, , </RecipientAddressLine123>
<RecipientCity>HOUSTON</RecipientCity>
<RecipientCongressionalDistrict>TX18</RecipientCongressionalDistrict>
<RecipientCountyName>HARRIS</RecipientCountyName>
<RecipientName>EQUILON ENTERPRISES LLC</RecipientName>
<RecipientOrContractorName>EQUILON ENTERPRISES LLC</RecipientOrContractorName>
<RecipientState>TX</RecipientState>
<RecipientZipCode>770024916</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Delivery Order</TypeofTransaction>
</doc>
<doc spendingCategory="Contracts">
<record_count/>
<AwardType>Definitive Contract</AwardType>
<ContractPricing>Firm Fixed Price</ContractPricing>
<ContractingAgency>DEPT OF THE ARMY</ContractingAgency>
<DUNSNumber>835551474</DUNSNumber>
<parentDUNSNumber>001344142</parentDUNSNumber>
<DateSigned>2012-06-06T04:00:00Z</DateSigned>
<ContractDescription>MULTI SERVICE, 5 YR, MULTI-YR CONTRACT FOR H-60 HELICOPTERS. FY2012 ¿ FY2016 PRODUCTION CONTRACT FOR ARMY/NAVY/FMS UH/HH/MH-60 HELICOPTERS TO INCLUDE PROCUREMENT OF UP TO 916 EACH AIRCRAFT AND RELATED SUPPORT, SERVICES, SYSTEMS/PROJECT MANAGEMENT, PUBLICATIONS, AND TECHNICAL DATA. FMS COUNTRIES INCLUDE SAUDI ARABIAN NATIONAL GUARD (SANG), TAIWAN, THAILAND AND ROYAL AUSTRALIAN NAVY (RAN).</ContractDescription>
<ReasonForModification/>
<DollarsObligated>1284346737.00</DollarsObligated>
<ExtentCompeted>NOT COMPETED</ExtentCompeted>
<FiscalYear>2012</FiscalYear>
<TransactionNumber>2</TransactionNumber>
<FundingAgency>2100</FundingAgency>
<IDVProcurementInstrumentID/>
<MajorAgency>9700</MajorAgency>
<ContractingAgencyCode>2100</ContractingAgencyCode>
<MajorFundingAgency>9700</MajorFundingAgency>
<ModificationNumber>0</ModificationNumber>
<PSCCategoryCode>1520</PSCCategoryCode>
<ParentRecipientOrCompanyName>UNITED TECHNOLOGIES CORPORATION</ParentRecipientOrCompanyName>
<PlaceofPerformanceCongDistrict>CT03</PlaceofPerformanceCongDistrict>
<PlaceofPerformanceState>CONNECTICUT</PlaceofPerformanceState>
<PlaceofPerformanceZipCode>066141385</PlaceofPerformanceZipCode>
<PrincipalNAICSCode>336411</PrincipalNAICSCode>
<ProcurementInstrumentID>W58RGZ12C0008</ProcurementInstrumentID>
<PrincipalPlaceCountyOrCity/>
<ProductorServiceCode>1520</ProductorServiceCode>
<ProgramSource/>
<ProgramSourceAccountCode>8242</ProgramSourceAccountCode>
<ProgramSourceAgencyCode>11</ProgramSourceAgencyCode>
<ProgramSourceDescription/>
<RecipientAddressLine123>6900 MAIN ST, , </RecipientAddressLine123>
<RecipientCity>STRATFORD</RecipientCity>
<RecipientCongressionalDistrict>CT03</RecipientCongressionalDistrict>
<RecipientCountyName>FAIRFIELD</RecipientCountyName>
<RecipientName>SIKORSKY AIRCRAFT CORPORATION</RecipientName>
<RecipientOrContractorName>SIKORSKY AIRCRAFT CORPORATION</RecipientOrContractorName>
<RecipientState>CT</RecipientState>
<RecipientZipCode>066141385</RecipientZipCode>
<TypeofSpending>c</TypeofSpending>
<TypeofTransaction>Definitive Contract</TypeofTransaction>
</doc>
</result>
</usaspendingSearchResults>
答案 0 :(得分:3)
require(XML)
require(RCurl)
rURL <- "http://usaspending.gov/fpds/fpds.php?detail=b&fiscal_year=2012&maj_agency_cat=97&max_records=10"
rData <- getURL(rURL, useragent = 'mozilla', followlocation = TRUE)
xData <- xmlParse(rData)
观察
> xmlNamespaceDefinitions(xData ,simplify = TRUE)
xsi
"http://www.w3.org/2001/XMLSchema-instance"
"http://usaspending.gov/schemas/"
attr(,"class")
[1] "SimplifiedXMLNamespaceDefinitions" "XMLNamespaceDefinitions"
所以有多个命名空间定义。告诉R使用哪个
test <- xpathApply(xData, "//def:DateSigned"
, namespaces = c(def = "http://usaspending.gov/schemas/"))
> test
[[1]]
<DateSigned>2012-03-08T05:00:00Z</DateSigned>
[[2]]
<DateSigned>2012-01-31T05:00:00Z</DateSigned>
[[3]]
<DateSigned>2012-05-31T04:00:00Z</DateSigned>
[[4]]
<DateSigned>2012-06-22T04:00:00Z</DateSigned>
有关详细信息,请参阅How can I use xpath querying using R's XML library?。
来自`?xpathApply'
在XML文档中的节点上定义名称空间时, XPath表达式必须使用命名空间,即使它是默认值 XML文档/节点的命名空间。例如,假设我们有 一个XML文档'...'To 找到所有主题节点,我们可能想要使用XPath 表达'“/ help / topic”'。但是,我们必须使用明确的 与URI关联的名称空间前缀 'http://www.r-project.org/Rd'对应于XML中的那个 文献。所以我们将使用'getNodeSet(doc,“/ r:help / r:topic”,c(r =“http://www.r-project.org/Rd”))'。
答案 1 :(得分:1)
另一种方式是:
test = getNodeSet(doc, "//*[local-name() = 'DateSigned']")
答案 2 :(得分:0)
您可以使用很多在线工具来测试针对XML的XPath,例如:
第一个甚至对最常见的情况有一些最小的1行描述。可能这些可以帮助你。它可能是一个简单的命名空间映射问题,否则你的XPath对我来说没问题。