در مسیر ساخت SCORM Manifest Editor نیاز به تبدیل xml به object و برعکس بود که با استفاده از xmlConverter این مسئله در پروژه حل شد. xmlConverter برای تبدیل یک object به xml و برعکس استفاده میشود، تنها مشکلی که به نظر من رسید این بود:
خروجی که از کد اصلی بهدست میآید اینگونه است:
<order id="1234"> <orderDate>2008-01-11</orderDate> <subTotal>9.95</subTotal> <tax>0.99</tax> <total>10.94</total> <orderLines> <orderLine orderLine="1"> <productId>ABC</productId> <quantity>1</quantity> <unitPrice>5</unitPrice> </orderLine> <orderLine orderLine="2"> <productId>DEF</productId> <quantity>1</quantity> <unitPrice>4.95</unitPrice> </orderLine> </orderLines> </order>
اما چیزی که من لازم داشتم، اینگونه بود:
<order id="1234"> <orderDate>2008-01-11</orderDate> <subTotal>9.95</subTotal> <tax>0.99</tax> <total>10.94</total> <orderLines> <orderLine orderLine="1"> <productId>ABC</productId> <quantity>1</quantity> <unitPrice>5</unitPrice> </orderLine> <orderLine orderLine="2"> <productId>DEF</productId> <quantity>1</quantity> <unitPrice>4.95</unitPrice> </orderLine> </orderLines> </order>
با تغییراتی که روی کد دادم، قابل استفاده شد
این هم کد تغییر کرده.
پاسخ خود را بنویسید