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

Re: xml:type (Was: Re: ten years later, time to repe

  • From: "bryan rasmussen" <rasmussen.bryan@g...>
  • To: "Pete Cordell" <petexmldev@c...>
  • Date: Thu, 21 Feb 2008 12:41:03 +0100

Re:  xml:type (Was: Re:  ten years later
I could agree that it might make sense to have something called
xml:type but then I would not want it to describe typical data type
information, which I think is up to the application handling the XML
and while not uninteresting is not what I would call value-adding to
the markup , rather I would want some sort of data typing that is more
specific to markup. For example in such a context xml:type could be
used to identify something as either an ID or an IDREF. Thus getting
rid of xml:id proposals.

someone might argue that the downside of this is that you can then
only identify types of element nodes, but element nodes are more
privileged than other data.

Other example xml types?

I guess what I mean is that I want to type the element node in its XML
context, not the text node in its data context. (if that explanation
sounds at all reasonable)



Cheers,
Bryan Rasmussen



On Thu, Feb 21, 2008 at 10:48 AM, Pete Cordell <petexmldev@c...> wrote:
> Summarizing my latest thoughts on the 'xml:type' issue, I, at least, get a
>  bit confused when people talk about 'typed' data.
>
>  So if people that say they don't like typed data mean that they prefer:
>
>     <foo>123</foo>
>
>  to:
>
>     <foo><int>123</int></foo>
>
>  (or similar) then I agree.  If a device (maybe a human one!) doesn't know
>  how to process a <foo>, then knowing it's an int is probably not going to
>  help it much.  (Does anyone think this is the wrong way to look at it?  If
>  so, why?)
>
>  I do think it's very important to be able to specify what type a <foo> is,
>  e.g. to say <foo> is an int, and maybe the max and min values etc.  Being
>  able to validate that it is what it's supposed to be at a fairly automated
>  low level is also very handy.  How you specify that is less important, but
>  given that it's an interoperability issue, it makes sense that the method
>  you use is widely understood and supported.
>
>  The use-case I was initially interested in for having xml:type is the case
>  of XSD polymorphic complex types (c.f. OO polymorphism).  I agree though
>  that this is a pretty grim use-case.  xsi:type is also often used as some
>  form of poor man's co-constraint (and I agree there are often better ways
>  that this could be done).  If XSD1.1 supports co-constraints, maybe the rare
>  use-cases for xsi:type will reduce further.
>
>  As a result I agree that it shouldn't be promoted to a first class citizen,
>  even if it is a dog to implement as it is (at least for data binding).
>
>  Cheers,
>
>  Pete Cordell
>  Codalogic
>  For XML C++ data binding visit http://www.codalogic.com/lmx/
>
>  ----- Original Message -----
>  From: <noah_mendelsohn>
>  To: "David Carver" <d_a_carver>
>  Cc: "Pete Cordell" <>; "Robin Berjon" <>; "XML Developers List" <>
>  Sent: Thursday, February 21, 2008 4:39 AM
>  Subject: Re:  ten years later, time to repeat it?
>
>
>  > David Carver writes:
>  >
>  >> Personally, I HATE xsi:type. In most B2B scenarios I've been involved
>  >> with it causes more interoperability issues then it solves.
>  >
>  >> I'd much rather get rid of XML type, and force people to validate
>  >> against the  schema as is
>  >
>  > Schema types (which I'm guessing is what you mean by XML type) and
>  > xsi:type aren't at all the same thing.  If you get rid of Schema types,
>  > then you can't say "this element must contain an Integer".  Is that the
>  > complication you're trying to avoid?  If so, yes, you should argue against
>  > Schema types.
>  >
>  > If you're arguing against xsi:type, I can certainly understand that.  It's
>  > the wrong thing in >90% of use cases (probably way more, but I'm just
>  > guessing and trying to be conservative), and it makes a mess of instance
>  > documents.  It was introduced because some members of the Schema WG were
>  > very anxious to handle serialization of object graphs, I.e. to do what
>  > Java Object Serialization (used by RMI) does.   SOAP Encoding is an
>  > example of such XML-based object serialization, and it uses xsi:type.
>  > Indeed, because of dynamic subtyping, it's generally the case that the
>  > serialization formats for such systems must carry for each item both its
>  > name and its type.  Go read through the format spec. for Java Object
>  > Serialization and you'll see that's the core of it.  In XML with schema,
>  > you can use the tag for the name, and xsi:type for the type.
>  >
>  > Personally, I'm not convinced that supporting that scenario should have
>  > made an 80/20 cut for schema, but as happens on a big committee, some
>  > people argued very strongly for it.  You can, of course, turn it off by
>  > using suitable "block" attributes at the right points in your schema.
>  > While that pretty much ensures that your instances are clean (I think
>  > xsi:type is still allowed for better or worse, but it can't then designate
>  > a type other than the one your element would have had anyway, as I
>  > recall), but it's a nuissance in the schema.
>  >
>  > Noah
>  >
>  > --------------------------------------
>  > Noah Mendelsohn
>  > IBM Corporation
>  > One Rogers Street
>  > Cambridge, MA 02142
>  > 1-617-693-4036
>  > --------------------------------------
>  >
>  >
>  >
>  >
>  >
>
>
>
>  _______________________________________________________________________
>
>  XML-DEV is a publicly archived, unmoderated list hosted by OASIS
>  to support XML implementation and development. To minimize
>  spam in the archives, you must subscribe before posting.
>
>  [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>  Or unsubscribe: xml-dev-unsubscribe@l...
>  subscribe: xml-dev-subscribe@l...
>  List archive: http://lists.xml.org/archives/xml-dev/
>  List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.