[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: New XML API from Microsoft

  • From: john@d... (John Tigue)
  • To: Tim Bray <tbray@t...>
  • Date: Thu, 24 Jul 1997 10:05:39 -0700

xmlelemtype_document
I think it is great that XML is developing so quickly. I welcome
Microsoft's hard work. I think, though,  that we need a well designed
object model for developer to use. From the below snippet taken from the
MS site, we can see that MS-XOM is based on the Java processor work. In
both these cases, I feel that a most basic object type, Element, is
misdefined. I do not think that text, comments, DTDs and "other" are
types of elements. Perhaps they are Markup but not Element.

I hope that we can work out a model which will be good for the
developers. I would also hope that MS would return to open,
collaborative discussion of XML development issues. Previous to the
beginning of work on Xapi-J this list had valuable and productive input
from MS and its developers. They have since grown silent. For an
alternative object model, please consider the collectively developed
Xapi-J. I have been maintaining a site for tracking the Xapi-J work. The
URL is http://www.datachannel.com/ChannelWorld/xml/dev.

MS-XOM IXMLElement most closely resembles Xapi-J's IContent interface.
IContent could be extended to include MS's work on IXMLElement perhaps
with a method, such as, getContentType() but not IXMLELement::get_
type(). MS's Java XML processor has already influence Xapi-J so merging
the differences would not be anything new in terms of process. The XML
spec (section 3.1) clearly defines the term "element type". The spec's
production [33] is as follows:

      STag ::= '<' Name (S Attribute)* S? '>'

The above "Name" is the "element type". Text, Comment, DTDs simply do
not have "element type". MS-XOM is misusing the spec's terminology.  I
hope in the end we have a standard which reflects the best of everyone's
ideas. Only by collaborating together can we get there. It would be a
shame if less well informed developers started learning XML doc
interfacing as curently modeled by MS-XOM.




<beginSnippet>




IXMLElement::get_type


HRESULT IXMLElement::get_type(
    long *plType)

     Returns S_OK on success.

*plType
     Indirect pointer to return the type.

Each node of the tree is labeled as being one of the following types:

typedef  enum xmlelemTYPE {
    XMLELEMTYPE_ELEMENT,
    XMLELEMTYPE_TEXT,
    XMLELEMTYPE_COMMENT,
<!--    XMLELEMTYPE_DOCUMENT,
    XMLELEMTYPE_DTD, -->
    XMLELEMTYPE_OTHER
} XMLELEM_TYPE;

For Internet Explorer 4.0, the interesting element types are
XMLELEMTYPE_ELEMENT, XMLELEMTYPE_TEXT, and
XMLELEMTYPE_COMMENT.

In the following code, both the CHANNEL and the TITLE elements are
marked as being of type XMLELEMTYPE_ELEMENT. Their names are
returned as "CHANNEL" and "TITLE", respectively. (The names are always
all uppercase). The TITLE element has one child, which is a text
element marked as being of type XMLELEMTYPE_TEXT.

<CHANNEL>
    <title> Breaking News </title>
    <!-- This is a comment element-->
</CHANNEL>

<endSnippet>

--
John Tigue
Programmer
jtigue@d...
DataChannel (http://www.datachannel.com)
206-462-1999

begin:          vcard
fn:             John Tigue
n:              Tigue;John
org:            DataChannel
email;internet: john@d...
title:          Programmer
tel;work:       1-425-462-1999
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
end:            vcard


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.