------------------------------------------------------------------------------
Article Summary
------------------------------------------------------------------------------
1.0.0| MSXML 2.0 for Windows CE 3.0
------------------------------------------------------------------------------
1.1.0| Validate & format data using XML & XSL
1.1.1| How Validate Data
1.1.2| XSL offers a more efficent display of XML data, Why?
------------------------------------------------------------------------------
1.2.0| Document Object Model, look at this technology
------------------------------------------------------------------------------
------------------------------------------------------------------------------
1.0.0| MSXML 2.0 for Windows CE 3.0
------------------------------------------------------------------------------
Microsoft Windows CE 3.0 has built in a subset of
MSXML 2.0 functionality, but not all the features
are offered.
A scheme synthetize what is supported or not:
| Feauture Included | Feauture Not Supported | |
XML validation through schema,namespace, and data type. |
Simple data types on attributes |
|
| Build and manage complex documents/data through Document Object Model (DOM). The Microsoft XML Parser on Windows CE has full DOM support in compliance with the W3C DOM recommendation. | Addition of an "id" data type for elements | |
| Web browser formatting through Extensible Stylesheet Language (XSL). | Assignment of data types through element names |
|
| Automated document requests , parse functions through XMLHTTP. | Data binding , data islands |
|
| Windows CE also can instantiate Component Object Model (COM) objects within blocks of an XSL script, (a MSXML 2.5 feature). | Mime Type viewer |
|
| Limited XML security. | Backward compatibility with the Microsoft XML Document Object Model , supported by Microsoft Internet Explorer4 |
|
Through the XSL script interface you can make instantiation of COM objects, (ActiveX controls,etc..), for example:
|
||
XMLHTTP Using the XMLHTTP object, the XML tree
|
------------------------------------------------------------------------------
1.1.0| How We Can Validate & format data using XML & XSL
------------------------------------------------------------------------------
------------------------------------------------------------------------------
1.1.1| How Validate Data
------------------------------------------------------------------------------
An XML file ,
can be validated through a schema by
declaring a namespace on the
root node element.
Example (1):
| <RECORDSET> <PERSON> <NAME>Ben Gol</NAME> <EMPLOYEDDATE>1955-12-11</EMPLOYEDDATE> </PERSON> </RECORDSET> |
We must declare this namespace before using Example (1):
| <RECORDSET xmlns="x-schema:RECORDSETchema.xml"> |
This sets the schema RECORDSETchema.xml as the
default namespace for the document "Example (1)".
The complete schema for the
XML document "Example (1)" is:
<ElementType name="NAME" content="textOnly"/> <ElementType name="EMPLOYEDDATE" <ElementType name="PERSON" content="eltOnly"> <element type="NAME"/> </ElementType> </ElementType> </Schema>
|
Other namespaces can be declared,
but, where no namespace is specified,
the default will apply.
Some Explanation:
| xmlns='urn:schemas-microsoft-com:xml-data' |
sets the default namespace for the XML document
as the schema namespace. This means that
the schema must conform to
the syntax for XML schemata.
Similarly, the attribute:
| xmlns:dt='urn:schemas-microsoft-com:datatypes' |
declares the data type namespace.
This means that data types
can now be declared throughout the schema
(the dt prefix on the type attribute
is used to type the EMPLOYEDDATE value).
------------------------------------------------------------------------------
1.1.2| XSL offers a more efficent display of XML data, Why?
------------------------------------------------------------------------------
MSXML on Windows CE provides support for XSL,
which allows more efficent display of XML data.
Getting the previous PERSON information,
we can display it in a table format.
First of all we must create an XSL style sheet:
<xsl:inquiry match="/"> <H3>RECORDSET</H3> <TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0"> </xsl:inquiry> </xsl:stylesheet>
|
This style sheet creates a table and uses the values
of selected XML elements to fill the table with information,
and also sorts the information by EMPLOYED field using the
order-by attribute on the xsl:for-each element.
The transformNode method on IXMLDOMNode passes an XSL tree
and uses it (the tree) to transform an XML node into
an output string.
In the following case, we have an
HTML string that gets
inserted into the current document:
| <xsl:script> function showRECORDSET() { document.write(RECORDSET.transformNode(RECORDSETStyleSheet.documentElement); } </xsl:script> |
Any style sheet can be applied to the XML document through the
application programming interfaces (APIs) "XML Object
Model" , that allow interaction with the elements
of the XML structure.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
1.2.0| Document Object Model, look at this technology
------------------------------------------------------------------------------
The DOM (see note 1) expose a model
that explain how HTML and XML
formilize documents and
an interface for accessing
and manipulating them.
In addition, Microsoft develop
a specific extensions that
allow creation of nodes
by node type,
provide access to typed data,
namespace information,
and much more.
Taking the "Example (1)" as cavy,
this script loads the XML document
containing the PERSON information
and uses the XSL pattern matching
to display the EMPLOY DATE
of a PERSON giving his NAME:
// This script looks for <xsl:script> function showWhenEmployed() // The selectNodes mothod returns
|
Note (1):
The DOM platform-independent technology
use a language neutral interface
that allow scripts to access and
update contents, structures,
and style of documents.
------------------------------------------------------------------------------
Berardi Michele
Senior Developer
"Customize Your Opportunities!"
Mobile: +39 347 319 2000
Web: http://web.tiscalinet.it/mberardi
E-Mail(S): mfxaub@tin.it
03473192000@vizzavi.it