simple-support Mailing List for Simple
Brought to you by:
niallg
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(13) |
May
(13) |
Jun
(27) |
Jul
(4) |
Aug
(14) |
Sep
(7) |
Oct
|
Nov
(6) |
Dec
(24) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
(21) |
Mar
(10) |
Apr
(15) |
May
(24) |
Jun
(24) |
Jul
(30) |
Aug
(5) |
Sep
(19) |
Oct
(27) |
Nov
(16) |
Dec
(24) |
| 2009 |
Jan
(34) |
Feb
(24) |
Mar
(35) |
Apr
(26) |
May
(8) |
Jun
(17) |
Jul
(28) |
Aug
(31) |
Sep
(36) |
Oct
(35) |
Nov
(20) |
Dec
(16) |
| 2010 |
Jan
(40) |
Feb
(21) |
Mar
(47) |
Apr
(45) |
May
(34) |
Jun
(68) |
Jul
(46) |
Aug
(39) |
Sep
(47) |
Oct
(20) |
Nov
(42) |
Dec
(13) |
| 2011 |
Jan
(41) |
Feb
(16) |
Mar
(32) |
Apr
(44) |
May
(28) |
Jun
(35) |
Jul
(37) |
Aug
(33) |
Sep
(60) |
Oct
(20) |
Nov
(35) |
Dec
(23) |
| 2012 |
Jan
(34) |
Feb
(23) |
Mar
(34) |
Apr
(21) |
May
(48) |
Jun
(24) |
Jul
(31) |
Aug
(39) |
Sep
(25) |
Oct
(10) |
Nov
(27) |
Dec
(28) |
| 2013 |
Jan
(32) |
Feb
(24) |
Mar
(24) |
Apr
(9) |
May
(4) |
Jun
(6) |
Jul
(2) |
Aug
(5) |
Sep
|
Oct
(5) |
Nov
(1) |
Dec
(12) |
| 2014 |
Jan
(14) |
Feb
(16) |
Mar
(5) |
Apr
(3) |
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
(6) |
Oct
|
Nov
(6) |
Dec
|
| 2015 |
Jan
(3) |
Feb
(15) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2016 |
Jan
|
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Vladimir V. <vla...@gm...> - 2019-04-28 18:47:59
|
Hi, I wonder is there a way to force persister to encode XML tags in long form such as: <img></img> Currently I get: <img/> I need this to get XML output in correct format so I can calculate digest for Canonicalization ext-c14n Thanks Vlad |
|
From: Renato C. R. <cu...@ip...> - 2018-11-29 18:32:56
|
I have been trying to do this for weeks but I could not find a solution! I tried everything I found on the internet, including @Convert but it only works on non null objects! Please, I seriously need help! How can I make Simple XML serialize null objects? Thanks! Renato |
|
From: Gábor B. <bos...@gm...> - 2018-01-06 20:27:49
|
Dear Simple Xml developers! I have a problem running the tests of this project. I consistently get: Test org.simpleframework.xml.convert.RegistryStrategyTest failed Test report: Seems an ordering issue. The expected result has the dog first, then the cat, but this is reversed. Testsuite: org.simpleframework.xml.convert.RegistryStrategyTest Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.195 sec ------------- Standard Output --------------- <a:petShop xmlns:a="http://domain/a"> <b:pets xmlns:b="http://domain/b"> Kitty 2 </b:pets> </a:petShop>------------- ---------------- --------------- Testcase: testConverter took 0.184 sec FAILED Document does not match expression '/petShop/pets/pet[1]' with attribute name='Lassie' for <a:petShop xmlns:a="http://domain/a"> <b:pets xmlns:b="http://domain/b"> Kitty 2 </b:pets> </a:petShop> junit.framework.AssertionFailedError: Document does not match expression '/petShop/pets/pet[1]' with attribute name='Lassie' for <a:petShop xmlns:a=" http://domain/a"> <b:pets xmlns:b="http://domain/b"> Kitty 2 </b:pets> </a:petShop> at org.simpleframework.xml.ValidationTestCase.assertMatch(ValidationTestCase.java:179) at org.simpleframework.xml.ValidationTestCase.assertElementHasAttribute(ValidationTestCase.java:146) at org.simpleframework.xml.convert.RegistryStrategyTest.testConverter(RegistryStrategyTest.java:69) Can you tell me what this means? Is it safe to ignore this? Further information: https://github.com/Boskovits/guix/issues/61 If you need any further information, please contact me. Thanks for your assistance! |
|
From: <jon...@gm...> - 2017-06-13 20:34:52
|
wsdl2java from Apache CXF supports a plug-in API for generating XML bindings. https://cxf.apache.org/javadoc/latest/org/apache/cxf/databinding/DataBinding.html They have bindings for: Aegis (2.1) Aegis Databinding (2.0.x) JAXB MTOM Attachments with JAXB SDO XMLBeans But none of these work on Android. Has anyone tried writing a wsdl2java binding plugin that generates bindings compatible with Simple? Or is there some other solution for converting wsdl to Java objects compatible with Simple? I'm trying to generate Java objects for my Onvif camera. https://www.onvif.org/profiles/specifications/ https://github.com/fpompermaier/onvif If you clone and build this project (you don't need to edit anything) just run "mvn clean install" It will generate all of the Onvif objects. But the bindings aren't compatible with Simple. -- Jon Smirl jon...@gm... |
|
From: MANDAR V. <man...@gm...> - 2016-03-21 07:03:54
|
Hi,
I have two xml file
XML1:
<Result>
<DataSources>
<DataSource id="dscfid1" type="oracle">
<Properties key="sourceName">sampletable</Properties>
<Properties key="dsConnectionID">test</Properties>
</DataSource>
</DataSources>
</Result>
XML:2
<DSConnection id="dc1">
<Properties key="dbType">oracle</Properties>
<Properties key="userName">xxx</Properties>
<Properties key="password">xxx</Properties>
</DSConnection>
I want the result like:
<Result>
<DataSources>
<DataSource id="dscfid1" type="oracle">
<Properties key="sourceName">sampletable</Properties>
<Properties key="dsConnectionID">test</Properties>
</DataSource>
</DataSources>
<DSConnection id="dc1">
<Properties key="dbType">oracle</Properties>
<Properties key="userName">xxx</Properties>
<Properties key="password">xxx</Properties>
</DSConnection>
</Result>
How i can do using simple-xml framework(http://simple.sourceforge.net/).
I tried to use Object substitution from simple-xml but not able to manage.
Regards,
Mandar Vaidya.
|
|
From: Marc.Waldenberger <Mar...@gm...> - 2016-03-02 09:20:06
|
Hi, i hope this is the correct place to post my question. I tried to read a small XML file <?xml version="1.0" encoding="US-ASCII"?> <Football xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Team> <Player MREF="Foo"/> <Player MREF="Bar"/> </Team> <DESCRIPTION>This is a game</DESCRIPTION> <Player MID="Foo"> <Name>Lionel Messi</Name> </Player> <Player MID="Bar"> <Name>John Lennon</Name> </Player> </Football> but i got an exception: org.simpleframework.xml.strategy.CycleException: Invalid reference 'Foo' found at org.simpleframework.xml.strategy.ReadGraph.readReference(ReadGraph.java:155) at org.simpleframework.xml.strategy.ReadGraph.readInstance(ReadGraph.java:123) so i tried this solution, http://stackoverflow.com/questions/13933314/simple-xml-reference-resolving but then i get the following exception: org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Element(name=Name, type=void, data=false, required=true) on field 'name' private java.lang.String foo.Player.name for class foo.Player at line 4 at org.simpleframework.xml.core.Composite.validate(Composite.java:644) at org.simpleframework.xml.core.Composite.readElements(Composite.java:449) This is just a small example, i have bigger XML files to parse, but the problems are the same, and i can not change the XML files to have the IDs before the Refs. I created a small test project on github, so if somone want to try it out it is just a click away :D https://github.com/Ohorf/SimpleXMLReferenceTest Thanks in advance. Best Regards, Marc |
|
From: Sebastian H. <us...@la...> - 2016-02-16 20:45:51
|
Hi, I checked the use of a converter. I wonder if it is the right solution here. Imagine a pair of attributes: from and to Those are expressed as attributeGroup and used in many elements. I would need to provide a converter for every element. I had a look at the code base. I like the code quality and structure a lot but it is quite a lot of code. I struggled to add a new Label which creates new instances, parses nested fields and add the attribute to the attribute map. I give up here. I don’t thing I can provide a quality patch. The idea I wanted to achieve was: Composition for attributes. Given multiple attributes used in various places in an XML, for example a time range (from, to). In XSD this can be expressed as an attributeGroup. Many elements can contain this attributeGroup. I would like this attributes to be added to a Composite class containing the attributes instead of mapping it to fields in the class. Wherever you use those attributes, you add an annotation and @AttributeGroup Range range; -- Best Regards / Viele Grüße Sebastian Hennebrueder ----- http://www.laliluna.de <http://www.laliluna.de/> Software developer and Coach for Java, JEE, Clojure and Java Persistence > Am 16.02.2016 um 16:15 schrieb Sebastian Hennebrueder <us...@la...>: > > Hi, > > this works technically but creates a lot of verbosity. The intent is to use a composite containing attributes used in a lot of classes. > > What do you think about a new annotation > > @AttributeGroup > To mark a class containing additional attributes. > > I have no idea about the effort, but if I provide a patch, would you accept it? > > -- > Best Regards / Viele Grüße > > Sebastian Hennebrueder > > ----- > http://www.laliluna.de <http://www.laliluna.de/> > Software developer and Coach for Java, JEE, Clojure and Java Persistence > >> Am 16.02.2016 um 15:03 schrieb Niall Gallagher <gal...@ya... <mailto:gal...@ya...>>: >> >> You can write a Converter class, or alternatively you could use an @Resolve to create a object like so >> >> public class X{ >> @Attribute int a; >> @Attribute int b; >> @Attribute int c; >> @Resolve >> public Y get() { >> return new Y(a,b,c); >> } >> } >> public class Y { >> Z z; >> int a; >> Y(a, b, c){ >> this.z = new Z(b,c); >> this.a = a; >> } >> } >> public class Z{ >> int b; >> int c; >> Z(a,b){ >> } >> } >> >> >> From: Sebastian Hennebrueder <us...@la... <mailto:us...@la...>> >> To: sim...@li... <mailto:sim...@li...> >> Sent: Tuesday, 16 February 2016, 13:10 >> Subject: [Simple-support] Composite attributes >> >> Hi, >> >> I have a mapping question for a given XSD. Given a attributeGroup bar, used in many definitions. >> >> <xs:complexType name=„myElement"> >> <xs:complexContent> >> <xs:extension base="ns1:someMoreAttributes"> >> <xs:attributeGroup ref="ns1:foo" /> >> </xs:extension> >> </xs:complexContent> >> </xs:complexType> >> >> <xs:attributeGroup name=„foo"> >> <xs:attribute name="name" type="xs:string" /> >> <xs:attributeGroup ref="ns1:bar" /> >> </xs:attributeGroup> >> >> <xs:attributeGroup name="bar"> >> <xs:attribute name=„field1" type="xs:string“/> >> <xs:attribute name=„field2" type="xs:string“/> >> </xs:attributeGroup> >> >> xml: >> <myElement id="abc“ name="aName“ field1="abc“ field2="def“/> >> >> I would like to have a class >> class MyElement >> String id; >> String name; >> Bar bar; >> } >> >> class Bar{ >> String field1; >> String field2; >> } >> >> Is there a way to write attributes to a nested class Bar instead of MyElement? >> >> -- >> Best Regards / Viele Grüße >> >> Sebastian Hennebrueder >> >> ----- >> http://www.laliluna.de <http://www.laliluna.de/> >> Software developer and Coach for Java, JEE, Clojure and Java Persistence >> >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 <http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140> >> _______________________________________________ >> Simple-support mailing list >> Sim...@li... <mailto:Sim...@li...> >> https://lists.sourceforge.net/lists/listinfo/simple-support <https://lists.sourceforge.net/lists/listinfo/simple-support> >> >> > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Sebastian H. <us...@la...> - 2016-02-16 15:15:50
|
Hi, this works technically but creates a lot of verbosity. The intent is to use a composite containing attributes used in a lot of classes. What do you think about a new annotation @AttributeGroup To mark a class containing additional attributes. I have no idea about the effort, but if I provide a patch, would you accept it? -- Best Regards / Viele Grüße Sebastian Hennebrueder ----- http://www.laliluna.de <http://www.laliluna.de/> Software developer and Coach for Java, JEE, Clojure and Java Persistence > Am 16.02.2016 um 15:03 schrieb Niall Gallagher <gal...@ya...>: > > You can write a Converter class, or alternatively you could use an @Resolve to create a object like so > > public class X{ > @Attribute int a; > @Attribute int b; > @Attribute int c; > @Resolve > public Y get() { > return new Y(a,b,c); > } > } > public class Y { > Z z; > int a; > Y(a, b, c){ > this.z = new Z(b,c); > this.a = a; > } > } > public class Z{ > int b; > int c; > Z(a,b){ > } > } > > > From: Sebastian Hennebrueder <us...@la...> > To: sim...@li... > Sent: Tuesday, 16 February 2016, 13:10 > Subject: [Simple-support] Composite attributes > > Hi, > > I have a mapping question for a given XSD. Given a attributeGroup bar, used in many definitions. > > <xs:complexType name=„myElement"> > <xs:complexContent> > <xs:extension base="ns1:someMoreAttributes"> > <xs:attributeGroup ref="ns1:foo" /> > </xs:extension> > </xs:complexContent> > </xs:complexType> > > <xs:attributeGroup name=„foo"> > <xs:attribute name="name" type="xs:string" /> > <xs:attributeGroup ref="ns1:bar" /> > </xs:attributeGroup> > > <xs:attributeGroup name="bar"> > <xs:attribute name=„field1" type="xs:string“/> > <xs:attribute name=„field2" type="xs:string“/> > </xs:attributeGroup> > > xml: > <myElement id="abc“ name="aName“ field1="abc“ field2="def“/> > > I would like to have a class > class MyElement > String id; > String name; > Bar bar; > } > > class Bar{ > String field1; > String field2; > } > > Is there a way to write attributes to a nested class Bar instead of MyElement? > > -- > Best Regards / Viele Grüße > > Sebastian Hennebrueder > > ----- > http://www.laliluna.de <http://www.laliluna.de/> > Software developer and Coach for Java, JEE, Clojure and Java Persistence > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 <http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140> > _______________________________________________ > Simple-support mailing list > Sim...@li... <mailto:Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simple-support <https://lists.sourceforge.net/lists/listinfo/simple-support> > > |
|
From: Niall G. <gal...@ya...> - 2016-02-16 14:03:47
|
You can write a Converter class, or alternatively you could use an @Resolve to create a object like so
public class X{ @Attribute int a;
@Attribute int b;
@Attribute int c;
@Resolve
public Y get() {
return new Y(a,b,c); }}public class Y { Z z;
int a;
Y(a, b, c){
this.z = new Z(b,c); this.a = a;
}
}public class Z{ int b;
int c;
Z(a,b){
}
}
From: Sebastian Hennebrueder <us...@la...>
To: sim...@li...
Sent: Tuesday, 16 February 2016, 13:10
Subject: [Simple-support] Composite attributes
Hi,
I have a mapping question for a given XSD. Given a attributeGroup bar, used in many definitions.
<xs:complexType name=„myElement">
<xs:complexContent>
<xs:extension base="ns1:someMoreAttributes">
<xs:attributeGroup ref="ns1:foo" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:attributeGroup name=„foo">
<xs:attribute name="name" type="xs:string" />
<xs:attributeGroup ref="ns1:bar" />
</xs:attributeGroup>
<xs:attributeGroup name="bar">
<xs:attribute name=„field1" type="xs:string“/>
<xs:attribute name=„field2" type="xs:string“/></xs:attributeGroup>
xml:<myElement id="abc“ name="aName“ field1="abc“ field2="def“/>
I would like to have a class class MyElement String id; String name; Bar bar;}
class Bar{ String field1; String field2;}
Is there a way to write attributes to a nested class Bar instead of MyElement?
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
-----
http://www.laliluna.de
Software developer and Coach for Java, JEE, Clojure and Java Persistence
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Sebastian H. <us...@la...> - 2016-02-16 13:26:44
|
Hi,
I have a mapping question for a given XSD. Given a attributeGroup bar, used in many definitions.
<xs:complexType name=„myElement">
<xs:complexContent>
<xs:extension base="ns1:someMoreAttributes">
<xs:attributeGroup ref="ns1:foo" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:attributeGroup name=„foo">
<xs:attribute name="name" type="xs:string" />
<xs:attributeGroup ref="ns1:bar" />
</xs:attributeGroup>
<xs:attributeGroup name="bar">
<xs:attribute name=„field1" type="xs:string“/>
<xs:attribute name=„field2" type="xs:string“/>
</xs:attributeGroup>
xml:
<myElement id="abc“ name="aName“ field1="abc“ field2="def“/>
I would like to have a class
class MyElement
String id;
String name;
Bar bar;
}
class Bar{
String field1;
String field2;
}
Is there a way to write attributes to a nested class Bar instead of MyElement?
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
-----
http://www.laliluna.de <http://www.laliluna.de/>
Software developer and Coach for Java, JEE, Clojure and Java Persistence
|
|
From: Mathieu L. <blu...@gm...> - 2016-02-12 09:05:33
|
Hi Marcus, How do you want the arguments to be passed to the method ? Can you give a Java example from your XML example ? *Mathieu* 2016-02-12 0:02 GMT+01:00 Marcipicus . <mar...@gm...>: > Hi there, > > I'm trying to write a generic server/ client framework right now that will > automatically serialize and deserialize the arguments of an rpc call of the > form. > > <RPCCALL methodName="add"> > <Object1> > <el1>dasfgdasf</el1> > </Object1> > <Object2 attr1="value"> > <anotherel1ofADifferentype> > <el1.2>dfas</el1.2> > </anotherel1ofADifferentype> > </Object2> > <RPCCALL> > > > The problem is I don't want ot have to write a class for every rpc call > that gets created. I just want to be able to deserialize arguments and pass > them to the method. > > Does anyone have any idea how to do this or have any ideas about how to > get around the writing of custom code for each rpc call interpretation. > > Any help is appreciated. > > Thank you very much, > Sincerely, > Marcus Sammon > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > > |
|
From: Marcipicus . <mar...@gm...> - 2016-02-11 23:02:52
|
Hi there, I'm trying to write a generic server/ client framework right now that will automatically serialize and deserialize the arguments of an rpc call of the form. <RPCCALL methodName="add"> <Object1> <el1>dasfgdasf</el1> </Object1> <Object2 attr1="value"> <anotherel1ofADifferentype> <el1.2>dfas</el1.2> </anotherel1ofADifferentype> </Object2> <RPCCALL> The problem is I don't want ot have to write a class for every rpc call that gets created. I just want to be able to deserialize arguments and pass them to the method. Does anyone have any idea how to do this or have any ideas about how to get around the writing of custom code for each rpc call interpretation. Any help is appreciated. Thank you very much, Sincerely, Marcus Sammon |
|
From: PsyKo B. <psy...@gm...> - 2015-12-10 08:58:15
|
Hello, I'm writing an app using a plugin architecture. To perform a save of the project, each plugin will store in a container in the project xml file. The resulting xml will be something like : https://gist.github.com/cncgoko/a70e24383e68d7c85022 The existing plugin is unknown at compile time, so the annotation ElementListUnion cannot be used. The content of the plugin data will be XML and probably use annotation as a standard SimpleXml description. The "owner" attribute of the container will be used to know what plugins will provide the decoding process for the container. I'm pretty used to SimpleXml using annotation (@Attribute, @element,...) for compile time defined xml but I wanted to know if this new case can be achieved ? Is there something out of the box ? If not, can anyone provide at least a clue of the way to do it ? (use Transformer ?..) Thank you, Regards, |
|
From: Niall G. <gal...@ya...> - 2015-09-16 21:38:56
|
Hi, The code for the Simple XML library has moved to GitHub under ngallagher/simplexml | | | | | | | | | | | ngallagher/simplexmlsimplexml - Simple XML | | | | View on github.com | Preview by Yahoo | | | | | This should hopefully give more visibility to the development process. Some new features should be released soon, and some issues will be resolved. If there are any feature requests or patches please put them here. Thanks,Niall |
|
From: Niall G. <gal...@ya...> - 2015-09-16 20:27:45
|
Hi, The code for the Simple XML library has moved to GitHub under ngallagher/simplexml | | | | | | | | | | | ngallagher/simplexmlsimplexml - Simple XML | | | | View on github.com | Preview by Yahoo | | | | | This should hopefully give more visibility to the development process. Some new features should be released soon, and some issues will be resolved. If there are any feature requests or patches please put them here. Thanks,Niall |
|
From: Shevek <sh...@an...> - 2015-06-23 23:48:33
|
Two of the XPath tests are failing with both Azul Zulu 8 and Ubuntu's JDK8.
RegistryStrategyTest. testConverter
ConversionTest. testConverter
Similar reasons in each:
junit.framework.AssertionFailedError: Document does not match expression
'/petShop/pets/pet[1]' with attribute name='Lassie' for <a:petShop
xmlns:a="http://domain/a">
<b:pets xmlns:b="http://domain/b">
<pet class="org.simpleframework.xml.convert.ExampleConverters$Cat">
<name>Kitty</name>
<age>2</age>
</pet>
<pet
class="org.simpleframework.xml.convert.ExampleConverters$Dog"
name="Lassie" age="10"/>
</b:pets>
</a:petShop>
I note that with JDK7, Lassie is first and Kitty is second. In JDK8,
Kitty is first and Lassie is second. I haven't looked more deeply than that.
S.
|
|
From: Shevek <sh...@an...> - 2015-03-29 20:33:06
|
Finally released, documented and Mavenized: * A library of serializers for standard JDK and third party classes. * Unit testing serializability with SimpleXML. * Support for using SimpleXML in Spring Framework, HTTP/RPC. https://github.com/shevek/simple-xml-serializers Also published on Maven Central: http://search.maven.org/#search|ga|1|g%3A%22org.anarres.simplexml.serializers%22 Requests and patches welcome. Have fun! S. |
|
From: Menashè E. <mel...@og...> - 2015-03-25 16:17:35
|
Hello,
I wonder why parametersList and also the attribute collectionName are null.
The annotated code:
@Root(name = "Datasets",strict=false)
public class ParametersContainer {
@ElementList(entry = "DiscoveryCode", inline = true)
@Path("Datasets/Dataset")
List<String> parametersList;
@Attribute(name = "collectionName")
@Path("Datasets/Dataset")
String collectionName;
@Override
public String toString() {
return parametersList.toString()+ " " + collectionName;
}
}
The (simplified) xml:
<Datasets>
<Dataset collectionName="test1" id="1">
<DiscoveryCode codeListValue="T1" >Test1</DiscoveryCode>
</Dataset>
<Dataset collectionName="test2" id="2">
<DiscoveryCode codeListValue="T2" >Test2</DiscoveryCode>
</Dataset>
</Datasets>
Without using @Path:
1. I had success reading the parametersList only when it was a second
level element (right under root.
2. I had success reading the attribute only once it was in the root
element, but this is not how my xml is built.
Thanks for reading.
--
With kind regards,
Menashè
|
|
From: Shevek <sh...@an...> - 2015-03-24 08:43:21
|
Hi, Did you have time to look at the issues thrown up by this test suite? Thank you. S. On 03/02/2015 10:32 PM, Shevek wrote: > Hi, > > I wrote a set of extended serializers and utilities for SimpleXML, but > some of the tests fail. Please can you check out > > https://github.com/shevek/simplexml-serializers > > and advise whether these are bugs? > > Run ./gradlew --daemon clean build > > It will output a report URL when it completes. > > I would very much like to offer this code to the community. It has been > extracted from a commercial product of ours which uses a patched version > of SimpleXML, and I have restructured it a little for the open source > release. > > Thank you. > > S. > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |
|
From: Niall G. - Y. <Nia...@yi...> - 2015-03-22 22:52:54
|
Simple does not actually do any parsing, it delegates to either StAX, DOM, or XmlPull depending on the platform you are on. If you are on Java 1.5+ you will be using StAX so just specify the configuration required to supress this behaviour. If you are on Android you will be using XmlPull, again this requires some specific config.
From: Elena Solomon [mailto:ele...@gm...]
Sent: 22 March 2015 21:56
To: sim...@li...
Subject: [Simple-support] Prevent XML Bombs in simpleframework
Hello,
I have, for example, the following xml (containing a XML bomb):
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<child>
<firstname>&lol9;</firstname>
<lastname>Doe</lastname>
</child>
When I try to parse it using simpleframework:
Persister persister = new Persister();
File source = new File ("test/Child.xml");
try {
Child child = persister.read(Child.class, source);
} catch(Exception e) {
// log
}
An OutOfMemoryError is thrown because it is trying to expand the entities.
How can I block the expansion of the entities in simpleframework?
Thank you very much!
E.
|
|
From: Elena S. <ele...@gm...> - 2015-03-22 10:55:57
|
Hello,
I have, for example, the following xml (containing a XML bomb):
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2
"&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3
"&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4
"&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5
"&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6
"&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7
"&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8
"&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9
"&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<child>
<firstname>&lol9;</firstname>
<lastname>Doe</lastname></child>
When I try to parse it using simpleframework:
Persister persister = new Persister();
File source = new File ("test/Child.xml");
try {
Child child = persister.read(Child.class, source);
} catch(Exception e) {
// log
}
An OutOfMemoryError is thrown because it is trying to expand the entities.
How can I block the expansion of the entities in simpleframework?
Thank you very much!
E.
|
|
From: Sebastian H. <us...@la...> - 2015-03-03 13:41:52
|
Hi, I have two scenarios which I did not manage to map: 1) foo with text and tag content <foo>abc</foo> <foo><bar name="123“>hi</bar></foo> 2) A tag which contains mixed text and tag content <part>some text<foo>foo text</foo>more text</part> How do I map this? -- Best Regards / Viele Grüße Sebastian |
|
From: Shevek <sh...@an...> - 2015-03-03 07:04:15
|
Hi, I wrote a set of extended serializers and utilities for SimpleXML, but some of the tests fail. Please can you check out https://github.com/shevek/simplexml-serializers and advise whether these are bugs? Run ./gradlew --daemon clean build It will output a report URL when it completes. I would very much like to offer this code to the community. It has been extracted from a commercial product of ours which uses a patched version of SimpleXML, and I have restructured it a little for the open source release. Thank you. S. |
|
From: alex c. <ale...@gm...> - 2015-02-26 15:39:32
|
Hi All,
this may be unusual case and I don't know if it can be done-- trying to
work with old soap service from android side.
So far, SimpleXML worked great saving me alot of time, but I am hitting
the wall trying to parse soap response(see below).
It appears to be sending back soap xml response w/ attached binary stream.
How do I de-serialize that?
If it can be done then Converter has to be involved, but how? i am at loss
how ...
Any helpful ideas, comments are very welcome!
Thanks!
"<SOAP-ENV:Envelope
..
<SOAP-ENV:Body><scnsvc:GetImageFileResponse><scnsvc:Image><scnsvc:Name>job:165.pdf</scnsvc:Name><scnsvc:Bytes><xop:Include
href="cid:File"/></scnsvc:Bytes></scnsvc:Image><scnsvc:ImageFileStatus>FileReturned</scnsvc:ImageFileStatus></scnsvc:GetImageFileResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--==jPSSSYL1hVVRszdC83teTvlgHirdkNBIcTaurmkM75eos7qozYGGHrmONSry==
Content-Type: application/file
Content-Transfer-Encoding: binary
Content-ID: <File>
%PDF-1.4
%
4 0 obj
<< /Type /Page
/Parent 2 0 R
/Resources 3 0 R
/MediaBox [0 0 612 792]
/Contents 6 0 R
>>
endobj
3 0 obj
<< /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
/XObject << /XIPLAYER0 5 0 R
>>
>>
endobj
5 0 obj
<< /Length 758
/Type /XObject
/Subtype /Image
/BitsPerComponent 1
/Width 2560
/Height 3328
/ColorSpace /DeviceGray
/Filter /CCITTFaxDecode
/DecodeParms << /K -1
/Columns 2560
/BlackIs1 false
>>
>>
stream
9PyC-㢇"?A;C>ފz(}!ފި*oTPCn?Ez(~;Tbҽ;U@v
^z"?GG?z[GXn=aWx":cDu":czzG[o[zzMW2j&ɪU&2j&MTdFMTdFMTdG&95Qɪ&?&?l(A#FKh)
endstream
endobj
6 0 obj
<< /Length 101
>>
stream
q
614.400000 0.000000 0.000000 798.720000 -1.200000 -3.360000 cm
/XIPLAYER0 Do
Q
endstream
endobj
1 0 obj
<< /Type /Catalog
/Pages 2 0 R
>>
endobj
2 0 obj
<< /Type /Pages
/Kids [4 0 R]
/Count 1
>>
endobj
7 0 obj
<< /CreationDate (D:20150225171857-05'00')
/Creator (Xerox ColorQube 8900X)
/Producer (Xerox ColorQube 8900X)
>>
endobj
xref
0 8
0000000000 65535 f
000
"
|
|
From: adev d. <and...@gm...> - 2015-02-18 11:17:59
|
Ok, it is simple:
nodeMap.remove("class");
node.put("class", "newClassPath");
Thanks for support!
On 17 February 2015 at 12:26, adev dev <and...@gm...> wrote:
> Great! One more question. How to modify this InputNode in order to apply
> this new name "y". I assume after changing node I have to call
> super.read(). Thank you!
>
>
>
> On 17 February 2015 at 07:57, Niall Gallagher - Yieldbroker <
> Nia...@yi...> wrote:
>
>> It would look something like this, check out the test cases I have done
>> this very thing several times there.
>>
>>
>>
>> class MyStrategy extends AnnotationStrategy{
>>
>>
>>
>> @Override
>>
>> read(InputNode n, …) {
>>
>> String className = n.getAttribute(“class”).getValue();
>>
>>
>>
>> if(className.equals(“x”)) {
>>
>> className = “y”;
>>
>> }
>>
>> // etc…
>>
>> }
>>
>> }
>>
>>
>>
>>
>>
>> *From:* adev dev [mailto:and...@gm...]
>> *Sent:* 17 February 2015 17:52
>> *To:* Niall Gallagher
>> *Cc:* sim...@li...
>> *Subject:* Re: [Simple-support] Deserializing polymorphic types.
>>
>>
>>
>> Niall, thank you for response. To be more specific, I create serializer
>> with AnnotationStrategy:
>>
>>
>>
>> Strategy strategy = new AnnotationStrategy();
>>
>> mSerializer = new Persister(strategy);
>>
>>
>>
>> Than, I am using it to read slide:
>>
>> mSerializer.read(Slide.class, bis);
>>
>>
>>
>> Class Slide has list of elements of polimorphic type:
>>
>> @ElementList(name = "mList")
>>
>> private PrsArrayList<Element> mElementList = null;
>>
>> "Element" is base class of the things which are serialized.
>>
>>
>>
>> Could you please provide some pseudo code how to achieve the goal?? How
>> to do this mapping? Thank you!
>>
>>
>>
>> On 16 February 2015 at 23:12, Niall Gallagher <gal...@ya...>
>> wrote:
>>
>> Ya, you can use a Strategy or a Visitor to do this. Another alternative
>> is to open a text editor and do a search an replace on the XML.
>>
>> --------------------------------------------
>> On Tue, 17/2/15, adev dev <and...@gm...> wrote:
>>
>> Subject: [Simple-support] Deserializing polymorphic types.
>> To: sim...@li...
>> Received: Tuesday, 17 February, 2015, 2:03 AM
>>
>>
>> I am using SimpleXML
>> to serialize classes. I am serializing polymorphic types as
>> well.
>> Due to this I came across a problem. I would like
>> to do code refactoring and move some classes between
>> packages. After I did it old XML files created before
>> refactoring cannot be read. Simple framwork is throwing
>> exception that class is not found. In XML full path to class
>> is stored so after I changed class package class cannot not
>> be found. What is the solution to this problem? Is there any
>> way to apply kind of mapping between old and new class
>> location???
>> Thank you,
>> BR, M
>>
>> -----Inline Attachment Follows-----
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT
>> Server
>> from Actuate! Instantly Supercharge Your Business Reports
>> and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App
>> Integration & more
>> Get technology previously reserved for billion-dollar
>> corporations, FREE
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
>> -----Inline Attachment Follows-----
>>
>> _______________________________________________
>> Simple-support mailing list
>> Sim...@li...
>> https://lists.sourceforge.net/lists/listinfo/simple-support
>>
>>
>>
>
>
|