i want to know if it is possible to make xmlunit compare only nodes that have the same value of a specific attribute.. for example in make case i want xmlunit to compare nodes which have the same value of MOID ( attribute )
here is two xml files :
controle.xml:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<HWData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" version="1.0"/>
<NE MOID="WBTS-4073" NEType="WBTS">
<EQHO MOID="EQHO-1-0" serialNumber="V7124400225">
<UNIT MOID="UNIT-FAN-1" State="enabled" serialNumber="V735"></UNIT>
<UNIT MOID="UNIT-FAN-3" State="enabled" serialNumber="V745"></UNIT>
<UNIT MOID="UNIT-FAN-2" State="enabled" serialNumber="V734"></UNIT>
</EQHO>
</NE>
</HWData>
test.xml :
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<HWData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" version="1.0"/>
<NE MOID="WBTS-4073" NEType="WBTS">
<EQHO MOID="EQHO-1-0" serialNumber="V7124400225">
<UNIT MOID="UNIT-FAN-2" State="enabled" serialNumber="V734"></UNIT>
<UNIT MOID="UNIT-FAN-1" State="disabled" serialNumber="V735"></UNIT>
<UNIT MOID="UNIT-FAN-3" State="enabled" serialNumber="V745"></UNIT>
</EQHO>
</NE>
</HWData>
Is there a way to achieve that with xmlunit !!
any other suggestions are welcomed..
thanks in advance
Related
I have the maven build that generated by xtext platform. My application uses the org.eclipse.core.resource bundle. The build by eclipse IDE is completed with success. The build by maven failed because of org.eclipse.core.resources is not found by maven build. I understand that this bundle shall be added to target platform definition, there a several to do it. I can add reference to current eclipse installation, but this is not good way. I cannot find location of p2 repository where org.eclipse.core.resources is located.
Could you please c clarify the way that should be used for searching unresolved bundle in tycho build?
<target name="com.psl.atom.target" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.core.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.xpand" version="0.0.0"/>
<unit id="org.eclipse.xtend" version="0.0.0"/>
<unit id="org.eclipse.xtend.typesystem.emf" version="0.0.0"/>
<repository location="http://download.eclipse.org/releases/neon/201606221000/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/modeling/emft/mwe/updates/releases/2.9.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.12.0/"/>
</location>
</locations>
</target>
I am unable to properly read a XML file with XMLBeam:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ns1:storeTokenResponse xmlns:ns1="http://recurring.services.adyen.com">
<ns1:result>
<additionalData xmlns="http://recurring.services.adyen.com" xsi:nil="true" />
<alias xmlns="http://recurring.services.adyen.com">ALIAS</alias>
<aliasType xmlns="http://recurring.services.adyen.com">Default</aliasType>
<params xmlns="http://recurring.services.adyen.com" xsi:nil="true" />
<pspEchoData xmlns="http://recurring.services.adyen.com" xsi:nil="true" />
<pspReference xmlns="http://recurring.services.adyen.com">PSPREFERENCE</pspReference>
<recurringDetailReference xmlns="http://recurring.services.adyen.com">RECURRINGDETAILREFERENCE</recurringDetailReference>
<redirectType xmlns="http://recurring.services.adyen.com" xsi:nil="true" />
<redirectUrl xmlns="http://recurring.services.adyen.com" xsi:nil="true" />
<result xmlns="http://recurring.services.adyen.com">RESULT</result>
</ns1:result>
</ns1:storeTokenResponse>
</soap:Body>
with given Java class:
public interface PaymentResponse {
#XBRead("/soap:Envelope/soap:Body/ns1:storeTokenResponse/ns1:result/ns1:alias")
String getAlias();
#XBRead("/soap:Envelope/soap:Body/ns1:storeTokenResponse/ns1:result/ns1:recurringDetailReference")
String getRecurringDetailReference();
#XBRead("/soap:Envelope/soap:Body/ns1:storeTokenResponse/ns1:result/ns1:pspReference")
String getPspReference();
#XBRead("/soap:Envelope/soap:Body/ns1:storeTokenResponse/ns1:result/ns1:result")
String getResult();
}
I was doing it like this :
final PaymentResponse paymentResponse = new XBProjector.onXMLString(xml).read(PaymentResponse.class);
Assert.assertTrue("ALIAS",paymentResponse.getAlias());
And yes, proper XPath is ns1:alias, as I've tested.
But looks like XMLBeam is not properly recognizing the values.
Can anyone help, please ?
Migrating from Kepler.2 IDE to Mar.2 IDE I needed to build a target file so I could still use the older plugins we depend on.
I managed to build a target file manually that satisfies all dependencies in the 30+ plugins in my project, just 10 unrelated errors. But I switched to the target definition dialog and it has done something that is not visible to me and instead of the 10 errors I had with 1 plugin suddenly I had over 54000 errors across my 30+ plugins. The classes not being resolved in the imports are all satisfied by the plugins in the targetplatform. I have tried restarting Eclipse, clean builds, reloading the target file, nothing now changes the high number of errors.
Any ideas on what could cause this. The target file lods and looks fine in the targetplatform dialog. locations and content tabs are displaying fine.
Here are the contents
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="kepler" sequenceNumber="135">
<locations>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.hsqldb.feature.group" version="2.2.8.201310261216"/>
<unit id="org.apache.commons.logging.feature.group" version="1.1.1.201310261216"/>
<unit id="org.apache.log4j.feature.group" version="1.2.16.201310261216"/>
<unit id="com.mysql.jdbc.feature.group" version="5.1.11.201310261216"/>
<unit id="com.microsoft.sqlserver.jdbc.feature.group" version="3.0.1301.201310261216"/>
<unit id="javax.persistence.feature.group" version="2.0.1.201310261216"/>
<unit id="com.db4o.feature.group" version="7.4.155.v20120928-1733"/>
<unit id="org.dom4j.feature.group" version="1.6.1.201310261216"/>
<unit id="org.postgresql.feature.group" version="9.0.0.201310261216"/>
<unit id="org.hibernate.feature.group" version="4.1.1.201310261216"/>
<repository location="http://www.elver.org/eclipse/2.0.0/update"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.contribution.xref.feature.group" version="2.2.3.e43x-RELEASE-20130627-0800"/>
<unit id="org.aspectj.feature.group" version="1.7.3.20130613144500-a"/>
<unit id="org.eclipse.contribution.weaving.feature.group" version="2.2.3.e43x-RELEASE-20130627-0800"/>
<unit id="org.eclipse.ajdt.feature.group" version="2.2.3.e43x-RELEASE-20130627-0800"/>
<repository location="http://download.eclipse.org/tools/ajdt/43/update"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.slf4j.log4j" version="1.7.2.v20130115-1340"/>
<unit id="org.w3c.dom.events" version="3.0.0.draft20060413_v201105210656"/>
<unit id="org.apache.commons.io" version="2.0.1.v201105210651"/>
<unit id="org.apache.commons.lang" version="2.6.0.v201205030909"/>
<unit id="org.junit" version="4.11.0.v201303080030"/>
<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20140114142710/repository/"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.teneo.hibernate.sdk.feature.group" version="2.0.1.v201508111358"/>
<unit id="org.eclipse.emf.teneo.hibernate.feature.group" version="2.0.1.v201508111358"/>
<unit id="org.eclipse.emf.teneo.cdo.sdk.feature.group" version="2.0.1.v201508111358"/>
<unit id="org.eclipse.emf.teneo.cdo.feature.group" version="2.0.1.v201508111358"/>
<repository location="http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.codehaus.groovy.m2eclipse.feature.feature.group" version="2.9.1.xx-201411061336-e43-RELEASE"/>
<unit id="org.codehaus.groovy20.feature.feature.group" version="2.9.1.xx-201411061336-e43-RELEASE"/>
<unit id="org.codehaus.groovy23.feature.feature.group" version="2.9.1.xx-201411061336-e43-RELEASE"/>
<unit id="org.codehaus.groovy.jdt.patch.feature.group" version="2.9.1.xx-201411061336-e43-RELEASE"/>
<unit id="org.codehaus.groovy22.feature.feature.group" version="2.9.1.xx-201411061336-e43-RELEASE"/>
<unit id="org.codehaus.groovy21.feature.feature.group" version="2.9.1.xx-201411061336-e43-RELEASE"/>
<unit id="org.codehaus.groovy.eclipse.feature.feature.group" version="2.9.1.xx-201411061336-e43-RELEASE"/>
<repository location="http://dist.springsource.org/release/GRECLIPSE/e4.3"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jdt.debug" version="3.8.0.v20130514-0841"/>
<unit id="org.eclipse.jdt.debug.ui" version="3.6.200.v20130514-0841"/>
<unit id="org.eclipse.jdt.ui" version="3.9.2.v20131106-1600"/>
<unit id="org.eclipse.jdt.junit" version="3.7.200.v20130514-0733"/>
<unit id="org.eclipse.jdt.junit.core" version="3.7.200.v20130514-1154"/>
<unit id="org.eclipse.pde.source.feature.group" version="3.9.1.v20140221-1700"/>
<unit id="org.eclipse.rcp.feature.group" version="4.3.2.v20140221-1700"/>
<unit id="org.eclipse.emf.ecoretools.sdk.feature.group" version="1.2.0.201306071421"/>
<unit id="org.eclipse.emf.compare.source.feature.group" version="2.1.3.201402040808"/>
<unit id="org.eclipse.platform.sdk" version="4.3.2.M20140221-1700"/>
<unit id="org.eclipse.emf.eef.codegen.ecore-feature.feature.group" version="1.2.0.201301111054"/>
<unit id="org.eclipse.pde.feature.group" version="3.9.1.v20140221-1700"/>
<unit id="org.eclipse.emf.validation.sdk.feature.group" version="1.7.0.201306111341"/>
<unit id="org.eclipse.emf.compare.ide.ui.source.feature.group" version="2.1.3.201402040808"/>
<unit id="org.eclipse.graphiti.sdk.plus.feature.feature.group" version="0.10.2.v20140217-1225"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="2.9.2.v20140203-1126"/>
<unit id="org.eclipse.e4.rcp.feature.group" version="1.2.2.v20140206-1358"/>
<unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="4.3.2.v20140211-1400-795388UF5G6LKl-4mBu2LJ7GXD29"/>
<unit id="org.eclipse.graphiti.feature.feature.group" version="0.10.2.v20140217-1225"/>
<unit id="org.eclipse.gef.sdk.feature.group" version="3.9.1.201308190730"/>
<unit id="org.eclipse.rcp.source.feature.group" version="4.3.2.v20140221-1700"/>
<unit id="org.eclipse.platform.feature.group" version="4.3.2.v20140221-1852"/>
<unit id="org.eclipse.birt.chart.cshelp.feature.group" version="4.3.2.v20140211-1400-5217w3125132202511"/>
<unit id="org.eclipse.graphiti.export.feature.feature.group" version="0.10.2.v20140217-1225"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.9.0.v20140221-1852"/>
<unit id="org.eclipse.amalgam.discovery.feature.group" version="1.4.0.201308130745"/>
<unit id="org.eclipse.xsd.sdk.feature.group" version="2.9.1.v20140203-1126"/>
<unit id="org.eclipse.birt.feature.group" version="4.3.2.v20140211-1400-DPDKA5GixAoaudOsMil4K3C7KNz0"/>
<unit id="org.eclipse.datatools.sdk.feature.feature.group" version="1.11.2.v201309171554-7PAi7gFEpPZGKz-8iIz--X8NuUhz"/>
<unit id="org.eclipse.net4j.sdk.feature.group" version="4.2.1.v20140218-1830"/>
<unit id="org.eclipse.emf.diffmerge.sdk.feature.feature.group" version="0.2.0.v20130523-0727"/>
<unit id="org.eclipse.datatools.enablement.sdk.feature.feature.group" version="1.11.2.v201309171554-7I9v7XFE9JgQP0oJDSE2RI-mNjpc"/>
<unit id="org.eclipse.emf.eef.sdk-feature.feature.group" version="1.2.0.201301111054"/>
<unit id="org.eclipse.platform.source.feature.group" version="4.3.2.v20140221-1852"/>
<unit id="org.eclipse.graphiti.feature.tools.feature.group" version="0.10.2.v20140217-1225"/>
<unit id="org.eclipse.emf.oda.sdk.feature.group" version="1.2.0.v20140203-1126"/>
<unit id="org.eclipse.birt.cshelp.feature.group" version="4.3.2.v20140211-1400-5217w3125132202511"/>
<unit id="org.eclipse.emf.transaction.sdk.feature.group" version="1.7.0.201306111400"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20140117-1004"/>
<unit id="org.eclipse.rcp.sdk.id" version="4.3.2.M20140221-1700"/>
<unit id="org.eclipse.emf.compare.ide.ui.feature.group" version="2.1.3.201402040808"/>
<unit id="org.eclipse.wst.xml_ui.feature.feature.group" version="3.5.2.v201401062113-7H7IFizDxumVu0K6bjdPjXRkoz0FiUYMnSyT9PL"/>
<unit id="org.eclipse.emf.compare.feature.group" version="2.1.3.201402040808"/>
<unit id="org.eclipse.graphiti.sdk.feature.feature.group" version="0.10.2.v20140217-1225"/>
<unit id="org.eclipse.emf.compare.diagram.gmf.feature.group" version="2.1.3.201402040808"/>
<unit id="org.eclipse.ant.launching" version="1.0.300.v20140203-1328"/>
<unit id="org.eclipse.jdt.core.manipulation" version="1.5.0.v20130605-1748"/>
<unit id="org.eclipse.jdt.launching" version="3.7.1.v20131218-1102"/>
<unit id="org.eclipse.gef" version="3.9.0.201308190730"/>
<unit id="org.eclipse.jface" version="3.9.1.v20130725-1141"/>
<unit id="org.eclipse.swt" version="3.102.1.v20130827-2021"/>
<unit id="org.eclipse.ui" version="3.105.0.v20130522-1122"/>
<unit id="org.eclipse.draw2d" version="3.9.0.201308190730"/>
<repository location="http://download.eclipse.org/releases/kepler"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.cdo.feature.group" version="4.5.0.v20160320-0839"/>
<unit id="org.eclipse.net4j.feature.group" version="4.5.0.v20160607-1254"/>
<unit id="org.eclipse.net4j.db.feature.group" version="4.5.0.v20160607-1254"/>
<unit id="org.eclipse.net4j.db.h2.feature.group" version="4.2.300.v20160301-1326"/>
<unit id="org.eclipse.emf.cdo.server.db.feature.group" version="4.4.0.v20160607-1254"/>
<unit id="org.eclipse.emf.cdo.server.feature.group" version="4.5.0.v20160607-1254"/>
<repository location="http://download.eclipse.org/modeling/emf/cdo/updates/integration/"/>
</location>
</locations>
</target>
After years of using Eclipse I have never found the cause of these p2 related issues, this is not the only one I encounter. If you have a look at the PDE forum on the Eclipse forums you will see a very large number of questions unanswered, some of them mine. The problem above is intermittent, I have no idea what causes it. Currently it has 'gone away'.
One thing I noticed is how slow the resolution of the plugins is from the update site, literally walk away from the machine slow. The sites themselves respond in the browser quickly, I have a fast internet connection.
My advice to anyone is not to use the Target Editor, but use a text editor and carefully craft your target file. The Target Editor often ended up from one restart to the next going from all plugins resolved to none.
I am trying to split following XML with Camel's XMLTokenizer language:
<units>
<unit type="menu">
<id>1</id>
<unit type="submenu">
<id>1</id>
</unit>
</unit>
<unit type="menu">
<id>2</id>
<unit type="submenu">
<id>1</id>
</unit>
</unit>
</units>
My splitter looks like this:
.split().tokenizeXML("unit").streaming()
and my problem is that it is producing splitted XML without end tag like this:
<unit type="menu">
<id>1</id>
<unit type="submenu">
<id>1</id>
</unit>
It would appear that with tokenizeXML() it is not possible to get this working since it will just scan for </unit> end tag. What would be preferred way to handle this case? Is there some other splitting method that would get me the result that I need? I would like to use streaming() so splitting with xpath() is not an option for me.
You can use camel-stax that allows to use the SAX api that supports streaming mode.
http://camel.apache.org/stax
You would need to define a POJO and the JAXB annotations that declares the binding.
I am currently developing a system that uses the following format of XML files to for configuration purposes:
<?xml version="1.0" encoding="utf-8"?>
<Branch>
<Department>
<Door id="1" enabled="true"/>
<Door id="2" enabled="true"/>
</Department>
<Department>
<Door id="3" enabled="true"/>
<Door id="4" enabled="false"/>
</Department>
<Department>
....
</Branch>
Do you know how could I parse this XML file?
I have been looking for other answers but I could only get it to work till the Department node. It isn't interpreting the Door node level.