#14 make ixmlPrintDocument produce well formed document

John Dennis

The problem is only evident with devices and only if
the device uses the
UpnpRegisterRootDevice2 entry point. It appears as if
the SDK authors
realized that UpnpRegisterRootDevice was simplistic and
inflexible and
added UpnpRegisterRootDevice2 later in development.
Perhaps at some
point these two functions could be collapsed into one.

With UpnpRegisterRootDevice2 it is possible to generate
the device
description document dynamically and have the internal
web server serve
an in-memory copy of the document as opposed to a file.
This is actually
a very useful technique and ixmlPrintDocument is the
means to get an
in-memory copy of the XML description document given a
DOM tree. Just
one problem. ixmlPrintDocument does not produce a valid
XML document
because it leaves out the XML document prolog. I
discovered this when
testing with control points based on Microsoft Windows
UPnP framework.
The Microsoft implementation will silently ignore any
UPnP devices whose
description document is malformed and that includes
omitting the XML

In the UPnP SDK ixmlPrintDocument had been #define'd to
be ixmlPrintNode
which prints XML elements. The fix I believe is to have
to independent
functions, ixmlPrintDocument and ixmlPrintNode (same
for the toString
versions) where the Document functions include the
prolog and the Node
functions omit it. The attached patch (which I'll also
post on the SF
site) creates the new Document functions which prepends
the prolog and
replaces every instance of ixmlPrintDocument with
ixmlPrintNode because
the two are now no longer interchangeable (except in
in the file urlconfig.c, because here you do want a


  • John Dennis

    John Dennis - 2006-03-07

    add ixmlPrintDocument implementation and call it correctly

  • Anonymous - 2006-04-06

    Logged In: YES

    I applied the patch, added to CVS (seems like I
    m not able to close it)

  • Anonymous - 2006-04-07
    • assigned_to: nobody --> virtualreality
  • Anonymous - 2006-04-07
    • status: open --> closed
  • Anonymous - 2006-04-07
    • status: closed --> closed-accepted

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks