News | Articles | Libraries | Developer Tools | Books | Forum Links | Search   
Sections:
 

Windows CE MSXML FAQ

By John Spaith, May 22, 2003.
Print version

Introduction

This article answers the most frequently asked questions about using XML on Windows CE. It has 2 areas of focus - Pocket PC devices and non-Pocket PC devices.

Pocket PC

Does my Pocket PC have MSXML?

All Pocket PC 2002's ship MSXML. Pocket PC 2000 Pro ships MSXML, but Pocket PC Standard does not. You can tell them apart by looking to see if your device has PocketWord and PocketExcel. Pro SKU has these apps, Standard SKU does not.

You can also determine this by looking to see if \windows\msxml.dll is present. Note that just opening a file explorer may not work because msxml.dll is a system and hidden file and the file explorer may not display it.

What version of MSXML does Pocket PC ship?

MSXML 2.0 SP1. Pocket PC 2002 picked up a few bug fixes over the Pocket PC 2000 version, but other than that they are the same.

Does Pocket PC do XSLT transformations?

No. MSXML 2 only supports the older XSL, not XSLT. To see what this can and can't do, check out http://www.vbxml.com/xsl/XSLTRef.asp under msxml2 column.

Does Pocket PC support SAX?

No. SAX was a feature added to MSXML 3.

I need to: open an XML file, use XMLHTTP, do an XSL transformation, etc... give me sample code!!!

Since MSXML is a port of the desktop's MSXML and most of the changes in it were to get it running on the WinCE Platform, MSXML code written for the desktop (assuming that it will run on desktop MSXML2 SP1) should be applicable to WinCE. There's a lot more samples written for the desktop floating around on the Internet for desktop, so start there.

The core interfaces, like the DOM Document and XMLHTTP, haven't changed since MSXML 2 and later revisions. Later revisions of MSXML added features like SAX, XSLT, ..., but left core features alone for backward compatibility reasons.

MSXML 3 is available on some versions of Windows CE. Why can't I install it on my Pocket PC?

MSXML 3 ships for Windows CE 4.X. The Pocket PC 2000+2002 are built on top on Windows CE 3.0. Windows CE is backward compatible (i.e. apps compiled in 3.0 SDK run on 4.0 devices) but it is not "forward" compatible - apps compiled for CE 4.0 will not run on CE 3.0.

Can I use MSXML from eMbedded Visual Basic?

Yes. Check out http://www.devbuzz.com/content/zinc_evb_xml_pg1.asp for a sample.

Non-Pocket PC Devices

This next section is intended for OEMs using Platform Builder or for ISV's writing applications for any device created by an OEM, other than Pocket PC.

How do I get MSXML on my device if I don't have it already?

If you're an OEM, you only need to add the MSXML component to your device. If you're an ISV you need to talk with you OEM about getting MSXML.

Which versions of Windows CE (via Platform Builder) support MSXML?

MSXML 2.0 SP 1 first shipped in Windows CE 3.0 Add-On Pack. If you only have Platform Builder Windows CE 3.0, you need to install the Add-On Pack first. Windows CE 4.0 (aka Windows CE .Net - I'll stick to version #'s here) shipped MSXML 3.0 SP1. Windows CE 4.2 added Internet Explorer Mime Viewer support to MSXML 3.

Where can I get reference documentation on MSXML?

Unfortunately the documentation for CE 3.0 is limited only to describing the differences between MSXML on the desktop and on Windows CE. In this case you'll need to examine reference material for the desktop. The desktop reference on msdn.microsoft.com is for MSXML 4.0, but most of the core interfaces haven't changed. You may be able to download the MSXML 2 SDK for the desktop (and hence its help file) if you look hard enough.

In Windows CE 4.X this problem was fixed by having a complete copy of MSXML3 reference documentation for Windows CE. Look in MSDN.

I have a simple XML files I want to parse. Why do I need to include the full DOM on my device? I don't have a lot if ROM/RAM to spare.

You don't have to in CE 4.X. MSXML was heavily componentized and one of the components created is called miniXML, sometimes referred to as MiniSAX. This is the minimal SAX parser, but it still uses the core MSXML parsing routines and interfaces. On x86 retail builds it is 130KB.

Instructions for configuring the components of MSXML are available in MSDN. Choosing which components of MSXML to ship is an option for OEMs only.

When running MSXML in a debugger, sometimes I see a ton of error messages complaining about exceptions being thrown in the debugout. Is something broken?

Maybe - if the exception is caused by you accessing a NULL pointer then something is broken, but that's beyond the scope of this document :). If you see complaints about exception 0xE0000001 then this is by design and nothing to worry about. MSXML internally raises exception 0xE0000001 when it encounters any type of error (invalid XML, out of memory, ...) but it also catches this error internally and handles it. You do not need to wrap XML calls with __try/__except calls. MSXML configures itself not to have the debugger stop processing if an exception is hit, so you should never notice this except in the debugout.

This is a sample of what these harmless exceptions may look like on a full-debug build:

0x83c6fa28: Exception ffffffff Thread=83c6fa28 Proc=63c397ca 'iesample.exe' 0x83c6fa28: AKY=00000081 PC=03f8f924 ESP=100aeacc EA=8027b8e8 0x83c6fa28: Exception ffffffff Thread=83c6fa28 Proc=63c397ca 'iesample.exe' 0x83c6fa28: AKY=00000081 PC=03f8f924 ESP=100aea00 EA=03f8f924 First-chance exception in COREDLL.DLL.First-chance exception in COREDLL.DLL. 0x83c6fa28: Exception ffffffff Thread=83c6fa28 Proc=63c397ca 'iesample.exe' 0x83c6fa28: AKY=00000081 PC=03f8f924 ESP=100aead0 EA=10040000 First-chance exception in COREDLL.DLL.0x83c6fa28: DlgMgr: FindDlgItem id 1 returning NULL. (0xE0000001: msxml) (0xE0000001: msxml) (0xE0000001: msxml)

Related resources:

Discuss

Discuss this article. Here you can write your comments and read comments of other developers.
Rate this article:     Poor Excellent    
 12345 
© 2001-2005 Pocket PC Developer Network, a division of Spb Software House