pb如何将数据生成如下格式的xml文件?求助版主...

a787822951 2013-03-13 11:24:45
<ns0:EchProductLoadAction xmlns:ns0="http://ClientLegacy.Schemas.PR01_ProductsLoad_LegacyToAx">
<LegalEntity>ITST</LegalEntity>
<Action>ProductLoad</Action>
<SourceSystem>Pentland</SourceSystem>
<TargetSystem>OFMS</TargetSystem>
<EchProductLoad>
<InventTable class="entity">
<BOMUnitId>PCS</BOMUnitId> <!--1: PCS -->
<DimGroupId>SCSW</DimGroupId> <!--need update by scenarios, 0: (SW), 1: Size(SSW), 2: Color(CSW), 3: STyle(STSW), 4: Size+Color(SCSW), 5:Size+STyle(SSTSW), 6: Color+STyle(CSTSW), 7: Size + Color + STyle(SCSTSW) -->
<EchLegacySystemId>Pentland</EchLegacySystemId> <!--1: Pentland 2:Devanlay -->
<grossDepth>0</grossDepth>
<grossHeight>91</grossHeight>
<grossWidth>17</grossWidth>
<ItemGroupId>Main</ItemGroupId> <!--1: Main -->
<ItemId>P0011</ItemId> <!--1: P0001, P0002, P0003.... indentify -->
<ItemName>Test Product</ItemName>
<ItemType>Item</ItemType> <!--1: Item -->
<ModelGroupId>FIFO</ModelGroupId> <!--1: FIFO -->
<NameAlias>Test Product</NameAlias>
<NetWeight>92</NetWeight>
<PrimaryVendorId>000002</PrimaryVendorId> <!--1: 000001, 2:000002, ..... -->
<TaraWeight>61</TaraWeight>
<UnitVolume>42</UnitVolume>
<InventItemSalesSetup class="entity">
<HighestQty>64</HighestQty>
<LowestQty>52</LowestQty>
<MultipleQty>52</MultipleQty>
<Stopped>No</Stopped> <!--1: No, 2: Yes -->
</InventItemSalesSetup>
<RBOInventTable class="entity">
<FabricComposition>Lacoste</FabricComposition> <!--1: Lacoste 2:Lacoste!Live -->
<LifeFrom>2012-06-01</LifeFrom>
<LifeTo>2012-12-31</LifeTo>
<RetailGroup>ClasShoe</RetailGroup> <!--1: Shoes, 2: Clothes..... -->
<SeasonCode>01</SeasonCode> <!--1: 01, 2: 02, 3: 03, 4: 04 -->
</RBOInventTable>
<echItemAttributes class="entity">
<AttributeDesc>Gender</AttributeDesc>
<AttributeId>Gender</AttributeId>
<AttributeName>Gender</AttributeName>
<AttributeValue>Female</AttributeValue>
<Mandatory>No</Mandatory> <!-- 1: No, 2: Yes -->
<UnitID>PCS</UnitID> <!-- 1: Pcs -->
<Visible>No</Visible> <!-- 1: No, 2: Yes -->
</echItemAttributes>
<InventSize class="entity">
<Description>Large</Description> <!-- 1: L, 2: M, 3: S, 4: 32, 5: 42 ,..... -->
<InventSizeId>L</InventSizeId> <!-- 1: L, 2: M, 3: S, 4: 32, 5: 42 ,..... -->
<Name>Large Size</Name> <!-- 1: L, 2: M, 3: S, 4: 32, 5: 42 ,..... -->
</InventSize>
<InventColor class="entity">
<Description>Red</Description> <!-- 1: Red, 2: Yellow, 3: Green ,..... -->
<InventColorId>Red</InventColorId> <!-- 1: Red, 2: Yellow, 3: Green ,..... -->
<Name>Red Color</Name>
</InventColor>
<InventColor class="entity">
<Description>Green</Description> <!-- 1: Red, 2: Yellow, 3: Green ,..... -->
<InventColorId>Green</InventColorId> <!-- 1: Red, 2: Yellow, 3: Green ,..... -->
<Name>Green Color</Name>
</InventColor>
<InventItemBarcode class="entity">
<BarcodeSetupId>SKU</BarcodeSetupId> <!--1: SKU -->
<Description>Red</Description>
<ItemBarCode>P0011-1</ItemBarCode> <!--ItemId + _xxxx -->
<UnitID>PCS</UnitID> <!--1: Pcs -->
<echItemBarCode>P0011-101</echItemBarCode> <!--sku + 2 bit season -->
<InventDimBarcode class="entity">
<InventColorId>Red</InventColorId>
<InventSizeId>L</InventSizeId>
</InventDimBarcode>
</InventItemBarcode>
<InventItemBarcode class="entity">
<BarcodeSetupId>SKU</BarcodeSetupId> <!--1: BAR, 2: SKU -->
<Description>Green</Description>
<ItemBarCode>P0011-2</ItemBarCode> <!--ItemId + _xxxx -->
<UnitID>PCS</UnitID>
<echItemBarCode>P0011-201</echItemBarCode> <!--sku + 2 bit season -->
<InventDimBarcode class="entity">
<InventColorId>Green</InventColorId>
<InventSizeId>L</InventSizeId>
</InventDimBarcode>
</InventItemBarcode>
<PriceDiscTable class="entity">
<Amount>159.00</Amount>
<Currency>CNY</Currency> <!--1: CNY, 2:EUR, 3: USD,.... -->
<FromDate>2012-06-01</FromDate>
<ItemCode>Table</ItemCode> <!--1: Table -->
<PriceInclVAT>Yes</PriceInclVAT> <!-- 1: No, 2: Yes -->
<QuantityAmount>0</QuantityAmount>
<ToDate>2012-12-31</ToDate>
<UnitId>PCS</UnitId>
<InventDimPrice class="entity">
<InventColorId>Red</InventColorId>
<InventLocationId>DMW</InventLocationId> <!-- 1: 360POP, 2: TMALL, 3: DMW -->
<InventSiteId>ECOM</InventSiteId> <!-- 1: ECOM -->
<InventSizeId>L</InventSizeId>
</InventDimPrice>
</PriceDiscTable>
<PriceDiscTable class="entity">
<Amount>169.00</Amount>
<Currency>CNY</Currency> <!--1: CNY, 2:EUR, 3: USD,.... -->
<FromDate>2012-06-01</FromDate>
<ItemCode>Table</ItemCode> <!--1: Table -->
<PriceInclVAT>Yes</PriceInclVAT> <!-- 1: No, 2: Yes -->
<QuantityAmount>0</QuantityAmount>
<ToDate>2012-12-31</ToDate>
<UnitId>PCS</UnitId>
<InventDimPrice class="entity">
<InventColorId>Green</InventColorId>
<InventLocationId>DMW</InventLocationId> <!-- 1: 360POP, 2: TMALL, 3: DMW -->
<InventSiteId>ECOM</InventSiteId> <!-- 1: ECOM -->
<InventSizeId>L</InventSizeId>
</InventDimPrice>
</PriceDiscTable>
</InventTable>
</EchProductLoad>
</ns0:EchProductLoadAction>


