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

RE: per class attributes and per instance attributes

  • To: "Rick Jelliffe" <rjelliffe@a...>, <xml-dev@l...>
  • Subject: RE: per class attributes and per instance attributes
  • From: "Mangesh Kalbhor" <Mangesh.Kalbhor@a...>
  • Date: Tue, 18 Apr 2006 11:16:50 -0700
  • Thread-index: AcZii8RZCxz+FEabS+CQ7X0nxCmxzwAiF8Vg
  • Thread-topic: per class attributes and per instance attributes

class attribute and instance attribute
I am defining classes and sub-classes. I have to specify attributes to
all the elements in the classes.
The values of some attributes will be same for all the elements in a
particular class and values of some attributes will be different for
each element although they are in the same class.

How do I define them in xml schema (XSD)? 

-Mangesh

-----Original Message-----
From: Rick Jelliffe [mailto:rjelliffe@a...] 
Sent: Monday, April 17, 2006 6:58 PM
To: xml-dev@l...
Subject: Re:  per class attributes and per instance attributes

Mangesh Kalbhor said:
> In a XML Schema
>
> How to define a set of per class attributes? And also a set of per
> instance attributes?

Using  DTD, you can use a fixed attribute for a class attibute (i.e. an
attribute that is invariant for all instances). You use the keyword
#FIXED
and specify them in the DTD not the instance.  You use ordinary
(non-fixed) attributes for instance attributes.  To make declare these
in
sets, you use parameter entities (%).

Using  XML Schemas (XSD), you can use a fixed attribute for a class
attibute (i.e. an attribute that is invaraiant for all instances). You
use
restrict the value of the attribute to a single value.  You use ordinary
(non-fixed) attributes for instance attributes.  To make declare these
in
sets, you use AttributeGroups. However, you must make sure that your
receiving end uses software that either understands the Post Schema
Validation Infoset (i.e. the instance with all the extra non-XML
information added by the XSD) or, in the case of automatically generated
code from a schema, that the automatic code generator in fact does make
use of the fixed attributes.

Using Schematron there is no way to express class attributes, except the
weak way of requiring that an attribute if specified only has a single
value. Schematron detects the presence or absence of patterns in a
document, it does not augment the original document. (Though smart
software can be written as a layer.)

Using RELAX NG there is no way to express class attributes, except the
weak way of requiring that an attribute if specified only has a single
value. It does not augment the original document. (Though smart software
can be written as a layer.)

XML has been held back for many years by the lack of a processing model.
DTDs were "replaced" by several technologys (XSD, XInclude, XML Base,
Namespaces) but without a processing model they are unreliable.  Even
with
a processing model, the XSDs usefulness for providing default attribute
values (and other PSVI information) is hibernating until standard APIs
are
made (type-augmented SAX, etc.) with wide support.

In making ISO DSDL, we considered whether to have a PSVI (no, because it
works against XML's unity, fixity and commonality)  and whether to have
a
language for expressing the processing pipeline--Google for
Schemamachine
for an example-- (no, because we thought W3C was a better forum for
that.)

I hope this is useful,
Rick Jelliffe

-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://www.oasis-open.org/mlmanage/index.php>



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.