Hi Gene,
thanks for posting your hints also, but Dave's tip is fine for XOG read Cost and Budget plans.
Unfortunately that I cannot say about XOG write
I have the same logic steps for XOG write (1. parse var ($xogWriteFinPlan_Details) for Fin plan details, 2. parse var ($xogWriteFinPlan) for
the whole XOG write XML file), but it throws me above error:
(ERROR: <gel:parse> The markup in the document following the root element must be well-formed.)
It has to be said, when it's just in one parse var - like before (just w.g. for Cost plan), it works fine....
So now it's very strange for me where this error comes from...
1. Parse var for Fin plan details - Here is the simplified code, because it's too long, but for understanding this should be enough....
<!-- We set Details for Fin plans into parse variable first to be able to put it into the whole XML file -->
<gel:parse var="xogWriteFinPlan_Details">
<GroupingAttributes>
<GroupingAttribute>cost_type_id</GroupingAttribute>
<GroupingAttribute>transaction_class_id</GroupingAttribute>
</GroupingAttributes>
<Details>
<!-- Fill in variables for Fin plan from SQL query above -->
<core:forEach items="${Fin_plan_rows.rows}" trim="false" var="row_type">
<!-- Fill in detail of one row (Revenue and Actuals) into Fin plan -->
<Detail>
<Cost>
<core:forEach items="${Fin_plan_values.rows}" trim="false" var="row_value">
<!-- some values there.... -->
</core:forEach>
</Cost>
<Units>
<core:forEach items="${Fin_plan_values.rows}" trim="false" var="row_value">
<!-- some values there.... -->
</core:forEach>
</Units>
<Revenue>
<core:forEach items="${Fin_plan_values.rows}" trim="false" var="row_value">
<!-- some values there.... -->
</core:forEach>
</Revenue>
<GroupingAttributes>
<GroupingAttribute code="cost_type_id" value="${Cost_type}"/>
<GroupingAttribute code="transaction_class_id" value="${Transaction_class}"/>
</GroupingAttributes>
<CustomInformation>
<ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
</CustomInformation>
</Detail>
</core:forEach>
</Details>
<CustomInformation>
<ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
<ColumnValue name="z_checkbox_approved">true</ColumnValue>
<ColumnValue name="z_checkbox_rejected">false</ColumnValue>
<ColumnValue name="z_checkbox_submitted">true</ColumnValue>
</CustomInformation>
</gel:parse>
2. Parse var - The whole XOG write XML doc for Budget plan:
<!-- Whole XML: XOG write for Budget plan -->
<core:if test="${Plan_type eq 'BUDGET'}">
<gel:parse var="xogWriteFinPlan">
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_budgetPlan.xsd">
<Header action="write" externalSource="NIKU" objectType="budgetPlan" version="13.3.0.286"/>
<BudgetPlans>
<BudgetPlan benefitPlanCode="" code="Kill/Close_${Plan_code}" finishPeriod="${End_period}"
forceReplace="true" investmentCode="${Project_code}"
investmentType="project" name="Kill/Close" periodType="ANNUALLY" revision="1"
startPeriod="${Start_period}" sourceCostPlanCode="${Plan_code}" status="APPROVED">
<Description/>
<!-- Fin plan details included there !!! -->
<gel:include select="$xogWriteFinPlan_Details"/>
</BudgetPlan>
</BudgetPlans>
</NikuDataBus>
</gel:parse>
</core:if>
Matej