首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

pb怎么将数据生成如上格式的xml文件?版主.

2013-03-20 
pb如何将数据生成如下格式的xml文件?求助版主...本帖最后由 a787822951 于 2013-03-13 11:39:01 编辑ns0:

pb如何将数据生成如下格式的xml文件?求助版主...
本帖最后由 a787822951 于 2013-03-13 11:39:01 编辑  <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> , 我只是取出了其中的一个....先谢过了...
[解决办法]
直接用文本读写方式就可以
[解决办法]
你到底是要dw生xml还是要解析XML得到数据啊?dw到xml,你把数据结构搞成和要求一样的,导出就行了。如果是解析xml,用pbdom
[解决办法]

引用:
你到底是要dw生xml还是要解析XML得到数据啊?dw到xml,你把数据结构搞成和要求一样的,导出就行了。如果是解析xml,用pbdom


这种结构太复杂...dw的XML模板好像不能实现吧

拼接字符串的话工作量好大...还容易出错...

PBDOM的话还要多加载一个PBD文件....

热点排行