Skip to main content



      Home
Home » Archived » XML Schema Definition (XSD) » Attribute vs element in XML serialization
Attribute vs element in XML serialization [message #597353] Fri, 16 December 2005 13:23
Eclipse UserFriend
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: Sun Jul 13 09:13:22 EDT 2025

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

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

Back to the top