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

Re: Basic XMLSchema questions

  • From: Brett McLaughlin <bmclaugh@a...>
  • To: Alan Santos <asantos@o...>
  • Date: Wed, 05 Jan 2000 18:35:07 -0600

alan santos


Alan Santos wrote:
> 
> > >
> > > Syntactically it appears to be legal to simply have <type> on it's own,
> 
> Sorry, I meant to say <type name='xxx'>,  I'm pretty clear on type now.
> Thanks very much.
> 
> You may have missed another question in a previous email....
> 
> At one point you had made a critical remark regarding XML schema to model a
> class...
> 
> "Your schema is one-to-one with a Java class?  This wouldn't be a good
> idea, unless I'm misunderstanding your intent.  Maybe your _XML_ is
> based on a class, and it specifies the class, but then multiple XML docs
> (therefore multiple classes) all use the same Schema."
> 
> Originally, this is what I was trying to use an XML Schema to do (that is:
> store class info), and use an XML document to store instance values. (Sort
> of a simplified XMI)

I'll be very blunt; I think XML is great as a data representation.  I
think it is not quite there for mapping of objects.  What you are
talking about, I actually have built to a great extent in XML, so I can
graph Java objects (and instances of those objects) for an XML-RPC
application to talk across a network.  I just don't think it is
necessarily there yet.

I still am not sure why you would want this graphing?  Even in my
XML-RPC, I found that most times it was worth the cost to completely
graph an object/instance, it was worth using RMI.  It was only when
making procedural calls that returned simple primitives or very simple
objects that XML-RPC shone (although it's highly recommended for those
purposes).

Why not use the schema for more of a constraining validation scenario? 
It is fairly simple to use almost the exact same XML document to
represent both an object in general and an instance of said object.  In
fact, I could create a dirty XML map of an object, that could be
"extended" (in this case, I mean elements added/attributes changed)
without changing the original elements to represent any given instance. 
Then my schema is across all Java objects, ensuring that other apps can
"understand" and de-map what I am sending them.  All in all, a better
solution, I think.  Certainly faster... schema validation ain't quick
yet ;-)  Although with SAX2 I know that will improve much (b/c of
standard interface - more heads = better solutions).

> 
> I'm not sure I can do this, in any manner that doesn't break XML schemas.
> There doesn't appear to be a mechanism in place to expand the functionality
> of XML-Schemas

As Henry pointed out, there are what I would consider "hacks" and
"back-doors" that make it *possible*.

> 
> But if it is possible, I'm interested in why you feel this is a bad idea?

I think you are better to do this sort of thing in raw Java.  Of course,
I still haven't seen what you are trying to accomplish, so maybe that
would help ;-)

-Brett

> 
> (BTW, I think this is similar to what was done with Quick)
> 
> Finally, .
> 
> thanks,
> alan

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



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.