MSXML in Windows Mobile 5.0


MSXML is the standard Microsoft XML parser for native applications.  It was originally developed for desktop Windows but was ported to Windows CE.  MSXML has shipped in every version of the PocketPC since PPC 2000.  PPC 2000, 2002, and 2003 all shipped a port of MSXML2.


In Windows Mobile 5.0, we have *finally* shipped MSXML3 SP1 (which was available for general embedded CE devices for a long time).  Hooray!  The most important new features of MSXML3 are SAX and XSLT.


One MSXML feature WM 5.0 does NOT support that previous versions did is XML error strings.  These error strings really are only for developer's use for debugging xml.  They are things like "xml element <foo> is missing its closing tag".  They were left out in order to save approximately 40KB of ROM on WM devices.


This isn't that big of a limitation.  These messages are hopefully not something you would display to the end user even if you could.  (I doubt my grandma would appreciate the significance of "xml element <foo> is missing its closing tag" :)).  If you have to understand why some XML isn't working, you can use the desktop MSXML to debug and get the more useful error strings.

Comments (25)

  1. Sean says:

    XSLT!! Not a minute too soon! The world is a better place.

  2. Yashraj says:

    Does MSXML3 for WinCE supports IServerXMLHTTPRequest2 interface?

  3. cenet says:

    No IServerXMLHTTPRequest2 on WinCE. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcexmldm/html/ceconxmlforwindowscenet.asp has list of unsupported features compared to desktop.

  4. pinchio says:

    I’m interested in streaming jpegs to a browser in a psydo web-cam fashion whereby it will request a new image as fast as the server and network can send. I’ve tried using javascript methods relying on the Image.onload event but alas this is not supported on PIE WM5. Since there are other controls on the page I don’t want to refresh the page continually to request a new image so that is not an option. I simply wish to load images as fast as I can swapping a HTML image with a newer version.

    Can I use MSXML for this with possibly AJAX thrown into the mix? If so what steps should I take?

    Thanks

  5. cenet says:

    Hey pinchio — this is a better question for the newsgroups.  MSXML is really as high-level as anyone on the CENet team go (we’re mostly device driver + network service folks) and we really don’t know anything about AJAX.  Sorry we can’t help out her.

    John Spaith

  6. GShirley says:

    Ok, I have heard that xslt support is available in CE 5, but have no idea on how to incorporate it in my Windows CE C# .NET Forms app. I can add a reference to one of the 6 msxml dll’s on my machine, and the wrapper classes get created just fine. But when I try to create the COM object in my CE Mobile app, it fails. Is the GUID on the device different than the GUID on my box ? Are there any instructions on how to use XSLT on a windows mobile 5 device. In short, HELP !

  7. Bobby Schaffer says:

    I am learning to create Smartphone home screens and I would like to parse the home.xml file in the plug in.  Is there any documentation anywhere on how to do that?

    Thanks,

    Bobby

  8. cenet says:

    Bobby – you can look up MSXML documentation on MSDN for how the parser itself works, though this won’t say anything about how home.xml is laid out.  For that check out MSDN or one of the newsgroups (PocketPC related) listed at http://blogs.msdn.com/cenet/archive/2005/12/05/500181.aspx.  I’m not familiar with the home screen plugins so I can’t really help much on this one.

    John Spaith

  9. cenet says:

    To answer GShirley’s post, first you should definitely be using the CE development environment to do MSXML work and not trying to reference a desktop msxml.  The GUID should be the same for the XMLDOM on both desktop & CE, though on desktop they have all the different versions available so you could be getting into problems there.  Also be sure that your basic COM object calls in C# are OK — I don’t know if it’s limited in anyway, but it’s another moving piece.  I’ve never heard of other folks on WM5 having XSLT problems, but they’ve always went through native.

    If this doesn’t help please follow up on a newsgroup since I obviously don’t check the blog feedback often enough :(.

  10. random guy says:

    Say, how about xmllite on Windows Mobile?

    SAX is a real pain to use…

  11. cenet says:

    We don’t have plans to ship xmllite in the near future.  I’m aware that it’d be helpful, but at present we have other areas we need to focus on.  Sorry for delay in responding to this.

    John

  12. Paul says:

    John,
    ok I give up! I need help!

    I’m installing software which is currently supported for Pocket PC 2003 into my brand new JAMin. (with a 1GB SD card)

    The error is “failed to load typelib for msxml.dll Error code = 0x80070716”

    I’m in direct contact with the software manufacturer who is familiar with Pocket PC 2003 but not WM 5. They say the error message indicates the msxml typelib is missing or MSXML is not installed. I can’t see msxml or msxml3 in the windows or system directory in WM5. (view all files is turned on)

    Microsoft documentation says msxml3 sp1 is available for WM5 with references pointing to the WM5 SDK. I’ve tried to install it on my desktop but the install reports I dont have the right components – I presume Visual Studio 2005. Maybe .net framework?

    Can you tell me if XML for WM5 is available for download somewhere?

    Paul
    I’ve also posted this question at the Imate website.

  13. cenet says:

    Paul — On WM5, we ship msxml3.dll and not msxml.dll (or any sort of typelib stuff that would point directly to it).  The fact you’re not seeing the DLL in windows is because you’re fileviewer is still hiding it from you; some fileviewers still hide files built into ROM no matter whether you ask them to show you hidden files.  msxml3.dll is included on all WM5 era devices, both the PocketPC & SmartPhone form factors.  msxml3.dll does have the TLB still included as part of the dll (though it’s called msxml2.tlb internally, confusingly enough).

    For future posts, you’re better off using a newsgroup – http://blogs.msdn.com/cenet/archive/2005/12/05/500181.aspx lists a bunch I check – since because of SPAM I have to moderate the blog entry & I’m not as good at checking here as the newsgroups.

    John

  14. So you want to do something with XML on WinCE / Windows Mobile and want to see sample code to do it.

  15. Windows Mobile 5.0 shipped MSXML3, as I describe here . On PocketPC 2000-2003 devices, we ship MSXML2.

  16. Prasad says:

    Does WM 5 support SORT function of XSL ???

  17. cenet says:

    WM5 supports the same XSL as was available in Windows XP RTM (it’s MSXML3SP1).  I’m almost positive there’s a SORT included in this, but I’m rusty on the details.  The CE documentation (or even MSXML3 documentation on the desktop or samples XSL for the desktop) should be able to get you the answer here.

    John

  18. Rad says:

    What is the minimum requierment for using MSXML on Windows CE 5.0.

    where can i find msxml requiered files(dll, bin, …)

    Thanks

  19. cenet says:

    The min varies wildly, depending on which set of components of MSXML you bring in.  So MiniSAX is only about 120KB ROM for MSXML on x86 retail, and it may bring in a few hundred KB of ROM of other requirements (like httplite (aka mini-Wininet)).  Full MSXML, with DOM/XQL/XSLT/SAX/XMLHTTP is 900KB or so I think on x86 retail and it requires URLMON, full Wininet which add probably another 1 meg to ROM.

    Of course if you have Urlmon, Wininet, etc on your device already then you don’t get any extra hit in including MSXML.  Since CE is so configurable, only way for you to get the extra ROM/RAM hit for MSXML is to build your baseline image with everything you need except MSXML and then rebuild platform with MSXML included.  MSXML automaticalyl brings in dependencies that it needs when included.

    Sorry for delay here, this slipped through the cracks.  I’d recommend a newsgroup listed on

    http://blogs.msdn.com/cenet/archive/2005/12/05/500181.aspx since responses will generally be faster there.

    John

  20. Mahesh says:

    What is the limitation of data withstand by a xml parasar on windows mobile.

    I mean how much data can a xml parasar on windows mobile can take.

    is there any limitation if so what is the limitation.

  21. cenet says:

    Mahesh – the limitation of the MSXML parser is going to be limited by the amount of available virtual memory.  If you’re using SAX based parsing it shouldn’t be an issue, but with a DOM or XSLT you will start to bump into it.  Note on all current versions of Windows Mobile, VM limit is 32MB per process maximum.  (In CE 6 for embedded it is 4GB).  I’ve heard that for the DOM, the amoun of RAM used is about 10 times the size of the XML document that is read in but I’ve never validated this for myself and the source I heard it from wasn’t Gospel (i.e. it wasn’t someone on MSXML team).

    John

  22. Anders says:

    I don’t really get it…

    If I want to read/write XML on a Windows CE 5.0 device, what are my options?

    Can I use XMLLite? Or do I have to use MSXML?

    What I want to do is read/write XML-data to and from MSMQ’s

  23. cenet says:

    You have to use MSXML, or else a 3rd party parser if you don’t like MSXML for whatever reason (usually it’s around perf, though for most tasks MSXML perf is good enough).  There are some 3rd party stuff available for WM, I don’t know of any for CE devices but doesn’t mean there aren’t any.  Unfortunately no CE version currently supports xmllite.

  24. shashi says:

    I want to do xml parsing on windows mobile but i dont know anything about it what should i do now?

  25. cenet says:

    Shashi – first apologies for long delay in responding.

    http://blogs.msdn.com/cenet/archive/2006/07/24/where-can-i-find-sample-code-to-do-xml-parsing-on-wince.aspx has info that should help get you started.

    John

Skip to main content