JAXB使用自定义元素将Java对象编组为XML

时间:2014-04-11 21:25:41

标签: xml xslt jaxb marshalling

您好我正在使用JAXB编组,我正在关注我的xml输出

<catalogentries>
<catalogentry>
    <type>Product</type>
    <sequence>1.0</sequence>
    <partnumber>Product_H|||DAL|||CPCC05R2400JB32</partnumber>
    <parentgroupidentifier>Combo Memory</parentgroupidentifier>
    <manufacturerpartnumber>CPCC05R2400JB32</manufacturerpartnumber>
    <manufacturer>Spansion</manufacturer>
</catalogentry>
</catalogentries>

但我希望我的输出像

<CatalogEntries>
<CatalogEentry>
    <Type>Product</Type>
    <Sequence>1.0</Sequence>
    <PartNumber>Product_H|||DAL|||CPCC05R2400JB32</PartNumber>
    <ParentGroupIdentifier>Combo Memory</ParentGroupIdentifier>
    <ManufacturerPartNumber>CPCC05R2400JB32</ManufacturerPartNumber>
    <Manufacturer>Spansion</Manufacturer>
</CatalogEntry>
</CatalogEntries>

无论如何我可以自定义输出xml的元素吗?

谢谢, 哈里什M

0 个答案:

没有答案