in reply to XML-Twig - AS5.6.1 vs AS 5.8.8

There are a few problems with your code:

Does it make sense?

Replies are listed 'Best First'.
Re^2: XML-Twig - AS5.6.1 vs AS 5.8.8
by drmikec (Initiate) on Mar 29, 2006 at 21:00 UTC
    Yes, it does. Thanks, Michael. I implemented the method calls as you suggested, and it works, except for one small thing - the first time $balance->flush; is called, it writes a <Root> tag immediately preceding the <Aging> tag. As you can surmise, I'm processing a member billing file, and it doesn't write the <Root> tag on subsequent members, just the first one. I can hack my way around it, but I don't understand why it is happening. Thanks. -Mike
      A minimal test case with data would be helpful. Do you mean that each Aging element is a child of a different Root element? And that the parent element of your entire document is some other-named sort of "root" element? Or that all of your Aging elements are children of one Root element (in which case it sounds like it's behaving correctly)?
        Thanks for your previous response and this one, runrig. Here is the head of the original file. All of the tags that are opened above the <Aging> tag are subsequently closed properly. Names have been changed to protect the innocent:
        <?xml version="1.0" encoding="ISO-8859-1"?> <Root> <Billing> <STMT_HDR.AR> <StatementDate>20060228</StatementDate> <PreviousDate>20060131</PreviousDate> <DueDate>20060331</DueDate> <TransactionThruDate>20060228</TransactionThruDate> <MemberId> <MemberNumber>1000</MemberNumber> <MemberInfo> <MemberName>Mickey Mouse</MemberName> <Address> <Address1>6340 Disney Lane</Address1> <Address2>P.O. Box 730</Address2> <Address3></Address3> <City>Orlando</City> <State>FL</State> <ZipCode>33333</ZipCode> </Address> </MemberInfo> <BillingInfo> <PreviousBalance>2371.28</PreviousBalance> <ChargeTotal>567.78</ChargeTotal> <PymtAdjustTotal>2371.28</PymtAdjustTotal> <EndingBalance>567.78</EndingBalance> <AutomaticBilling> <Minimum>False</Minimum> <BillingCode></BillingCode> <BillingBalance></BillingBalance> </AutomaticBilling> <Aging> <BAL_30 Period="1">0.00</BAL_30> <BAL_60 Period="2">0.00</BAL_60> <BAL_90 Period="3">0.00</BAL_90> <BAL_120 Period="4">0.00</BAL_120> <BAL_150 Period="5">0.00</BAL_150> <BAL_180 Period="6">0.00</BAL_180> </Aging>

        Here is the result of the modifications:
        All is the same prior to this point -
        <BillingInfo> <PreviousBalance>2371.28</PreviousBalance> <ChargeTotal>567.78</ChargeTotal> <PymtAdjustTotal>2371.28</PymtAdjustTotal> <EndingBalance>567.78</EndingBalance> <AutomaticBilling> <Minimum>False</Minimum> <BillingCode></BillingCode> <BillingBalance></BillingBalance> </AutomaticBilling> <Root> <--This is the question <Aging> <BAL_30 Period="1">0.00</BAL_30> <BAL_60 Period="2">0.00</BAL_60> <BAL_90 Period="3">0.00</BAL_90> </Aging>

        Your help is greatly appreciated.
        -Mike