simple-support Mailing List for Simple (Page 9)
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: Алексей К. <_l...@in...> - 2013-01-21 21:04:37
|
It is able to deserealize document with russian tags? I try it with no success in inner tags (with @Element(name="russiantag"), outer tags are recognized with @Root(name="russiantag") or @Element(...) or @ElementList(...) W/System.err(27616): org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Element(data=false, name=Адрес, required=true, type=class java.lang.String) on field 'clientAddress' public java.lang.String com.example.sxp.IBClient.clientAddress for class com.example.sxp.IBClient at line 6 If i replace russian tags with english - all works ok. |
|
From: Jaewoo L. <dl...@gm...> - 2013-01-17 09:30:57
|
So that... What should I use as XML parser for this job?
Thank you for your help.
2013/1/17 Niall Gallagher - Yieldbroker <Nia...@yi...>
> Different platforms use different XML parsers, for instance Android uses
> XmlPull, Java 1.5 uses DOM, Javae 1.5 with StAX in the classpath uses StAX.
> Java 1.6 uses StAX.****
>
> ** **
>
> *From:* Jaewoo Lee [mailto:dl...@gm...]
> *Sent:* Wednesday, 16 January 2013 9:02 PM
> *To:* sim...@li...
> *Subject:* Re: [Simple-support] Object obj = node.getSource() ?****
>
> ** **
>
> ** **
>
> I installed Java Platform (JDK) 7u11. And in classpath, there are
> stax-1.2.0, too.****
>
> SOURCE LIST means iterator or linked-list of node.getSource().****
>
> ****
>
> The following is my Converter code.****
>
> ** **
>
> public class SXCMTSConverter implements Converter<SXCMTS>{****
>
> ** **
>
> @Override****
>
> public SXCMTS read(InputNode node) throws Exception {****
>
> Object obj = node.getSource();****
>
> Element element = (Element)obj; <-- HERE
> ClassCastException occured.****
>
> ** **
>
> return new SXCMTS();****
>
> }****
>
> ** **
>
> @Override****
>
> public void write(OutputNode node, SXCMTS arg1) throws Exception {****
>
> }****
>
> }****
>
> ** **
>
> ****
>
> Error Message :****
>
> java.lang.ClassCastException:
> com.sun.xml.internal.stream.events.StartElementEvent cannot be cast to
> org.w3c.dom.Element****
>
> ** **
>
> ** **
>
> Am I missing something? or Is there any way to solve this problem?****
>
> Thank you for your help, Niall.****
>
> ** **
>
> ** **
>
> 2013/1/11 Niall Gallagher <gal...@ya...>****
>
> What is a SOURCE LIST? node.getSource() will product the underlying
> object, if you are using a JDK 1.6 or above this will be StAX its only DOM
> by default for 1.5 if you do not have StAX on the classpath. You can force
> the provider to DOM if you like. To do this take a closer look at the
> HackJob test case.
>
> Thanks,
> Niall
>
> --- On Fri, 11/1/13, Jaewoo Lee <dl...@gm...> wrote:
>
> > From: Jaewoo Lee <dl...@gm...>
> > Subject: [Simple-support] Object obj = node.getSource() ?
> > To: sim...@li...
> > Received: Friday, 11 January, 2013, 1:54 AM****
>
> > Hi, Niall.
> > During using Converter,
> > I wanna make a SOURCE LIST of
> > InputNode
> > So I am referencing
> > "HackJobToGrabFloatingTextTest.java".
> >
> > It's my code that I
> > imitate HackJobToGrabFloatingTextTest.
> > import
> > org.simpleframework.xml.convert.Converter;import
> > org.simpleframework.xml.stream.InputNode;
> > import
> > org.simpleframework.xml.stream.OutputNode;import
> > org.w3c.dom.Element;
> > public class SXCMTSConverter implements
> > Converter<SXCMTS>{
> > @Override
> > public SXCMTS
> > read(InputNode node) throws Exception
> > { Object obj =
> > node.getSource(); Element
> > element = (Element)obj;
> > .....
> > } .....}
> > but Exception popped.
> > java.lang.ClassCastException:
> > com.sun.xml.internal.stream.events.StartElementEvent cannot
> > be cast to org.w3c.dom.Element
> >
> > Is that code something wrong ? Or
> > wrong version of library? If wrong version, could you let me****
>
> > know right version of that Library?Or How do I****
>
> > make a list of Source List of Input Node?
> >
> > Thanks for your help.
> >****
>
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
> > and
> > much more. Get web development skills now with LearnDevNow
> > -
> > 350+ hours of step-by-step video tutorials by Microsoft MVPs
> > and experts.
> > SALE $99.99 this month only -- learn more at:
> > http://p.sf.net/sfu/learnmore_122812
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >****
>
> ** **
>
> ** **
>
|
|
From: Kiran R. <tec...@gm...> - 2013-01-17 05:43:17
|
Yes! That did it.
Using the Dictionary data structure provided by simple framework did the
trick. This is exactly what I was looking for. Thanks!
On Thu, Jan 17, 2013 at 9:37 AM, Niall Gallagher - Yieldbroker <
Nia...@yi...> wrote:
> Try****
>
> @Root****
>
> class Devices{****
>
> @ElementList(entry="device", inline=true)****
>
> org.simpleframework.xml.utl.Dictionary<Device> list;****
>
> }****
>
> @Root****
>
> class Device {****
>
> @Attribute****
>
> int id;****
>
> @Element****
>
> String name;****
>
> @Element****
>
> String os;****
>
> }****
>
> ** **
>
> ** **
>
> ** **
>
> *From:* Kiran Rao [mailto:tec...@gm...]
> *Sent:* Thursday, 17 January 2013 2:48 PM
> *To:* Niall Gallagher - Yieldbroker
> *Subject:* Re: [Simple-support] Transitioning from ElementList to
> ElementMap****
>
> ** **
>
> If I add required = false on all elements of Device, I get this:
> org.simpleframework.xml.core.ElementException: Element 'os' does not have
> a match in class org.github.curioustechizen.simplexml.map.DeviceMap at line
> 1****
>
> So, I also added strict = false on the @Root annotation for DeviceMapclass. Now, the parsing is successful, but as you probably suspect, the
> fields of the Device object are all null.****
>
> From what I understand, my use case is a special case since I am
> attempting to map a Device ID to the entire Device object itself. The
> mapped value is neither a primitive, nor a full-fledged element - it is a
> collection of elements at the same level.
>
> Is this even supported?****
>
> ** **
>
> On Thu, Jan 17, 2013 at 5:45 AM, Niall Gallagher - Yieldbroker <
> Nia...@yi...> wrote:****
>
> On the @Element use required=false****
>
> ****
>
> *From:* Kiran Rao [mailto:tec...@gm...]
> *Sent:* Thursday, 17 January 2013 1:53 AM
> *To:* simple-support
> *Subject:* [Simple-support] Transitioning from ElementList to ElementMap**
> **
>
> ****
>
> I have an XML format that looks like this:****
>
> <devices>****
>
> <device id="10">****
>
> <name>Nexus 7</name>****
>
> <os>Android</os>****
>
> </device>
> ****
>
> <device id="20">
> <name>Samsung Galaxy S3</name>
> <os>Android</os>
> </device>
> <device id="30">
> <name>Apple iPad3</name>
> <os>iOS</os>
> </device>
> ****
>
> </devices>****
>
> ****
>
> Currently, I am treating this as an ElementList as follows:****
>
> @Root(name="devices")****
>
> class Devices{****
>
> @ElementList(inline="true")****
>
> List<Device> devices;****
>
> // ... Constructors, getters, setters
> }****
>
> @Root(name="device")****
>
> class Device{****
>
> @Attribute(name="id")****
>
> long id;****
>
> @Element(name="name")****
>
> String name;****
>
> @Element(name="os")****
>
> String os;
>
> //... Constructors, getters, setters****
>
> }****
>
> ****
>
> So far, so good. I have been parsing this as an ArrayList. However, *I
> almost always want to access a device by ID*, not by its position. So, I
> thought, I'd instead parse this as a Map, not a List. I can map a device ID
> to the device object itself.****
>
> I tried to use ElementMap annotation, but I can't seem to get it right.
> Here's what I've tried:
>
> @Root(name="devices")
> public class DeviceMap {
>
> @ElementMap(entry="device", key="id", attribute = true, inline = true)
> private Map<Long, Device> map;
>
> public Map<Long, Device> getMap(){
> return this.map;
> }
> }
>
> @Root(name = "device")
> public class Device {
> @Element(name="os")
> String os;
>
> @Element(name="name")
> String name;
>
> //... Constructors, getters, setters}
> }****
>
> However, this fails with a ValueRequiredException:
>
> org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy
> @org.simpleframework.xml.Element(name=OS, data=false, required=true,
> type=void) on field 'os' java.lang.String ****
>
> ****
>
> ****
>
> *Note that the value of the Map in my case turns out to be neither a
> primitive, nor an object - it is a bunch of what would have been inline
> elements.*****
>
> ****
>
> Any pointers on how to proceed with this?****
>
>
> --
> Regards,
> =======
> Kiran Rao
> http://curioustechizen.blogspot.com/
> http://stackoverflow.com/users/570930/curioustechizen****
>
>
>
>
> --
> Regards,
> =======
> Kiran Rao
> http://curioustechizen.blogspot.com/
> http://stackoverflow.com/users/570930/curioustechizen****
>
--
Regards,
=======
Kiran Rao
http://curioustechizen.blogspot.com/
http://stackoverflow.com/users/570930/curioustechizen
|
|
From: Niall G. - Y. <Nia...@yi...> - 2013-01-17 00:15:34
|
On the @Element use required=false
From: Kiran Rao [mailto:tec...@gm...]
Sent: Thursday, 17 January 2013 1:53 AM
To: simple-support
Subject: [Simple-support] Transitioning from ElementList to ElementMap
I have an XML format that looks like this:
<devices>
<device id="10">
<name>Nexus 7</name>
<os>Android</os>
</device>
<device id="20">
<name>Samsung Galaxy S3</name>
<os>Android</os>
</device>
<device id="30">
<name>Apple iPad3</name>
<os>iOS</os>
</device>
</devices>
Currently, I am treating this as an ElementList as follows:
@Root(name="devices")
class Devices{
@ElementList(inline="true")
List<Device> devices;
// ... Constructors, getters, setters
}
@Root(name="device")
class Device{
@Attribute(name="id")
long id;
@Element(name="name")
String name;
@Element(name="os")
String os;
//... Constructors, getters, setters
}
So far, so good. I have been parsing this as an ArrayList. However, I almost always want to access a device by ID, not by its position. So, I thought, I'd instead parse this as a Map, not a List. I can map a device ID to the device object itself.
I tried to use ElementMap annotation, but I can't seem to get it right. Here's what I've tried:
@Root(name="devices")
public class DeviceMap {
@ElementMap(entry="device", key="id", attribute = true, inline = true)
private Map<Long, Device> map;
public Map<Long, Device> getMap(){
return this.map;
}
}
@Root(name = "device")
public class Device {
@Element(name="os")
String os;
@Element(name="name")
String name;
//... Constructors, getters, setters}
}
However, this fails with a ValueRequiredException:
org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Element(name=OS, data=false, required=true, type=void) on field 'os' java.lang.String
Note that the value of the Map in my case turns out to be neither a primitive, nor an object - it is a bunch of what would have been inline elements.
Any pointers on how to proceed with this?
--
Regards,
=======
Kiran Rao
http://curioustechizen.blogspot.com/
http://stackoverflow.com/users/570930/curioustechizen
|
|
From: Niall G. - Y. <Nia...@yi...> - 2013-01-17 00:13:34
|
Different platforms use different XML parsers, for instance Android uses XmlPull, Java 1.5 uses DOM, Javae 1.5 with StAX in the classpath uses StAX. Java 1.6 uses StAX.
From: Jaewoo Lee [mailto:dl...@gm...]
Sent: Wednesday, 16 January 2013 9:02 PM
To: sim...@li...
Subject: Re: [Simple-support] Object obj = node.getSource() ?
I installed Java Platform (JDK) 7u11. And in classpath, there are stax-1.2.0, too.
SOURCE LIST means iterator or linked-list of node.getSource().
The following is my Converter code.
public class SXCMTSConverter implements Converter<SXCMTS>{
@Override
public SXCMTS read(InputNode node) throws Exception {
Object obj = node.getSource();
Element element = (Element)obj; <-- HERE ClassCastException occured.
return new SXCMTS();
}
@Override
public void write(OutputNode node, SXCMTS arg1) throws Exception {
}
}
Error Message :
java.lang.ClassCastException: com.sun.xml.internal.stream.events.StartElementEvent cannot be cast to org.w3c.dom.Element
Am I missing something? or Is there any way to solve this problem?
Thank you for your help, Niall.
2013/1/11 Niall Gallagher <gal...@ya...<mailto:gal...@ya...>>
What is a SOURCE LIST? node.getSource() will product the underlying object, if you are using a JDK 1.6 or above this will be StAX its only DOM by default for 1.5 if you do not have StAX on the classpath. You can force the provider to DOM if you like. To do this take a closer look at the HackJob test case.
Thanks,
Niall
--- On Fri, 11/1/13, Jaewoo Lee <dl...@gm...<mailto:dl...@gm...>> wrote:
> From: Jaewoo Lee <dl...@gm...<mailto:dl...@gm...>>
> Subject: [Simple-support] Object obj = node.getSource() ?
> To: sim...@li...<mailto:sim...@li...>
> Received: Friday, 11 January, 2013, 1:54 AM
> Hi, Niall.
> During using Converter,
> I wanna make a SOURCE LIST of
> InputNode
> So I am referencing
> "HackJobToGrabFloatingTextTest.java".
>
> It's my code that I
> imitate HackJobToGrabFloatingTextTest.
> import
> org.simpleframework.xml.convert.Converter;import
> org.simpleframework.xml.stream.InputNode;
> import
> org.simpleframework.xml.stream.OutputNode;import
> org.w3c.dom.Element;
> public class SXCMTSConverter implements
> Converter<SXCMTS>{
> @Override
> public SXCMTS
> read(InputNode node) throws Exception
> { Object obj =
> node.getSource(); Element
> element = (Element)obj;
> .....
> } .....}
> but Exception popped.
> java.lang.ClassCastException:
> com.sun.xml.internal.stream.events.StartElementEvent cannot
> be cast to org.w3c.dom.Element
>
> Is that code something wrong ? Or
> wrong version of library? If wrong version, could you let me
> know right version of that Library?Or How do I
> make a list of Source List of Input Node?
>
> Thanks for your help.
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Master HTML5, CSS3, ASP.NET<http://ASP.NET>, MVC, AJAX, Knockout.js, Web API
> and
> much more. Get web development skills now with LearnDevNow
> -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs
> and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...<mailto:Sim...@li...>
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|
|
From: Niall G. - Y. <Nia...@yi...> - 2013-01-17 00:12:31
|
Can you send on a test for this? <id></id> and </id> should deserialize to the same thing.
From: Jaewoo Lee [mailto:dl...@gm...]
Sent: Tuesday, 15 January 2013 8:57 PM
To: sim...@li...
Subject: [Simple-support] <element/> or <element></element>
Hi, Niall.
I am doing Read/Write XML job during simple framework.
My purpose is re-write XML output as same as input.
But, happened problem about NULL ELEMENT.
For example,
Input like
<person>
<id></id>
</person>
came correct.
But,
<person>
<id/>
</person>
occured error.
Simple Framework does NOT allow grammar rule like <element/> ?
Thank you for your help always... T^T
|
|
From: Kiran R. <tec...@gm...> - 2013-01-16 14:52:54
|
I have an XML format that looks like this:
<devices>
<device id="10">
<name>Nexus 7</name>
<os>Android</os>
</device>
<device id="20">
<name>Samsung Galaxy S3</name>
<os>Android</os>
</device>
<device id="30">
<name>Apple iPad3</name>
<os>iOS</os>
</device>
</devices>
Currently, I am treating this as an ElementList as follows:
@Root(name="devices")
class Devices{
@ElementList(inline="true")
List<Device> devices;
// ... Constructors, getters, setters
}
@Root(name="device")
class Device{
@Attribute(name="id")
long id;
@Element(name="name")
String name;
@Element(name="os")
String os;
//... Constructors, getters, setters
}
So far, so good. I have been parsing this as an ArrayList. However, *I
almost always want to access a device by ID*, not by its position. So, I
thought, I'd instead parse this as a Map, not a List. I can map a device ID
to the device object itself.
I tried to use ElementMap annotation, but I can't seem to get it right.
Here's what I've tried:
@Root(name="devices")
public class DeviceMap {
@ElementMap(entry="device", key="id", attribute = true, inline = true)
private Map<Long, Device> map;
public Map<Long, Device> getMap(){
return this.map;
}
}
@Root(name = "device")
public class Device {
@Element(name="os")
String os;
@Element(name="name")
String name;
//... Constructors, getters, setters}
}
However, this fails with a ValueRequiredException:
org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy
@org.simpleframework.xml.Element(name=OS, data=false, required=true,
type=void) on field 'os' java.lang.String
*Note that the value of the Map in my case turns out to be neither a
primitive, nor an object - it is a bunch of what would have been inline
elements.
*
Any pointers on how to proceed with this?
--
Regards,
=======
Kiran Rao
http://curioustechizen.blogspot.com/
http://stackoverflow.com/users/570930/curioustechizen
|
|
From: Jaewoo L. <dl...@gm...> - 2013-01-16 10:01:46
|
> I installed Java Platform (JDK) 7u11. And in classpath, there are
> stax-1.2.0, too.
> SOURCE LIST means iterator or linked-list of node.getSource().
>
> The following is my Converter code.
>
> public class SXCMTSConverter implements Converter<SXCMTS>{
>
> @Override
> public SXCMTS read(InputNode node) throws Exception {
> Object obj = node.getSource();
> Element element = (Element)obj; <-- HERE
> ClassCastException occured.
>
> return new SXCMTS();
> }
>
> @Override
> public void write(OutputNode node, SXCMTS arg1) throws Exception {
> }
> }
>
>
> Error Message :
> java.lang.ClassCastException:
> com.sun.xml.internal.stream.events.StartElementEvent cannot be cast to
> org.w3c.dom.Element
>
>
> Am I missing something? or Is there any way to solve this problem?
> Thank you for your help, Niall.
>
>
>
> 2013/1/11 Niall Gallagher <gal...@ya...>
>
>> What is a SOURCE LIST? node.getSource() will product the underlying
>> object, if you are using a JDK 1.6 or above this will be StAX its only DOM
>> by default for 1.5 if you do not have StAX on the classpath. You can force
>> the provider to DOM if you like. To do this take a closer look at the
>> HackJob test case.
>>
>> Thanks,
>> Niall
>>
>> --- On Fri, 11/1/13, Jaewoo Lee <dl...@gm...> wrote:
>>
>> > From: Jaewoo Lee <dl...@gm...>
>> > Subject: [Simple-support] Object obj = node.getSource() ?
>> > To: sim...@li...
>> > Received: Friday, 11 January, 2013, 1:54 AM
>> > Hi, Niall.
>> > During using Converter,
>> > I wanna make a SOURCE LIST of
>> > InputNode
>> > So I am referencing
>> > "HackJobToGrabFloatingTextTest.java".
>> >
>> > It's my code that I
>> > imitate HackJobToGrabFloatingTextTest.
>> > import
>> > org.simpleframework.xml.convert.Converter;import
>> > org.simpleframework.xml.stream.InputNode;
>> > import
>> > org.simpleframework.xml.stream.OutputNode;import
>> > org.w3c.dom.Element;
>> > public class SXCMTSConverter implements
>> > Converter<SXCMTS>{
>> > @Override
>> > public SXCMTS
>> > read(InputNode node) throws Exception
>> > { Object obj =
>> > node.getSource(); Element
>> > element = (Element)obj;
>> > .....
>> > } .....}
>> > but Exception popped.
>> > java.lang.ClassCastException:
>> > com.sun.xml.internal.stream.events.StartElementEvent cannot
>> > be cast to org.w3c.dom.Element
>> >
>> > Is that code something wrong ? Or
>> > wrong version of library? If wrong version, could you let me
>> > know right version of that Library?Or How do I
>> > make a list of Source List of Input Node?
>> >
>> > Thanks for your help.
>> >
>> > -----Inline Attachment Follows-----
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
>> > and
>> > much more. Get web development skills now with LearnDevNow
>> > -
>> > 350+ hours of step-by-step video tutorials by Microsoft MVPs
>> > and experts.
>> > SALE $99.99 this month only -- learn more at:
>> > http://p.sf.net/sfu/learnmore_122812
>> > -----Inline Attachment Follows-----
>> >
>> > _______________________________________________
>> > Simple-support mailing list
>> > Sim...@li...
>> > https://lists.sourceforge.net/lists/listinfo/simple-support
>> >
>>
>
>
|
|
From: Jaewoo L. <dl...@gm...> - 2013-01-15 09:56:44
|
Hi, Niall.
I am doing Read/Write XML job during simple framework.
My purpose is re-write XML output as same as input.
But, happened problem about NULL ELEMENT.
For example,
Input like
<person>
<id></id>
</person>
came correct.
But,
<person>
<id/>
</person>
occured error.
Simple Framework does NOT allow grammar rule like <element/> ?
Thank you for your help always... T^T
|
|
From: Jaewoo L. <dl...@gm...> - 2013-01-14 05:17:18
|
I sent a mail attached my project, but the mail wasn't uploaded on
simple-support mailing lists.
So I re-send my e-mail with no attachment.
If you don't receive my project code, please let me know.
Thank you for your help.
---------- Forwarded message ----------
From: Jaewoo Lee <dl...@gm...>
Date: 2013/1/14
Subject: Re: [Simple-support] same data-typed ElementList in
ElementListUnion
To: Niall Gallagher <gal...@ya...>
Hi, Niall.
I attached my code for demonstarating error of ElementListUnion.
I'll brief some about my code.
This project is Read/Write XML Document with using Simple Framework.
Main method is "\src\com\simpletest\test\SimpleMain.java".
and "src\com\simpletest\test\ReadExample.java" is the class operating the
project.
I wanted to implement "ANY" type.
Then, according to your advice, I made new datat-type, "ANYFORALL". It
included all of variables(element, attribute) of all sub-class as
ElementListUnion.
The attached code is miniature of my project.
\src\com\simpletest\something\Task.java is Root Element class.
@Root
public class Task {
@ElementListUnion({
@ElementList(name = "low", entry = "low", inline = true, required =
false, type = HEIGHT.class),
@ElementList(name = "high", entry = "high", inline = true, required =
false, type = HEIGHT.class),
@ElementList(name = "width", entry = "width", inline = true, required =
false, type = AREA.class),
@ElementList(name = "center", entry = "center", inline = true, required =
false, type = AREA.class)
})
private List<Operation> operations;
}
HEIGHT.java and AREA.java included Attrivutes(String value, String unit) as
same.
Could you compare that documents(input.xml, output.xml) with any compare
tool?
-------------------------------------------------------------------------------------
input.xml
<task name="setup">
<low value="4.3" unit="10+3/ul" />
<high value="10.8" unit="10+3/ul" />
<width value="4.3" unit="10+3/ul" />
<center value="10.8" unit="10+3/ul" />
</task>
------------------------------------------------------------------------------
output.xml
<task>
<low value="4.3" unit="10+3/ul"/>
<low value="10.8" unit="10+3/ul"/>
<width value="4.3" unit="10+3/ul"/>
<width value="10.8" unit="10+3/ul"/>
</task>
------------------------------------------------------------------
Then... Take a look and give me some help plz.
Thank you so much for your help.
2013/1/11 Niall Gallagher <gal...@ya...>
> Can you provide a unit test that demonstrates this? If you can show it
> really is an error via a JUnit test then ill fix it straight away.
>
> Thanks,
> Niall
>
> --- On Fri, 11/1/13, Jaewoo Lee <dl...@gm...> wrote:
>
> > From: Jaewoo Lee <dl...@gm...>
> > Subject: [Simple-support] same data-typed ElementList in ElementListUnion
> > To: sim...@li...
> > Received: Friday, 11 January, 2013, 1:36 AM
> > Hi, Niall.
> > I am defining ElementListUnion like
> > below.
> > @ElementListUnion({
> > @ElementList(name = "low", entry =
> > "low", inline = true, required = false, type =
> > IVXBPQ.class),
> > @ElementList(name =
> > "high", entry = "high", inline = true,
> > required = false, type = IVXBPQ.class), @ElementList(name =
> > "width", entry = "width", inline =
> > true, required = false, type = PQ.class),
> > @ElementList(name =
> > "center", entry = "center", inline =
> > true, required = false, type =
> > PQ.class)}
> >
> > and, I inputed sample code like below.
> > <low name = ""
> > /><high name = ""
> > />
> > but output came like below
> >
> > <low name = ""/><low name =
> > ""/>
> > ------------------------------------------------------------
> > In ElementListUnion, Couldn't I define same
> > data-typed ElementList? or is it bug?
> > Thanks for your help.
> >
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
> > and
> > much more. Get web development skills now with LearnDevNow
> > -
> > 350+ hours of step-by-step video tutorials by Microsoft MVPs
> > and experts.
> > SALE $99.99 this month only -- learn more at:
> > http://p.sf.net/sfu/learnmore_122812
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >
>
|
|
From: Niall G. <gal...@ya...> - 2013-01-11 11:36:48
|
What is a SOURCE LIST? node.getSource() will product the underlying object, if you are using a JDK 1.6 or above this will be StAX its only DOM by default for 1.5 if you do not have StAX on the classpath. You can force the provider to DOM if you like. To do this take a closer look at the HackJob test case.
Thanks,
Niall
--- On Fri, 11/1/13, Jaewoo Lee <dl...@gm...> wrote:
> From: Jaewoo Lee <dl...@gm...>
> Subject: [Simple-support] Object obj = node.getSource() ?
> To: sim...@li...
> Received: Friday, 11 January, 2013, 1:54 AM
> Hi, Niall.
> During using Converter,
> I wanna make a SOURCE LIST of
> InputNode
> So I am referencing
> "HackJobToGrabFloatingTextTest.java".
>
> It's my code that I
> imitate HackJobToGrabFloatingTextTest.
> import
> org.simpleframework.xml.convert.Converter;import
> org.simpleframework.xml.stream.InputNode;
> import
> org.simpleframework.xml.stream.OutputNode;import
> org.w3c.dom.Element;
> public class SXCMTSConverter implements
> Converter<SXCMTS>{
> @Override
> public SXCMTS
> read(InputNode node) throws Exception
> { Object obj =
> node.getSource(); Element
> element = (Element)obj;
> .....
> } .....}
> but Exception popped.
> java.lang.ClassCastException:
> com.sun.xml.internal.stream.events.StartElementEvent cannot
> be cast to org.w3c.dom.Element
>
> Is that code something wrong ? Or
> wrong version of library? If wrong version, could you let me
> know right version of that Library?Or How do I
> make a list of Source List of Input Node?
>
> Thanks for your help.
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
> and
> much more. Get web development skills now with LearnDevNow
> -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs
> and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|
|
From: Niall G. <gal...@ya...> - 2013-01-11 11:34:19
|
Can you provide a unit test that demonstrates this? If you can show it really is an error via a JUnit test then ill fix it straight away.
Thanks,
Niall
--- On Fri, 11/1/13, Jaewoo Lee <dl...@gm...> wrote:
> From: Jaewoo Lee <dl...@gm...>
> Subject: [Simple-support] same data-typed ElementList in ElementListUnion
> To: sim...@li...
> Received: Friday, 11 January, 2013, 1:36 AM
> Hi, Niall.
> I am defining ElementListUnion like
> below.
> @ElementListUnion({
> @ElementList(name = "low", entry =
> "low", inline = true, required = false, type =
> IVXBPQ.class),
> @ElementList(name =
> "high", entry = "high", inline = true,
> required = false, type = IVXBPQ.class), @ElementList(name =
> "width", entry = "width", inline =
> true, required = false, type = PQ.class),
> @ElementList(name =
> "center", entry = "center", inline =
> true, required = false, type =
> PQ.class)}
>
> and, I inputed sample code like below.
> <low name = ""
> /><high name = ""
> />
> but output came like below
>
> <low name = ""/><low name =
> ""/>
> ------------------------------------------------------------
> In ElementListUnion, Couldn't I define same
> data-typed ElementList? or is it bug?
> Thanks for your help.
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
> and
> much more. Get web development skills now with LearnDevNow
> -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs
> and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|
|
From: Jaewoo L. <dl...@gm...> - 2013-01-11 09:54:58
|
Hi, Niall.
During using Converter,
I wanna make a SOURCE LIST of InputNode
So I am referencing "HackJobToGrabFloatingTextTest.java".
It's my code that I imitate HackJobToGrabFloatingTextTest.
import org.simpleframework.xml.convert.Converter;
import org.simpleframework.xml.stream.InputNode;
import org.simpleframework.xml.stream.OutputNode;
import org.w3c.dom.Element;
public class SXCMTSConverter implements Converter<SXCMTS>{
@Override
public SXCMTS read(InputNode node) throws Exception {
Object obj = node.getSource();
Element element = (Element)obj;
.....
}
.....
}
but Exception popped.
java.lang.ClassCastException:
com.sun.xml.internal.stream.events.StartElementEvent cannot be cast to
org.w3c.dom.Element
Is that code something wrong ?
Or wrong version of library? If wrong version, could you let me know right
version of that Library?
Or How do I make a list of Source List of Input Node?
Thanks for your help.
|
|
From: Jaewoo L. <dl...@gm...> - 2013-01-11 09:36:58
|
Hi, Niall.
I am defining ElementListUnion like below.
@ElementListUnion({
@ElementList(name = "low", entry = "low", inline = true,
required = false, type = IVXBPQ.class),
@ElementList(name = "high", entry = "high", inline = true, required =
false, type = IVXBPQ.class),
@ElementList(name = "width", entry = "width", inline = true, required =
false, type = PQ.class),
@ElementList(name = "center", entry = "center", inline = true, required =
false, type = PQ.class)
}
and, I inputed sample code like below.
<low name = "" />
<high name = "" />
but output came like below
<low name = ""/>
<low name = ""/>
------------------------------------------------------------
In ElementListUnion, Couldn't I define same data-typed ElementList? or is
it bug?
Thanks for your help.
|
|
From: Niall G. - Y. <Nia...@yi...> - 2013-01-07 22:21:54
|
I am not sure what you are trying to do here. You can use the annotations to product any XML you like..
From: daniel echalar [mailto:da...@gm...]
Sent: Tuesday, 8 January 2013 6:21 AM
To: sim...@li...
Subject: [Simple-support] How to abbreviate lists of objects
Hi,
My business model is getting big, and the XML produced by simple is very large, for example, when I get a list of objects. I wondering if there is a way to get the list of objects with less elements, I mean, avoid the associations of the objects) and just get the primitive values, in order to get an small list.
Ex: //psedo definition
Person{
String name;
Person[] friends;
}
//generated xml:
<List>
<person name="Bill">
<person name="Hillary">
<person name="Kate">
</List>
Then, get the list of all persons, but every person comes only with the name.
And obtain the whole object (with associations )when I need an specific object.
<person name="Bill">
<friends>
<person name="Hillary">
.
.
<person name="N">
</friends>
</person>
Thanks in advance.
|
|
From: daniel e. <da...@gm...> - 2013-01-07 19:22:01
|
Hi,
My business model is getting big, and the XML produced by simple is very
large, for example, when I get a list of objects. I wondering if there is a
way to get the list of objects with less elements, I mean, avoid the
associations of the objects) and just get the primitive values, in order to
get an small list.
Ex: //psedo definition
Person{
String name;
Person[] friends;
}
//generated xml:
<List>
<person name="Bill">
<person name="Hillary">
<person name="Kate">
</List>
Then, get the list of all persons, but every person comes only with the
name.
And obtain the whole object (with associations )when I need an specific
object.
<person name="Bill">
<friends>
<person name="Hillary">
.
.
<person name="N">
</friends>
</person>
Thanks in advance.
|
|
From: Kiran R. <tec...@gm...> - 2013-01-03 07:13:28
|
Great! Thanks for the clarification.
On Thu, Jan 3, 2013 at 12:16 PM, Niall Gallagher - Yieldbroker <
Nia...@yi...> wrote:
> Yes, it will work in this scenario****
>
> ** **
>
> *From:* Kiran Rao [mailto:tec...@gm...]
> *Sent:* Thursday, 3 January 2013 5:19 PM
> *To:* simple-support
> *Subject:* [Simple-support] What does the Thread-safety guarantee of
> Persister mean?****
>
> ** **
>
> The docs for Persister have this to say:****
>
> It is fully thread safe and can be shared by multiple threads without
> concerns****
>
>
> What does this mean? If multiple threads share an instance of Persister,
> and
> read operations are interleaved with write operations, will Persisterstill "do
> the right thing"?
>
> To illustrate, consider the following code:
>
> public class LogicClass{
>
> private final Serializer serializer = new Persister();
>
> public User parse(String aString){
> return serializer.read(User.class, aString);
> //Exception handling ommitted for brevity.
> }
>
> public String frame(Account account){
> StringWriter writer = new StringWriter();
> serializer.write(account, writer);
> //Exception handling ommitted for brevity.
> return writer.toString();
> }
> }
>
> Imagine LogicClass is a singleton (with lower-case 's') shared by
> multiple
> threads. Now it is possible that one thread is parsing User at the same
> time that
> another is serializing Account. Since LogicClass is a singleton, there
> is also
> only a single instance of Persister.
>
> How is Persister intended to behave in such circumstances?
> ****
>
>
> --
> Regards,
> =======
> Kiran Rao
> http://curioustechizen.blogspot.com/
> http://stackoverflow.com/users/570930/curioustechizen****
>
--
Regards,
=======
Kiran Rao
http://curioustechizen.blogspot.com/
http://stackoverflow.com/users/570930/curioustechizen
|
|
From: Niall G. - Y. <Nia...@yi...> - 2013-01-03 06:46:16
|
Yes, it will work in this scenario
From: Kiran Rao [mailto:tec...@gm...]
Sent: Thursday, 3 January 2013 5:19 PM
To: simple-support
Subject: [Simple-support] What does the Thread-safety guarantee of Persister mean?
The docs for Persister have this to say:
It is fully thread safe and can be shared by multiple threads without concerns
What does this mean? If multiple threads share an instance of Persister, and
read operations are interleaved with write operations, will Persister still "do
the right thing"?
To illustrate, consider the following code:
public class LogicClass{
private final Serializer serializer = new Persister();
public User parse(String aString){
return serializer.read(User.class, aString);
//Exception handling ommitted for brevity.
}
public String frame(Account account){
StringWriter writer = new StringWriter();
serializer.write(account, writer);
//Exception handling ommitted for brevity.
return writer.toString();
}
}
Imagine LogicClass is a singleton (with lower-case 's') shared by multiple
threads. Now it is possible that one thread is parsing User at the same time that
another is serializing Account. Since LogicClass is a singleton, there is also
only a single instance of Persister.
How is Persister intended to behave in such circumstances?
--
Regards,
=======
Kiran Rao
http://curioustechizen.blogspot.com/
http://stackoverflow.com/users/570930/curioustechizen
|
|
From: Kiran R. <tec...@gm...> - 2013-01-03 06:19:09
|
The docs for Persister have this to say:
It is fully thread safe and can be shared by multiple threads without
> concerns
>
What does this mean? If multiple threads share an instance of Persister,
and
read operations are interleaved with write operations, will Persister still
"do
the right thing"?
To illustrate, consider the following code:
public class LogicClass{
private final Serializer serializer = new Persister();
public User parse(String aString){
return serializer.read(User.class, aString);
//Exception handling ommitted for brevity.
}
public String frame(Account account){
StringWriter writer = new StringWriter();
serializer.write(account, writer);
//Exception handling ommitted for brevity.
return writer.toString();
}
}
Imagine LogicClass is a singleton (with lower-case 's') shared by multiple
threads. Now it is possible that one thread is parsing User at the same
time that
another is serializing Account. Since LogicClass is a singleton, there is
also
only a single instance of Persister.
How is Persister intended to behave in such circumstances?
--
Regards,
=======
Kiran Rao
http://curioustechizen.blogspot.com/
http://stackoverflow.com/users/570930/curioustechizen
|
|
From: Jaewoo L. <dl...@gm...> - 2013-01-03 05:36:51
|
Hi, Niall.
I would ask about something about Converting XML to Simple Framework.
this is target XML code.
....
<value xsi:type="PQ" value="88" unit="kg" />
....
I guess that "xsi:type" is Attribute named "type".
So I defined the attribute like this code.
.....
@Attribute(name = "type", required = false)
protected String type;
....
And then, I succeed Read/Write from target XML code.
...
<value type = "PQ "value="88" unit="kg"/>
....
But, I couldn't attach "xsi:" before "type" attribute.
I knew that "@Namespace" annotation has a optional choice "prefix" to solve
this case.
Is there any way to attach string("xsi:)" to attribute like "prefix" option?
|
|
From: Dody G. <emp...@gm...> - 2012-12-30 14:26:36
|
Actually using @Path doesn't work. Sigh.
On Sun, Dec 30, 2012 at 3:45 PM, Dody Gunawinata <emp...@gm...>wrote:
> Unfortunately I cannot figure out how to deal with InputNode so I have to
> resort to @Path
>
>
> @Element(required = false, name = "link")
> @Path("channel/link")
> public String link;
>
> which works.
>
> The problem though with this solution is that RSS/ATOM feeds are full of
> extensions via namespaces and right now the current behavior of @Element
> simply makes parsing Rss/Atom feed with SimpleXML problematic. Any RSS/ATOM
> extension that duplicates on the default namespace single element will
> break the parsing.
>
>
>
> On Wed, Dec 26, 2012 at 11:39 AM, Niall Gallagher <
> gal...@ya...> wrote:
>
>> There is a way, however it involves the lower level stream XML API. You
>> would need to wrap the InputNode with something of your own to filter out
>> these things. See org.simpleframework.xml.stream.InputNode.
>>
>> --- On Mon, 24/12/12, Dody Gunawinata <emp...@gm...> wrote:
>>
>> > From: Dody Gunawinata <emp...@gm...>
>> > Subject: [Simple-support] Duplicate element error
>> > To: sim...@li...
>> > Received: Monday, 24 December, 2012, 6:33 AM
>> > I encounter the same exact
>> > problem as this posting
>> http://stackoverflow.com/questions/5973028/simple-xml-element-declared-twice-error
>> >
>> >
>> > public class Channel {
>> > @Element(required = false, name =
>> > "link") @Namespace
>> > public String link; }
>> >
>> > will generate
>> > Element 'link' is already used
>> > with @org.simpleframework.xml.Element(data=false, name=link,
>> > required=false, type=void) on field 'link'
>> >
>> >
>> > if it encounters
>> > <link> and<atom:link>.
>> > I don't care about the atom:link. Is
>> > there anyway to scope the link property to just care about
>> > the default namespace?
>> >
>> >
>> > --
>> > nomadlife.org
>> >
>> >
>> >
>> > -----Inline Attachment Follows-----
>> >
>> >
>> ------------------------------------------------------------------------------
>> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
>> > Free Trial
>> > Remotely access PCs and mobile devices and provide instant
>> > support
>> > Improve your efficiency, and focus on delivering more
>> > value-add services
>> > Discover what IT Professionals Know. Rescue delivers
>> > http://p.sf.net/sfu/logmein_12329d2d
>> > -----Inline Attachment Follows-----
>> >
>> > _______________________________________________
>> > Simple-support mailing list
>> > Sim...@li...
>> > https://lists.sourceforge.net/lists/listinfo/simple-support
>> >
>>
>
>
>
> --
> nomadlife.org
>
--
nomadlife.org
|
|
From: Dody G. <emp...@gm...> - 2012-12-30 13:45:41
|
Unfortunately I cannot figure out how to deal with InputNode so I have to
resort to @Path
@Element(required = false, name = "link")
@Path("channel/link")
public String link;
which works.
The problem though with this solution is that RSS/ATOM feeds are full of
extensions via namespaces and right now the current behavior of @Element
simply makes parsing Rss/Atom feed with SimpleXML problematic. Any RSS/ATOM
extension that duplicates on the default namespace single element will
break the parsing.
On Wed, Dec 26, 2012 at 11:39 AM, Niall Gallagher <gal...@ya...
> wrote:
> There is a way, however it involves the lower level stream XML API. You
> would need to wrap the InputNode with something of your own to filter out
> these things. See org.simpleframework.xml.stream.InputNode.
>
> --- On Mon, 24/12/12, Dody Gunawinata <emp...@gm...> wrote:
>
> > From: Dody Gunawinata <emp...@gm...>
> > Subject: [Simple-support] Duplicate element error
> > To: sim...@li...
> > Received: Monday, 24 December, 2012, 6:33 AM
> > I encounter the same exact
> > problem as this posting
> http://stackoverflow.com/questions/5973028/simple-xml-element-declared-twice-error
> >
> >
> > public class Channel {
> > @Element(required = false, name =
> > "link") @Namespace
> > public String link; }
> >
> > will generate
> > Element 'link' is already used
> > with @org.simpleframework.xml.Element(data=false, name=link,
> > required=false, type=void) on field 'link'
> >
> >
> > if it encounters
> > <link> and<atom:link>.
> > I don't care about the atom:link. Is
> > there anyway to scope the link property to just care about
> > the default namespace?
> >
> >
> > --
> > nomadlife.org
> >
> >
> >
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
> > Free Trial
> > Remotely access PCs and mobile devices and provide instant
> > support
> > Improve your efficiency, and focus on delivering more
> > value-add services
> > Discover what IT Professionals Know. Rescue delivers
> > http://p.sf.net/sfu/logmein_12329d2d
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >
>
--
nomadlife.org
|
|
From: Niall G. <gal...@ya...> - 2012-12-27 09:05:12
|
I will check this out, perhaps this is a bug?
--- On Wed, 26/12/12, Jaewoo Lee <dl...@gm...> wrote:
From: Jaewoo Lee <dl...@gm...>
Subject: [Simple-support] Fwd: about Element OR Text
To: sim...@li...
Received: Wednesday, 26 December, 2012, 8:33 PM
I would correct something about following output code in my previous question .
<tr> <td> <content/>Resuscitation status</td>
<td> <content ID="AD1">Do not resuscitate</content> </td> <td> <content/>Dr. Robert Dolin, Nov 07, 1999</td>
<td> <linkHtml href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance directive</linkHtml> </td></tr>
bold <content> elements are EMPTY elements.Why are they included in <td> element?
---------- Forwarded message ----------
From: Jaewoo Lee <dl...@gm...>
Date: 2012/12/27
Subject: Re: about Element OR Text
To: sim...@li...
Thank you for your answer. I have more question.I did version up to 2.6.9
and I used @ElementListUnion with @Text annotation. but found something wrong.
following code is target source
<tr> <td>Resuscitation status</td> <td> <content ID="AD1">Do not resuscitate</content>
</td> <td>Dr. Robert Dolin, Nov 07, 1999</td> <td> <linkHtml href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance directive</linkHtml>
</td></tr>
as I told you, I need a <td> class type defined between sub element OR text.So I defined <td> class like this.
@Rootpublic class StrucDocTd { @Text @ElementListUnion({ @ElementList(entry = "content", inline = true, required = false, type = StrucDocContent.class),
@ElementList(entry = "linkHtml", inline = true, required = false, type = StrucDocLinkHtml.class) }) protected List<Object> v;
}
but, output is something wrong.
<tr> <td> <content/>Resuscitation status</td>
<td>
<content ID="AD1">Do not resuscitate</content> </td> <td> <content/>Dr. Robert Dolin, Nov 07, 1999</td>
<td> <linkHtml href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance directive</linkHtml> </td></tr>
text codes was inserted in sub-element(content). Could you let me know whether I coded wrong or not?and Does "normal annotation" that you said mean my annotation?
Thank you for your help.
2012/12/27 Niall Gallagher <gal...@ya...>
I don't think you need either to parse the XML in your mail. Parsing with normal annotations will work. Also as of 2.6.9 there is in build ability to grab floating text in the InputNode, so you don't need the hack job.
--- On Wed, 26/12/12, Jaewoo Lee <dl...@gm...> wrote:
> From: Jaewoo Lee <dl...@gm...>
> Subject: [Simple-support] about Element OR Text
> To: sim...@li...
> Received: Wednesday, 26 December, 2012, 12:51 AM
> Hi, I'm converting from
> javax to simple framework.I have a question
> about that.
> this is original xml source.
> ....
>
> <tr>
> <td>Resuscitation status</td>
> <td>
> <content ID="AD1">Do not
> resuscitate</content>
> </td>
> <td>Dr. Robert Dolin, Nov 07,
> 1999</td>
> <td>
> <linkHtml
> href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
> directive</linkHtml>
> </td>
>
> </tr>....
> I saw the example
> "HackJobToGrabFloatingTextTest", but I am not sure
> whether I have to implement like that example.
> cuz I only need ONE node between element OR
> text.
> Q1. Should I use Converter class
> in this case?
> Q2. If i should use converter
> class like "HackJobToGrabFloatingTextTest", is it
> possible to implement like original code?
> and if yes, could you explain in more
> details?
> Thank you so much for your
> help.
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
> Free Trial
> Remotely access PCs and mobile devices and provide instant
> support
> Improve your efficiency, and focus on delivering more
> value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Jaewoo L. <dl...@gm...> - 2012-12-27 04:33:55
|
I would correct something about following output code in my previous
question .
<tr>
<td>
*<content/>*Resuscitation status</td>
<td>
<content ID="AD1">Do not resuscitate</content>
</td>
<td>
*<content/>*Dr. Robert Dolin, Nov 07, 1999</td>
<td>
<linkHtml
href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
directive</linkHtml>
</td>
</tr>
bold <content> elements are EMPTY elements.
Why are they included in <td> element?
---------- Forwarded message ----------
From: Jaewoo Lee <dl...@gm...>
Date: 2012/12/27
Subject: Re: about Element OR Text
To: sim...@li...
Thank you for your answer.
I have more question.
I did version up to 2.6.9
and I used @ElementListUnion with @Text annotation. but found something
wrong.
following code is target source
<tr>
<td>Resuscitation status</td>
<td>
<content ID="AD1">Do not resuscitate</content>
</td>
<td>Dr. Robert Dolin, Nov 07, 1999</td>
<td>
<linkHtml
href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
directive</linkHtml>
</td>
</tr>
as I told you, I need a <td> class type defined between sub element OR text.
So I defined <td> class like this.
@Root
public class StrucDocTd
{
@Text
@ElementListUnion({
@ElementList(entry = "content", inline = true, required = false, type
= StrucDocContent.class),
@ElementList(entry = "linkHtml", inline = true, required = false, type
= StrucDocLinkHtml.class)
})
protected List<Object> v;
}
but, output is something wrong.
<tr>
<td>
<content/>Resuscitation status</td>
<td>
<content ID="AD1">Do not resuscitate</content>
</td>
<td>
<content/>Dr. Robert Dolin, Nov 07, 1999</td>
<td>
<linkHtml
href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
directive</linkHtml>
</td>
</tr>
text codes was inserted in sub-element(content).
Could you let me know whether I coded wrong or not?
and Does "normal annotation" that you said mean my annotation?
Thank you for your help.
2012/12/27 Niall Gallagher <gal...@ya...>
> I don't think you need either to parse the XML in your mail. Parsing with
> normal annotations will work. Also as of 2.6.9 there is in build ability to
> grab floating text in the InputNode, so you don't need the hack job.
>
>
> --- On Wed, 26/12/12, Jaewoo Lee <dl...@gm...> wrote:
>
> > From: Jaewoo Lee <dl...@gm...>
> > Subject: [Simple-support] about Element OR Text
> > To: sim...@li...
> > Received: Wednesday, 26 December, 2012, 12:51 AM
> > Hi, I'm converting from
> > javax to simple framework.I have a question
> > about that.
> > this is original xml source.
> > ....
> >
> > <tr>
> > <td>Resuscitation status</td>
> > <td>
> > <content ID="AD1">Do not
> > resuscitate</content>
> > </td>
> > <td>Dr. Robert Dolin, Nov 07,
> > 1999</td>
> > <td>
> > <linkHtml
> > href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
> > directive</linkHtml>
> > </td>
> >
> > </tr>....
> > I saw the example
> > "HackJobToGrabFloatingTextTest", but I am not sure
> > whether I have to implement like that example.
> > cuz I only need ONE node between element OR
> > text.
> > Q1. Should I use Converter class
> > in this case?
> > Q2. If i should use converter
> > class like "HackJobToGrabFloatingTextTest", is it
> > possible to implement like original code?
> > and if yes, could you explain in more
> > details?
> > Thank you so much for your
> > help.
> >
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
> > Free Trial
> > Remotely access PCs and mobile devices and provide instant
> > support
> > Improve your efficiency, and focus on delivering more
> > value-add services
> > Discover what IT Professionals Know. Rescue delivers
> > http://p.sf.net/sfu/logmein_12329d2d
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >
>
|
|
From: Jaewoo L. <dl...@gm...> - 2012-12-27 02:33:27
|
Thank you for your answer.
I have more question.
I did version up to 2.6.9
and I used @ElementListUnion with @Text annotation. but found something
wrong.
following code is target source
<tr>
<td>Resuscitation status</td>
<td>
<content ID="AD1">Do not resuscitate</content>
</td>
<td>Dr. Robert Dolin, Nov 07, 1999</td>
<td>
<linkHtml
href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
directive</linkHtml>
</td>
</tr>
as I told you, I need a <td> class type defined between sub element OR text.
So I defined <td> class like this.
@Root
public class StrucDocTd
{
@Text
@ElementListUnion({
@ElementList(entry = "content", inline = true, required = false, type
= StrucDocContent.class),
@ElementList(entry = "linkHtml", inline = true, required = false, type
= StrucDocLinkHtml.class)
})
protected List<Object> v;
}
but, output is something wrong.
<tr>
<td>
<content/>Resuscitation status</td>
<td>
<content ID="AD1">Do not resuscitate</content>
</td>
<td>
<content/>Dr. Robert Dolin, Nov 07, 1999</td>
<td>
<linkHtml
href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
directive</linkHtml>
</td>
</tr>
text codes was inserted in sub-element(content).
Could you let me know whether I coded wrong or not?
and Does "normal annotation" that you said mean my annotation?
Thank you for your help.
2012/12/27 Niall Gallagher <gal...@ya...>
> I don't think you need either to parse the XML in your mail. Parsing with
> normal annotations will work. Also as of 2.6.9 there is in build ability to
> grab floating text in the InputNode, so you don't need the hack job.
>
>
> --- On Wed, 26/12/12, Jaewoo Lee <dl...@gm...> wrote:
>
> > From: Jaewoo Lee <dl...@gm...>
> > Subject: [Simple-support] about Element OR Text
> > To: sim...@li...
> > Received: Wednesday, 26 December, 2012, 12:51 AM
> > Hi, I'm converting from
> > javax to simple framework.I have a question
> > about that.
> > this is original xml source.
> > ....
> >
> > <tr>
> > <td>Resuscitation status</td>
> > <td>
> > <content ID="AD1">Do not
> > resuscitate</content>
> > </td>
> > <td>Dr. Robert Dolin, Nov 07,
> > 1999</td>
> > <td>
> > <linkHtml
> > href="AdvanceDirective.b50b7910-7ffb-4f4c-bbe4-177ed68cbbf3.pdf">Advance
> > directive</linkHtml>
> > </td>
> >
> > </tr>....
> > I saw the example
> > "HackJobToGrabFloatingTextTest", but I am not sure
> > whether I have to implement like that example.
> > cuz I only need ONE node between element OR
> > text.
> > Q1. Should I use Converter class
> > in this case?
> > Q2. If i should use converter
> > class like "HackJobToGrabFloatingTextTest", is it
> > possible to implement like original code?
> > and if yes, could you explain in more
> > details?
> > Thank you so much for your
> > help.
> >
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
> > Free Trial
> > Remotely access PCs and mobile devices and provide instant
> > support
> > Improve your efficiency, and focus on delivering more
> > value-add services
> > Discover what IT Professionals Know. Rescue delivers
> > http://p.sf.net/sfu/logmein_12329d2d
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >
>
|