Skip to content

XML to JSON conversion - convert attributes #240

@greenlaw110

Description

@greenlaw110

Given XML file as

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ehcache.xsd"
         updateCheck="true"
         monitoring="autodetect"
         dynamicConfig="true">

    <cache name="charityCache"
           maxEntriesLocalHeap="1000"
           eternal="false"
           timeToIdleSeconds="2" timeToLiveSeconds="20"
           memoryStoreEvictionPolicy="LFU"
           transactionalMode="off">
        <persistence strategy="none" />
    </cache>
    <cache name="charityTagsCache"
           maxEntriesLocalHeap="1000"
           eternal="false"
           timeToIdleSeconds="20" timeToLiveSeconds="60"
           memoryStoreEvictionPolicy="LFU"
           transactionalMode="off">
        <persistence strategy="none" />
    </cache>
</ehcache>

At the moment it misses attribute info when converted into JSON via:

$.convert(dom).to(JSONObject.class);

This CR is to add support to XML attributes into target JSON object

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions