XML to CSV, Microsoft Dynamics AIF file to CSV
HejJeg har lidt problemer med at få noget XML data transformeret til CSV.
Jeg har fosøgt at anvende den løsning som findes her http://scitsc.wlv.ac.uk/~jphb/xml/xmlcsv.html til at transformere
Data som skal transformeres, er lavet af AIF i microsoft Dynamics Ax 4.01 (tidl. Axapta), og er en kontoplan. Jeg har lavet en XSL fil som er implementeret i XML'en.
Problem:
1. Hvorfor får jeg kun en post ud ??
2. Hvordan kommer jeg af med det affald som er i starten af det transformerede dokument??
XSL start ->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:chart="http://schemas.microsoft.com/dynamics/2006/02/documents/ChartOfAccounts"
xmlns:env="http://schemas.microsoft.com/dynamics/2006/02/documents/Message">
<xsl:output method="text"/>
<xsl:template match="/env:Envelope/env:Body/chart:ChartOfAccounts">
<xsl:value-of select="normalize-space(chart:LedgerTable/chart:AccountNum)"/>,<xsl:value-of select="normalize-space(chart:LedgerTable/chart:AccountName)"/>
</xsl:template>
</xsl:stylesheet>
<- slut XSL
XML Start ->
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="GLcsv4.xsl"?>
<Envelope xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/Message">
<Header>
<MessageId>{0A554C21-CF74-45F4-B5B8-ACF769C6D000}</MessageId>
<SourceEndpointUser />
<SourceEndpoint>DMO</SourceEndpoint>
<DestinationEndpoint>GTM</DestinationEndpoint>
<Action>findListChartOfAccounts</Action>
<RequestMessageId />
</Header>
<Body>
<ChartOfAccounts xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/ChartOfAccounts">
<DocPurpose>Original</DocPurpose>
<SenderId>dmo</SenderId>
<LedgerTable class="entity">
<AccountName>BALANCE SHEET</AccountName>
<AccountNameAlias>BALANCE</AccountNameAlias>
<AccountNum>100000</AccountNum>
<AccountPlType>Heading</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>Yes</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>ASSETS</AccountName>
<AccountNameAlias>ASSETS</AccountNameAlias>
<AccountNum>100500</AccountNum>
<AccountPlType>Heading</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>Yes</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>CURRENT ASSETS</AccountName>
<AccountNameAlias>CUR ASSETS</AccountNameAlias>
<AccountNum>110000</AccountNum>
<AccountPlType>Heading</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>Yes</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>CASH & CASH EQUIVALENTS</AccountName>
<AccountNameAlias>CASH & CASH EQUIV</AccountNameAlias>
<AccountNum>110100</AccountNum>
<AccountPlType>Heading</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>Cash in bank - US</AccountName>
<AccountNameAlias>Cash - US</AccountNameAlias>
<AccountNum>110110</AccountNum>
<AccountPlType>AccountStatus</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>Yes</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<CurrencyCode>USD</CurrencyCode>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>BalanceSheet</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryDimension>
<element>Optional</element>
<element>Fixed</element>
<element>Fixed</element>
</MandatoryDimension>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>Cash in bank - CAN</AccountName>
<AccountNameAlias>Cash - CAN</AccountNameAlias>
<AccountNum>110120</AccountNum>
<AccountPlType>AccountStatus</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>Yes</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<CurrencyCode>CAD</CurrencyCode>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>BalanceSheet</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryDimension>
<element>Optional</element>
<element>Fixed</element>
<element>Fixed</element>
</MandatoryDimension>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>Cash in bank - EUR</AccountName>
<AccountNameAlias>Cash - EUR</AccountNameAlias>
<AccountNum>110130</AccountNum>
<AccountPlType>AccountStatus</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>Yes</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<CurrencyCode>EUR</CurrencyCode>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>Yes</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>BalanceSheet</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryDimension>
<element>Optional</element>
<element>Fixed</element>
<element>Fixed</element>
</MandatoryDimension>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>Yes</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>Cash in bank - DKK</AccountName>
<AccountNameAlias>Cash - DKK</AccountNameAlias>
<AccountNum>110140</AccountNum>
<AccountPlType>AccountStatus</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>Yes</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<CurrencyCode>DKK</CurrencyCode>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryDimension>
<element>Optional</element>
<element>Fixed</element>
<element>Fixed</element>
</MandatoryDimension>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>Cash in bank - GBP</AccountName>
<AccountNameAlias>Cash - GBP</AccountNameAlias>
<AccountNum>110150</AccountNum>
<AccountPlType>AccountStatus</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>Yes</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<CurrencyCode>GBP</CurrencyCode>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryDimension>
<element>Optional</element>
<element>Fixed</element>
<element>Fixed</element>
</MandatoryDimension>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>Cash in bank - US (Fixed Asset Purch)</AccountName>
<AccountNameAlias>Cash - US (FA)</AccountNameAlias>
<AccountNum>110160</AccountNum>
<AccountPlType>AccountStatus</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>Petty cash</AccountName>
<AccountNameAlias>Petty cash</AccountNameAlias>
<AccountNum>110180</AccountNum>
<AccountPlType>AccountStatus</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>No</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>BalanceSheet</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryDimension>
<element>Optional</element>
<element>Fixed</element>
<element>Fixed</element>
</MandatoryDimension>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>TOTAL CASH & CASH EQUIVALENTS</AccountName>
<AccountNameAlias>TOT CASH & CASH EQUIV</AccountNameAlias>
<AccountNum>119000</AccountNum>
<AccountPlType>sum</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>Yes</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>Yes</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>Yes</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
<LedgerTableInterval class="entity">
<AccountRecID>5637146961</AccountRecID>
<AccountTableId>221</AccountTableId>
<FromAccount>110100</FromAccount>
<ReverseSign>No</ReverseSign>
<ToAccount>119000</ToAccount>
</LedgerTableInterval>
</LedgerTable>
<LedgerTable class="entity">
<AccountName>SECURITIES</AccountName>
<AccountNameAlias>SECURITIES</AccountNameAlias>
<AccountNum>120000</AccountNum>
<AccountPlType>Heading</AccountPlType>
<AutoAllocate>No</AutoAllocate>
<BlockedInJournal>No</BlockedInJournal>
<BoldTypeface>Yes</BoldTypeface>
<Closed>No</Closed>
<ConversionPrinciple>Average</ConversionPrinciple>
<DebCredBalanceDemand>None</DebCredBalanceDemand>
<DebCredCheck>None</DebCredCheck>
<DebCredProposal>None</DebCredProposal>
<ExchAdjusted>No</ExchAdjusted>
<Italic>No</Italic>
<LedgerClosing>None</LedgerClosing>
<LineExceed>No</LineExceed>
<LineSub>No</LineSub>
<MandatoryCurrency>Optional</MandatoryCurrency>
<MandatoryPosting>Optional</MandatoryPosting>
<MandatoryUser>Optional</MandatoryUser>
<Monetary>No</Monetary>
<Posting>None</Posting>
<ReverseSign>No</ReverseSign>
<TaxDirection>None</TaxDirection>
<TaxFree>No</TaxFree>
<TotalByPeriod_FR>No</TotalByPeriod_FR>
<UnderlineNumerals>No</UnderlineNumerals>
<UnderLineTxt>No</UnderLineTxt>
</LedgerTable>
</ChartOfAccounts>
</Body>
</Envelope>
<-slut XML