Re: [Simple-support] Element with both attributes and text body?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2007-03-29 20:09:58
|
Hi Arne,
Well this is something I was considering, however this comes down to a
serialization versus deserialization issue. It would be simple to
deserialize such a structure. For instance:
@Root(name="myelement")
public class MyObject {
@Attribute(name="someAttribute")
private String someAttribute;
private String text;
public MyObject(String text) {
this.text = text;
}
}
The difficulty is in serialization, how could the decision be made to
serialize? I guess an additional annotation or interface telling the
framework what action to take could be done? Currently though I have
decided not to add support for this, at least until I can think of a
decent way to implement it.
Suggestions are welcome on how to approach this.
Niall
----- Original Message ----
From: Arne Claassen <arn...@cl...>
To: sim...@li...
Sent: Wednesday, March 28, 2007 8:34:48 AM
Subject: [Simple-support] Element with both attributes and text body?
I just found Simple today. Excellent work on the project. Nice, simple,
small. I usually work in C#, so Simple's syntax is very comfortable to
me compared to .NET's attribute driven mark-up.
Of course, I've already hit a stumbling block. Is there a way to define
a class that has both Attributes and body text for an Element? I.e. I'm
trying to create a class to represent:
<?xml version="1.0" encoding="UTF-8"?>
<message guid="ABDB9C3E-31B5-09B5-6E0F-5BC5F86BF5C7" type="default"
utime="1175098850078">
payload
</message>
The closest I've figured out is:
<?xml version="1.0" encoding="UTF-8"?>
<message guid="ABDB9C3E-31B5-09B5-6E0F-5BC5F86BF5C7" type="default"
utime="1175098850078">
<data>payload</data>
</message>
thanks,
arne
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
____________________________________________________________________________________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
|