home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Inserting extra XML in Device Description and Service SCPD XML
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="McGoober" data-source="post: 834320" data-attributes="member: 24098"><p>One of the requirements of DLNA is to add the following XML tag to UPNP device description and service SCPD XML. </p><p></p><p>[CODE]<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>[/CODE]</p><p></p><p>Currently there is no way for me to insert this XML tag into either of the xml documents.</p><p>In order to make my UPNP device and services I subclass both DvDevice and DvService. I was wondering if a virtual method could be put into each of these classes, such that I could override them and insert whatever into the XML.</p><p></p><p>Something like this...</p><p></p><p>[CODE]</p><p>class DvDevice {</p><p> (BLAH)</p><p></p><p> internal void AddDeviceDescriptionsRecursive(XmlWriter writer, EndpointConfiguration config, CultureInfo culture)</p><p> {</p><p> (BLAH)</p><p> AddAdditionalDeviceDescriptions(writer, config, culture);</p><p> (BLAH)</p><p> }</p><p></p><p></p><p> protected virtual void AddAdditionalDeviceDescriptions(XmlWriter writer, EndpointConfiguration config, CultureInfo culture)</p><p> {</p><p> // Nothing to do here for DvDevice, but could be overriden by a subclass.</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p></p><p>I could then do the following...</p><p></p><p></p><p>[CODE]</p><p>class UPnPMediaServerDevice : DvDevice {</p><p> (BLAH)</p><p> protected override void AddAdditionalDeviceDescriptions(XmlWriter writer, EndpointConfiguration config, CultureInfo culture)</p><p> {</p><p> // Add DLNA specific Element.</p><p> writer.WriteElementString("dlna", "X_DLNADOC", "urn:schemas-dlna-org:device-1-0", "DMR-1.50");</p><p> }</p><p> (BLAH)</p><p>}</p><p>[/CODE]</p><p></p><p>Hope that makes sense. Any other ideas are of course welcome.</p></blockquote><p></p>
[QUOTE="McGoober, post: 834320, member: 24098"] One of the requirements of DLNA is to add the following XML tag to UPNP device description and service SCPD XML. [CODE]<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>[/CODE] Currently there is no way for me to insert this XML tag into either of the xml documents. In order to make my UPNP device and services I subclass both DvDevice and DvService. I was wondering if a virtual method could be put into each of these classes, such that I could override them and insert whatever into the XML. Something like this... [CODE] class DvDevice { (BLAH) internal void AddDeviceDescriptionsRecursive(XmlWriter writer, EndpointConfiguration config, CultureInfo culture) { (BLAH) AddAdditionalDeviceDescriptions(writer, config, culture); (BLAH) } protected virtual void AddAdditionalDeviceDescriptions(XmlWriter writer, EndpointConfiguration config, CultureInfo culture) { // Nothing to do here for DvDevice, but could be overriden by a subclass. } } [/CODE] I could then do the following... [CODE] class UPnPMediaServerDevice : DvDevice { (BLAH) protected override void AddAdditionalDeviceDescriptions(XmlWriter writer, EndpointConfiguration config, CultureInfo culture) { // Add DLNA specific Element. writer.WriteElementString("dlna", "X_DLNADOC", "urn:schemas-dlna-org:device-1-0", "DMR-1.50"); } (BLAH) } [/CODE] Hope that makes sense. Any other ideas are of course welcome. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Inserting extra XML in Device Description and Service SCPD XML
Contact us
RSS
Top
Bottom