Re: [Simple-support] xs:any with depth elements
Brought to you by:
niallg
|
From: Eunkyoung L. <ek...@st...> - 2012-08-09 15:15:59
|
Thank you for your answer.
I have one more question with serialization (opposite case).
If my module gets some xml snippet with element from other module , how can I serialize whole xml file with this text.
My module doesn’t know the schema of this xml snippet because this is application specific.
If I use String (@Text) for it, I can’t avoid validate exemption – Text has element - and escape.
If I use converter, can I avoid validate exemption ?
And how can I avoid escape() in writing ? writeText will do escape() for “<” and “>”
Example
@Root(name = "app-specific", strict=false)
public class AppSpecific {
@Text
protected String xmlText;
public void setAny(String text) {
this.xmlText = text;
}
}
AppSpecific test = new AppSpecific();
test.setAny("<Thresholds><Threshold><TypeId>57664</TypeId><Min> 100 </Min><Max> 50 </Max><Units>%</Units></Threshold></Thresholds>");
Aina Eunkyoung Lee
Samsung Telecommunications America
1301 E. Lookout Dr.
Richardson, TX 75082
Telephone : 972-761-7792
ek...@st...<mailto:mr...@st...>
From: Niall Gallagher [mailto:gal...@ya...]
Sent: Thursday, August 09, 2012 3:35 AM
To: sim...@li...; Eunkyoung Lee
Subject: Re: [Simple-support] xs:any with depth elements
You can not get it directly, however you can rebuild it within the converter with a StringBuilder. I am going to do an @Literal annotation to address this, however it may be a couple of months before I can do this.
--- On Wed, 8/8/12, Eunkyoung Lee <ek...@st...<mailto:ek...@st...>> wrote:
From: Eunkyoung Lee <ek...@st...<mailto:ek...@st...>>
Subject: [Simple-support] xs:any with depth elements
To: "sim...@li...<mailto:sim...@li...>" <sim...@li...<mailto:sim...@li...>>
Received: Wednesday, 8 August, 2012, 1:39 PM
I have 2 questions.
First , I have a problem with deserialization. Xml has xs:any element and it have hierarchical child node. When I tried to search this problem, convertor can be used for xs:any. But I’m not sure whether it can cover hierarchical xml also.
<element name="app-specific">
<complexType>
<sequence>
<any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="skip">
<annotation>
<documentation>
<summary>Application specific data in XML form.</summary>
<remarks>An application can define any arbitrary XMLas it's data. It may or may not adhere toa published schema.</remarks>
</documentation>
</annotation>
</any>
</sequence>
</complexType>
</element>
Example
<app-specific>
<Thresholds> <!-- xs:any start -->
<Threshold>
<TypeId> 57664 </TypeId>
<Min> 100 </Min>
<Max> 50 </Max>
<Units>%</Units>
</Threshold>
</Thresholds> <!—xs:any end -->
</app-specific>
Second, I want to get some part of xml as text even element is inside, is it possible?
For example I want to get “<Thresholds><Threshold><TypeId> 57664 </TypeId><Min> 100 </Min><Max> 50 </Max><Units>%</Units></Threshold> </Thresholds>” as Text.
I want to parse it later or send it to other application.
Any help will be appreciated.
Aina Eunkyoung Lee
Samsung Telecommunications America
1301 E. Lookout Dr.
Richardson, TX 75082
Telephone : 972-761-7792
ek...@st...</mc/compose?to...@st...>
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...</mc/compose?to=...@li...>
https://lists.sourceforge.net/lists/listinfo/simple-support
|