atteo / xml-combiner Goto Github PK
View Code? Open in Web Editor NEWCombines several XML documents into one
License: Apache License 2.0
Combines several XML documents into one
License: Apache License 2.0
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.
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.
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.
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?
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. ๐
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.