Chapter 3 DynaScript Predefined Objects


DOMProcessingInstruction object

Object

Represents a processing instruction in the XML document.

Syntax

To use a DOMProcessingInstruction's property:

DOMProcessingInstruction.propertyName

To use a DOMProcessingInstruction's method:

DOMProcessingInstruction.MethodName( parameter ) 

Description

DOMProcessingInstruction objects have all the properties and methods of the DOMNode object as well as the properties defined here.

data property

Syntax

DOMProcessingInstruction.data

Description

The content of this processing instruction. This property contains the text beginning at the first non-white space character after the target to the character immediately preceding the ?>.

Example

This processing instruction has a data property of version=1.0 .

<?xml version='1.0' ?>

This instruction writes out the data of the processing instruction that is the first child of the parsed XML document domDoc.

domPI = domDoc.firstChild;
document.writeln( domPI.data );

target property

Syntax

DOMProcessingInstruction.target

Description

The target of this processing instruction. This is the first token following the markup that begins the processing instruction.

Examples

This processing instruction has a target of xml.

<?xml version='1.0' encoding='ISO-8859-1' ?>

This instruction writes out the target of the processing instruction that is the first child of the parsed XML document domDoc.

domPI = domDoc.firstChild;
document.writeln( domPI.target );

 


Copyright © 2001 Sybase, Inc. All rights reserved.