0

As its name reveals, XML (Extensible Markup Language) is designed as a mark-up language and not as a data object representation model. For this purpose, there are other options as JSON or YAML that are better suited.

There is a really good explanation about that in @Daniel Earwicker answer in thit topic: what is the difference between json and xml.

However, XML flexibility has made people to use a lot XML as a data object representation model.

My question is, is there any XML namespace which purpose is precisely that? Or which is the most suited? If exists, that namespace surely would intentionally limit XML flexibility. Maybe not allowing attributes or multi-layering, I don't know. Maybe the one is SOAP namespace? But it goes further because its web service protocol data. I'm too ignorant but maybe an equivalent question would be if it exists any standard xml namespace for serialization.

Community
  • 1
  • 1
Waiting for Dev...
  • 12,629
  • 5
  • 47
  • 57

1 Answers1

1

You might be interested in using the XAML format. XAML was specifically designed to reflect the structure of objects, and the values that properties should be initialized with, so I would guess it's an ideal format for serialization (though I haven't used it myself for this purpose). Here's a blog post describing how it can be used in .Net via the XamlServices class. I'm not sure if there are any XAML APIs other than Microsoft's.

Ken Wayne VanderLinde
  • 18,915
  • 3
  • 47
  • 72
  • Thanks @Ken! Yes, I think XAML purpose is more or less what I'm thinking about. But I guess if there is something more standardized... – Waiting for Dev... Mar 06 '12 at 21:22
  • 1
    @cram1010: Yeah, I know what you mean. XAML is an open specification, but it doesn't look like many people have writen other XAML APIs. I've found a few, though. For example, [Soyatec](http://www.soyatec.com/eface/) has an implementation for Java, and CodeJock add XAML support for C++, according to their [2008 release](http://www.codejock.com/public/assets/pdf/corporate/codejock_pr_05052008.pdf). And of course, [Mono](http://www.mono-project.com/Main_Page) has an implementation of the .Net XAML api due to their support for Silverlight. – Ken Wayne VanderLinde Mar 06 '12 at 21:39
  • I see @Ken Wayne VanderLinde... Anyway I would like to see a PHP, Ruby or Python XAML API as well :) I'm surprised that for the lake of answers it seems there is not a wide standard intended to use XML purely as an object serialization format... – Waiting for Dev... Mar 06 '12 at 22:40