Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Attribute vs element in XML serialization
Attribute vs element in XML serialization [message #597353] Fri, 16 December 2005 18:23
henry is currently offline henryFriend
Messages: 1
Registered: July 2009
Junior Member
I started my EMF models using XSD, whose elements do not have any
attributes, but nested elements. When I use XMLResource to serialize the
models, the result XML instance document switchs all simple elements into
attributes. Is there any simple way to let the instance document confirm
to the original XSD, i.e, the simple nested element is serialized as
simple nested element? I did the following, but it does not help. I had to
find each attribute contained in the document (recursively), and set the
XML representation to ELEMENT using XMLInfo (for each simple attribute) to
make it work.

Is there any simpler and natural way to achieve this? Thanks!!!

XMLResource res = new XMLResourceImpl(uri);
XMLMap map = new XMLMapImpl();
res.getDefaultSaveOptions().put(XMLResource.OPTION_XML_MAP, map);
....
res.save();

Henry
Previous Topic:element namespace
Next Topic:Attribute vs element in XML serialization
Goto Forum:
  


Current Time: Thu Dec 18 08:36:30 GMT 2014

Powered by FUDForum. Page generated in 0.07107 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software