eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'XML::AttributeDef':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: AttributeDef (in XML)


Inheritance:

   Object
   |
   +--XML::AttributeDef

Package:
stx:goodies/xml/vw
Category:
XML-VW-Attributes
Version:
rev: 1.11 date: 2021/06/08 12:05:55
user: cg
file: AttributeDef.st directory: goodies/xml/vw
module: stx stc-classLibrary: vw

Description:


XML documents may contain attribute-list declarations that are used to define the set of attributes pertaining to a given element type. These attribute-list declarations are also used to establish type constraints for the attributes and to provide default values for attributes. Attribute-list declarations contain attribute definitions and this class is used to instantiate these attribute definitions.

An attribute definition specifies the name (name instance variable) of the attribute, the data type of the attribute (type instance variable) and an optional default value (default instance variable) for the attribute

Instance Variables:
	name    <XML.NodeTag>           name of attribute
	default <String | nil>                                  default value, if any
	type    <XML.AttributeType>     type used for validation
	flags   <Integer>                               encoding for fixed, implied and required type attributes


Instance protocol:

accessing
o  default

o  default: n

o  hasDefault

o  isFixed

o  isImplied

o  isRequired

o  name

o  name: n

o  tag

o  type

o  type: n

private
o  value
(comment from inherited method)
return the receiver itself.
This allows every object to be used where blocks or valueHolders
are typically used, and allows for valueHolders and blocks to be
used interchangably in some situations.

Time will show, if this is a good idea or leads to sloppy programming
style ... (the idea was borrowed from the Self language).

WARNING: don't 'optimize' away ifXXX: blocks
(i.e. do NOT replace
foo ifTrue:[var1] ifFalse:[var2]
by:
foo ifTrue:var1 ifFalse:var2
)
- the compilers will only generate inline code for the if,
iff the argument(s) are blocks - otherwise, a true send is
generated.
This 'optimization' will work semantically correct,
but execute SLOWER instead.

Using constants (foo ifTrue:1 ifFalse:2) does not introduce a performance penalty.

o  value: str

validating
o  completeValidationAgainst: aParser
Modifed to handle IMPLIED (no value to validate) attributes. REW

o  selfValidateFor: aParser

o  validateValueOf: anAttribute for: aParser



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:35:15 GMT