Kopiering af noder fra eksisterende xml dokument til nyt dokument
HejJeg har fået lavet mig en "generel" xml dokument som jeg gerne vil tage informationer ud fra til en kopi, men kopien skal ikke indeholde det hele.....
hvordan gør jeg det smartest ?
Udgangspunkt:
<?xml version="1.0" encoding="utf-8"?>
<Invoice xmlns="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/" xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/ http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pielax.xsd">
<com:ID>2442012</com:ID>
<com:IssueDate>2005-03-29</com:IssueDate>
<com:TypeCode>PIE</com:TypeCode>
<main:InvoiceCurrencyCode>DKK</main:InvoiceCurrencyCode>
<com:Note>HDR</com:Note>
<com:BuyersReferenceID schemeID="EAN">5798002230314</com:BuyersReferenceID>
<com:ReferencedOrder>
<com:BuyersOrderID>Linjespecificeret</com:BuyersOrderID>
<com:SellersOrderID>null</com:SellersOrderID>
<com:IssueDate>2005-03-15</com:IssueDate>
</com:ReferencedOrder>
.
.
.
.
.
.
.
</Invoice>
Resultat:
<?xml version="1.0" encoding="utf-8"?>
<Invoice xmlns="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/" xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/ http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pielax.xsd">
<com:ID>2442012</com:ID>
<com:IssueDate>2005-03-29</com:IssueDate>
<com:TypeCode>PIE</com:TypeCode>
<main:InvoiceCurrencyCode>DKK</main:InvoiceCurrencyCode>
<com:BuyersReferenceID schemeID="EAN">5798002230314</com:BuyersReferenceID>
<com:ReferencedOrder>
<com:BuyersOrderID>Linjespecificeret</com:BuyersOrderID>
<com:SellersOrderID>null</com:SellersOrderID>
<com:IssueDate>2005-03-15</com:IssueDate>
</com:ReferencedOrder>
</Invoice>