Necesito urgente pasar esta estructura a php p
¿Tengo una estructura en xml y necesito pasarla a php para que tome los datos de una base de Mysql y me lo haga varias veces por archivos separados?
$xml='
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns1:Facturae xmlns:ns1=" imagen" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FileHeader>
<SchemaVersion>3</SchemaVersion>
<Modality>I</Modality>
<InvoiceIssuerType>EM</InvoiceIssuerType>
<Batch>
<BatchIdentifier>66666666H1/238/08</BatchIdentifier>
<InvoicesCount>1</InvoicesCount>
<TotalInvoicesAmount>
<TotalAmount>1.16</TotalAmount>
</TotalInvoicesAmount>
<TotalOutstandingAmount>
<TotalAmount>1.16</TotalAmount>
</TotalOutstandingAmount>
<TotalExecutableAmount>
<TotalAmount>1.16</TotalAmount>
</TotalExecutableAmount>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
</Batch>
</FileHeader>
<Parties>
<SellerParty>
<TaxIdentification>
<PersonTypeCode>F</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>ES66666666H</TaxIdentificationNumber>
</TaxIdentification>
<Individual>
<Name>Cámara Demo</Name>
<AddressInSpain>
<Address>Calle Camara demo</Address>
<PostCode>1</PostCode>
<Town>MADRID</Town>
<Province>MADRID</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
<ContactDetails>
<Telephone>915383500</Telephone>
<TeleFax>910010200</TeleFax>
<WebAddress>www.camaraDemo.es</WebAddress>
<ContactPersons>Cámara Demo</ContactPersons>
</ContactDetails>
</Individual>
</SellerParty>
<BuyerParty>
<TaxIdentification>
<PersonTypeCode>J</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>ESA99999998</TaxIdentificationNumber>
</TaxIdentification>
<LegalEntity>
<CorporateName>Cliente 1</CorporateName>
<AddressInSpain>
<Address>Calle demo</Address>
<PostCode>8034</PostCode>
<Town>BARCELONA</Town>
<Province>BARCELONA</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
<ContactDetails>
<ElectronicMail> </ElectronicMail>
<ContactPersons>Cliente 1</ContactPersons>
</ContactDetails>
</LegalEntity>
</BuyerParty>
</Parties>
<Invoices>
<Invoice>
<InvoiceHeader>
<InvoiceNumber>121</InvoiceNumber>
<InvoiceDocumentType>FC</InvoiceDocumentType>
<InvoiceClass>OO</InvoiceClass>
</InvoiceHeader>
<InvoiceIssueData>
<IssueDate>2008-03-27+00:00</IssueDate>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
<TaxCurrencyCode>EUR</TaxCurrencyCode>
</InvoiceIssueData>
<TaxesOutputs>
<Tax>
<TaxTypeCode>1</TaxTypeCode>
<TaxRate>16</TaxRate>
<TaxableBase>
<TotalAmount>1</TotalAmount>
</TaxableBase>
<TaxAmount>
<TotalAmount>0.16</TotalAmount>
</TaxAmount>
</Tax>
</TaxesOutputs>
<InvoiceTotals>
<TotalGrossAmount>1</TotalGrossAmount>
<GeneralDiscounts>
<Discount>
<DiscountReason>16.00-1.00</DiscountReason>
<DiscountRate>0</DiscountRate>
<DiscountAmount>0</DiscountAmount>
</Discount>
</GeneralDiscounts>
<TotalGeneralDiscounts>0</TotalGeneralDiscounts>
<TotalGrossAmountBeforeTaxes>1</TotalGrossAmountBeforeTaxes>
<TotalTaxOutputs>0.16</TotalTaxOutputs>
<TotalTaxesWithheld>0</TotalTaxesWithheld>
<InvoiceTotal>1.16</InvoiceTotal>
<TotalOutstandingAmount>1.16</TotalOutstandingAmount>
<TotalExecutableAmount>1.16</TotalExecutableAmount>
</InvoiceTotals>
<Items>
<InvoiceLine>
<ItemDescription>PRUEBA</ItemDescription>
<Quantity>1</Quantity>
<UnitPriceWithoutTax>1</UnitPriceWithoutTax>
<TotalCost>1</TotalCost>
<GrossAmount>1</GrossAmount>
<TaxesOutputs>
<Tax>
<TaxTypeCode>1</TaxTypeCode>
<TaxRate>16</TaxRate>
<TaxableBase>
<TotalAmount>1</TotalAmount>
<EquivalentInEuros>1</EquivalentInEuros>
</TaxableBase>
</Tax>
</TaxesOutputs>
<TransactionDate>2008-03-03+00:00</TransactionDate>
</InvoiceLine>
</Items>
<PaymentDetails>
<Installment>
<InstallmentDueDate>2008-03-27+00:00</InstallmentDueDate>
<InstallmentAmount>1.16</InstallmentAmount>
<PaymentMeans>4</PaymentMeans>
<AccountToBeCredited>
<IBAN>ES00300000000000000000</IBAN>
<BankCode>30</BankCode>
<BranchCode>0</BranchCode>
<BranchInSpainAddress>
<Address>Calle Banco</Address>
<PostCode>0</PostCode>
<Town>Madrid</Town>
<Province>España</Province>
<CountryCode>ESP</CountryCode>
</BranchInSpainAddress>
</AccountToBeCredited>
</Installment>
</PaymentDetails>
</Invoice>
</Invoices>
</ns1:Facturae>';
$xml='
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns1:Facturae xmlns:ns1=" imagen" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FileHeader>
<SchemaVersion>3</SchemaVersion>
<Modality>I</Modality>
<InvoiceIssuerType>EM</InvoiceIssuerType>
<Batch>
<BatchIdentifier>66666666H1/238/08</BatchIdentifier>
<InvoicesCount>1</InvoicesCount>
<TotalInvoicesAmount>
<TotalAmount>1.16</TotalAmount>
</TotalInvoicesAmount>
<TotalOutstandingAmount>
<TotalAmount>1.16</TotalAmount>
</TotalOutstandingAmount>
<TotalExecutableAmount>
<TotalAmount>1.16</TotalAmount>
</TotalExecutableAmount>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
</Batch>
</FileHeader>
<Parties>
<SellerParty>
<TaxIdentification>
<PersonTypeCode>F</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>ES66666666H</TaxIdentificationNumber>
</TaxIdentification>
<Individual>
<Name>Cámara Demo</Name>
<AddressInSpain>
<Address>Calle Camara demo</Address>
<PostCode>1</PostCode>
<Town>MADRID</Town>
<Province>MADRID</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
<ContactDetails>
<Telephone>915383500</Telephone>
<TeleFax>910010200</TeleFax>
<WebAddress>www.camaraDemo.es</WebAddress>
<ContactPersons>Cámara Demo</ContactPersons>
</ContactDetails>
</Individual>
</SellerParty>
<BuyerParty>
<TaxIdentification>
<PersonTypeCode>J</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>ESA99999998</TaxIdentificationNumber>
</TaxIdentification>
<LegalEntity>
<CorporateName>Cliente 1</CorporateName>
<AddressInSpain>
<Address>Calle demo</Address>
<PostCode>8034</PostCode>
<Town>BARCELONA</Town>
<Province>BARCELONA</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
<ContactDetails>
<ElectronicMail> </ElectronicMail>
<ContactPersons>Cliente 1</ContactPersons>
</ContactDetails>
</LegalEntity>
</BuyerParty>
</Parties>
<Invoices>
<Invoice>
<InvoiceHeader>
<InvoiceNumber>121</InvoiceNumber>
<InvoiceDocumentType>FC</InvoiceDocumentType>
<InvoiceClass>OO</InvoiceClass>
</InvoiceHeader>
<InvoiceIssueData>
<IssueDate>2008-03-27+00:00</IssueDate>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
<TaxCurrencyCode>EUR</TaxCurrencyCode>
</InvoiceIssueData>
<TaxesOutputs>
<Tax>
<TaxTypeCode>1</TaxTypeCode>
<TaxRate>16</TaxRate>
<TaxableBase>
<TotalAmount>1</TotalAmount>
</TaxableBase>
<TaxAmount>
<TotalAmount>0.16</TotalAmount>
</TaxAmount>
</Tax>
</TaxesOutputs>
<InvoiceTotals>
<TotalGrossAmount>1</TotalGrossAmount>
<GeneralDiscounts>
<Discount>
<DiscountReason>16.00-1.00</DiscountReason>
<DiscountRate>0</DiscountRate>
<DiscountAmount>0</DiscountAmount>
</Discount>
</GeneralDiscounts>
<TotalGeneralDiscounts>0</TotalGeneralDiscounts>
<TotalGrossAmountBeforeTaxes>1</TotalGrossAmountBeforeTaxes>
<TotalTaxOutputs>0.16</TotalTaxOutputs>
<TotalTaxesWithheld>0</TotalTaxesWithheld>
<InvoiceTotal>1.16</InvoiceTotal>
<TotalOutstandingAmount>1.16</TotalOutstandingAmount>
<TotalExecutableAmount>1.16</TotalExecutableAmount>
</InvoiceTotals>
<Items>
<InvoiceLine>
<ItemDescription>PRUEBA</ItemDescription>
<Quantity>1</Quantity>
<UnitPriceWithoutTax>1</UnitPriceWithoutTax>
<TotalCost>1</TotalCost>
<GrossAmount>1</GrossAmount>
<TaxesOutputs>
<Tax>
<TaxTypeCode>1</TaxTypeCode>
<TaxRate>16</TaxRate>
<TaxableBase>
<TotalAmount>1</TotalAmount>
<EquivalentInEuros>1</EquivalentInEuros>
</TaxableBase>
</Tax>
</TaxesOutputs>
<TransactionDate>2008-03-03+00:00</TransactionDate>
</InvoiceLine>
</Items>
<PaymentDetails>
<Installment>
<InstallmentDueDate>2008-03-27+00:00</InstallmentDueDate>
<InstallmentAmount>1.16</InstallmentAmount>
<PaymentMeans>4</PaymentMeans>
<AccountToBeCredited>
<IBAN>ES00300000000000000000</IBAN>
<BankCode>30</BankCode>
<BranchCode>0</BranchCode>
<BranchInSpainAddress>
<Address>Calle Banco</Address>
<PostCode>0</PostCode>
<Town>Madrid</Town>
<Province>España</Province>
<CountryCode>ESP</CountryCode>
</BranchInSpainAddress>
</AccountToBeCredited>
</Installment>
</PaymentDetails>
</Invoice>
</Invoices>
</ns1:Facturae>';
1 Respuesta
Respuesta de Jorge Vila
1