Giter VIP home page Giter VIP logo

xml-combiner's People

Contributors

pimlottc avatar sentinelt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xml-combiner's Issues

When combining documents, order of attributes is changed

It looks like they might be getting alphabetically sorted. I was wondering if you could point me to where in the source code that might be happening. While I understand this does not impact the semantics of the resultant XML file, I would still prefer to keep the order of attributes for better human readability. Thanks.

Remove dependency on Guava

Although it facilitates the implementation, it would be nice if xml-combiner had no dependency on Guava, since it may conflict with other libraries that require Guava too.

Pluggable element matching strategies

Nice little well-focused library! I'm looking at this for a XML split/merge use case in a project. I wonder what you'd think of the idea of extracting the current code for matching elements into a strategy object which could then be swapped out to allow other matching algorithms. For example, in my project I want to match elements only if all attributes and their values match, which I can't do in the current code unless I exhaustively list every single possible attribute name as a key.

?how to remove a element while merging?

I'm trying to combine various xmls into single xml piece , while doing so I want to exclude certain elements
ex:

<root>
<mono>
......
...
</mono>
<view>
</view>
<mono>
</mono>
</root>

I just want the monos
result:

<mono>
</mono>
<mono>
</mono>

I cannot go in each xml and set combine.self= remove for the element view. how to achieve this?

Enable configuration of verification behavior

If the XMLs define a schema, the default behavior of JAXP is to download it, use it to verify the XML and explicitly specify default values for all unspecified attributes in the generated output.

Under the assumption that this behavior can be configured for the employed JAXP-classes (e.g. to forego schema verification or explicating default values), it would be nice to allow to pass the rtelevant parameters to XmlCombiner.

PS: Nice lib! Small and just works. ๐Ÿ˜„

Deactivate adding empty namespace in merged tags

There should be an option to be setable to not create the empty namespace on merged nodes when using a global xml namespace in the root node. I am not sure if that's actually a bug but it is annoying as a I need to remove the empty xmlns in the end of the merging again.

Problem:
Merging following xmls:

<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.opengroup.org/xsd/archimate/3.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="model" version="1"
       xsi:schemaLocation="http://www.opengroup.org/xsd/archimate/3.0/">
    <name xml:lang="en-us">Test</name>
</model>
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.opengroup.org/xsd/archimate/3.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="model" version="1"
       xsi:schemaLocation="http://www.opengroup.org/xsd/archimate/3.0/">
    <elements>
        <element xsi:type="Device" identifier="ID2">
            <name xml:lang="en-us">Name</name>
            <documentation xml:lang="en-us">Test</documentation>
        </element>
    </elements>
</model>

Expected result:

<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.opengroup.org/xsd/archimate/3.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="model" version="1"
       xsi:schemaLocation="http://www.opengroup.org/xsd/archimate/3.0/">
    <name xmlns="" xml:lang="en-us">String</name>
    <elements>
        ...
    </elements>
</model>

Actual:

<model ...>
    <elements xmlns="">
    ...
    </elements>
</model>

It need the elements tag to be without any namespace as it uses the globale namespace defined in the model.

Can you give any reason or updates on this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.