XML Script logo up
Upgrade Documentation
Changing from 1.0 to 1.1

With the release of the new 1.1 version of X-Tract various changes have been made to the syntax and operation of XML Script. This means that scripts using the 1.0 syntax will not run using the version 1.1 X-Tract program. The following is a list of changes made which would cause a 1.0 script to no longer be valid in the 1.1 version of X-Tract.

__XMLscript

A new attribute in the XST element which is used to tell X-Tract the version of XML Script which has been used to write the script. A warning is displayed if the script version does not match the X-Tract version but an attempt will still be made to run the script. Once a version 1.0 script has been converted to version 1.1, 1.1 should be inserted as the content of this attribute.

Interpolation

A number of changes have been made which will affect the running of a 1.0 script, which uses interpolations, under version 1.1.

		Was:						Now:
\		current data object tract			_data_root
$\..		object being processed				parent template
Indexing

The pipe character used for indexing the last element in a series of elements has been replaced by the dollar character in the same position to perform the function.

\foo [|]	is now		\foo [$]
_eval

When reading files _eval now looks for and runs the XST top-level element. If an XST isn't found, X-Tract will issue a warning but still process the _eval.

Escaping hashes

Previously in freeform text, \#\# was a literal \# character and in interpolation strings \\# was a literal \# character. \\# is now always a literal \# character. The \#\# is now interpreted as an empty interpolation.

Attribute inheritance

Previously attributes were inherited. This has now been changed and XML Script assumes that you do not want attributes to be inherited. The interpolation \# item.id \# will only return content if the item element actually has an id attribute as '.' only accesses attributes in a non-inherited fashion. If we wish to access an inherited attribute, we can use the bang character in an interpolation. For example, \# item!id \# will return the id attribute of item if it has one, and if not it will query the parents of item until finding an id attribute or running out of parent elements. If it does not find id then it will act as if \#item.id \# had been used and not \# item!id \# .

Global variables

If you have been using either $\. or $. to store global variables they should be changed to \.These changes are as a result of the change in attribute inheritance above.

Methods

Previously if a template was nested within a template it would not have been able to find a method from the parent template. Methods are now inherited so the nested template will now be able to refer to method tables in an inherited fashion.

_data

The _data command implementation has been improved. Although there are no changes this does mean that its operation will be more consistent.

Syntax alterations

In order to improve consistency and clarity some command names, and attribute names have been changed. Attributes previously called object have been renamed to identify more specifically the type of parameter involved.

'object' where the object in question could only be an element:
		Renamed to 'element'

'object' where the object in question could be either an element or an attribute:
		Renamed to 'item'
		
'object' where the object in question could only be an element and is creative mode:
		Renamed to 'name'
Commands

For those which have been altered the old name and the 1.1 equivalent are listed below:


1.0 Command name	1.0 Attribute Name	1.1 Attribute name

_attributes		location		location
			object			element
			
_delete			object			item

_foreach		index			index
			object			element
			
_insert			index			index
			name			name
			count			quantity
			location		location
			
_method			template		template
			context			context
			object			element
						
									
_process		object			element

_read			strip_newline		stripLF
			lines			quantity
			
_rename			newname			newname
			target			item
			
_set			object			name

_template		name			name
						file
									
Meta-attributes


1.0 Element name	1.0 Attribute name	1.1 Element name

__object					__element

Support

If you have any questions about upgrading your scripts or have any problems please feel free to email our support team at support@xmlscript.org

Contents...

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited