Re: [Simple-support] Serialization and namespace optimizations
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-09-12 03:28:00
|
Yes, NamespaceList is an annotation that is used for this. Check it out, also there are examples of its use in the test cases, however I think you will be able to figure it out. --- On Wed, 7/9/11, bubbleguuum <bub...@fr...> wrote: > From: bubbleguuum <bub...@fr...> > Subject: [Simple-support] Serialization and namespace optimizations > To: sim...@li... > Received: Wednesday, 7 September, 2011, 2:16 PM > Hi, > > I'm serializing namespace heavy data structures and there's > a lot of redundency in the output as the namespace is > specified for each element. For example: > > <DIDL-Lite > xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"> > <item > id="T1020" > parentID="414"> > <upnp:class > xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">object.item.audioItem.musicTrack</upnp:class> > <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">2084</dc:title> > <upnp:albumArtURI > > dlna:profileID="JPEG_TN" > > xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" > > xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">http://1.2.3.4:9050/stream/99ae0c9ea500a4e4c41b4694e75380b5</upnp:albumArtURI> > <upnp:artist > role="Performer" > > xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">Redshape</upnp:artist> > <dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Redshape</dc:creator> > <upnp:genre > xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">Techno</upnp:genre> > <upnp:originalTrackNumber > xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">1</upnp:originalTrackNumber> > <dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2006-01-02</dc:date> > <upnp:album > xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">2084 > / Ultra</upnp:album> > </item> > </DIDL-Lite> > > > The namespace if specified for each element that specify a > @Namespace. > Is it possible to configure the serializer (or change the > class definition) to put all namespaces at the root element > like shown below: > > <DIDL-Lite > > xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" > > xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" > xmlns:dc="http://purl.org/dc/elements/1.1/" > > xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"> > <item > id="T1020" > parentID="414"> > <upnp:class>object.item.audioItem.musicTrack</upnp:class> > <dc:title>2084</dc:title> > <upnp:albumArtURI dlna:profileID="JPEG_TN">http://1.2.3.4:9050/stream/99ae0c9ea500a4e4c41b4694e75380b5</upnp:albumArtURI> > <upnp:artist > role="Performer">Redshape</upnp:artist> > <dc:creator>Redshape</dc:creator> > <upnp:genre>Techno</upnp:genre> > <upnp:originalTrackNumber>1</upnp:originalTrackNumber> > <dc:date>2006-01-02</dc:date> > <upnp:album>2084 / Ultra</upnp:album> > </item> > </DIDL-Lite> > > > > > ------------------------------------------------------------------------------ > Using storage to extend the benefits of virtualization and > iSCSI > Virtualization increases hardware utilization and delivers > a new level of > agility. Learn what those decisions are and how to > modernize your storage > and backup environments for virtualization. > http://www.accelacomm.com/jaw/sfnl/114/51434361/ > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |