我想将包含注释的Xml转换为Json,并希望这些注释也可以使用Java在Json中出现

时间:2019-05-29 12:46:52

标签: java json xml xml-parsing jaxb

我下面有xml数据,并且该数据包含<!--Optional:--><!--Zero or more repetitions:-->等注释。我想使用Java将此xml转换为json,我希望xml中的注释也应出现在json。谁能帮助我提供任何库或某些代码段。

    <bsvc:Put_Supplier_Category_Request bsvc:Add_Only="false" bsvc:version="string"
    xmlns:bsvc="urn:com.workday/bsvc">
    <!--Optional:-->
    <bsvc:Supplier_Category_Reference bsvc:Descriptor="string">
        <!--Zero or more repetitions:-->
        <bsvc:ID bsvc:type="string">string</bsvc:ID>
    </bsvc:Supplier_Category_Reference>
    <bsvc:Supplier_Category_Data>
        <!--Optional:-->
        <bsvc:Supplier_Category_ID>string</bsvc:Supplier_Category_ID>
        <bsvc:Supplier_Category_Name>string</bsvc:Supplier_Category_Name>
    </bsvc:Supplier_Category_Data>
</bsvc:Put_Supplier_Category_Request>

0 个答案:

没有答案