Something similar is already possible using tags (see below). I was
however looking for input on naming etc. not further features as I
have limited time to work on ledger at the moment.

$ cat sample.dat
= .*
    ; profit:: account('Income').total

2004/05/01 * Checking balance
    Assets:Bank:Checking                           $1,000.00
    Equity:Opening Balances


$ ledger -f sample.dat xml
<transactions>
    <transaction state="cleared">
      ...
      <postings>
        <posting state="cleared">
          ...
          <metadata>
            <value key="profit">
              <amount>
                <commodity flags="PT">
                  <symbol>$</symbol>
                </commodity>
                <quantity>-1000</quantity>
              </amount>
            </value>
          </metadata>

Is this what you were looking for?

On Wed, Mar 13, 2013 at 6:11 AM, Harshad RJ <[email protected]> wrote:
> Johann & John,
>
> Thanks; was able to cook up a reporting script with the xml support.
>
> About xml structure, I would find the following very useful:
>
> It would be nice if we could emit some arbitrary values from ledger. For
> example:
>
> emit("profit", income - expenses - depreciation)
> emit("tax", profit * 0.3)
>
> This would emit in xml / json:
> <user-defined-values>
>   <value key="profit">10000</value>
>   <value key="tax">3333</value>
> </user-defined-values>
>
> thanks,
> --
> Harshad RJ
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to