其中有多个 <InventTable class="entity"> </InventTable> , 我只是取出了其中的一个....先谢过了...
...全文
1847 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
sbks 2013-03-18
  • 打赏
  • 举报
回复
两种方法:1.自己慢慢拼写xml;2.处用datawondow 的xml导出功能,在datawindow里定义好xml模板,将dw别存为xml就可以了
a787822951 2013-03-14
  • 打赏
  • 举报
回复
引用 4 楼 sjlion 的回复:
你到底是要dw生xml还是要解析XML得到数据啊?dw到xml,你把数据结构搞成和要求一样的,导出就行了。如果是解析xml,用pbdom
我是要生成这样的xml文件.........
a787822951 2013-03-13
  • 打赏
  • 举报
回复
这个真没人吗?
A啦Dbit 2013-03-13
  • 打赏
  • 举报
回复
引用 4 楼 sjlion 的回复:
你到底是要dw生xml还是要解析XML得到数据啊?dw到xml,你把数据结构搞成和要求一样的,导出就行了。如果是解析xml,用pbdom
这种结构太复杂...dw的XML模板好像不能实现吧 拼接字符串的话工作量好大...还容易出错... PBDOM的话还要多加载一个PBD文件....
sjlion 2013-03-13
  • 打赏
  • 举报
回复
你到底是要dw生xml还是要解析XML得到数据啊?dw到xml,你把数据结构搞成和要求一样的,导出就行了。如果是解析xml,用pbdom
粉条雨 2013-03-13
  • 打赏
  • 举报
回复
直接用文本读写方式就可以
a787822951 2013-03-13
  • 打赏
  • 举报
回复
芝麻来人....

752

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