Handling XML with ECMAScript Extensions

WebLogic Workshop includes an extended version of the ECMAScript (also known as JavaScript) programming language with enhanced support for handling XML. In particular, the extended ECMAScript includes native support for XML as a type you can access as you would access other data structures. The ECMAScript extensions are especially useful when you are manipulating the shape of XML messages received and sent by your web service.

# Topics Included in This Section

Accessing Element Children with the . Operator

Describes how you can use the . (dot) operator to construct a complete path to a child of a given element just as you would specify a member of a collection object.

Accessing Element Descendants with the .. Operator

Describes how you can use the .. (double dot) operator to specify any child contained by the element left of the operator, regardless of how far down the hierarchy the child is.

Accessing Element Children Through Their Index

Describes how you can access the children of an element by specifying their index in the list.

Accessing Element Children Iteratively

Describes how you can access element children in a loop structure.

Accessing Attributes with the .@ Operator

Describes how you can access attributes.

Resolving XML Dynamically with Embedded Expressions

Describes how you can use {} (curly braces) to embed variables and expressions in XML.

Filtering Multiple Children with Predicates

Describes how you can filter for particular elements in a list.

Filtering By Namespace

Describes how you can access elements based on their namespace URI.

Inserting Elements with the += Operator

Using the += operator, you can insert an XML element after another element. This can be useful when you want to insert a new element into an existing list.

Combining XML With the + Operator

You can use the + operator to combine XML elements. This can be useful when you want to create a new list of XML elements from XML elements returned from another expression.

Removing Elements and Attributes with the delete Operator

You can use the delete operator to remove specified elements and attributes.

Specifying the Current XML with the thisXML Keyword

You can use the thisXML property to specify the current XML, such as XML returned from an expression. The thisXML property works in a manner similar to the this keyword in ECMAScript, which is used to specify objects or functions from within their own code.

Importing Java Classes with ECMAScript with the import Statement

You can use the import statement to specify Java classes that you may use in ECMAScript.

Related Topics

Handling and Shaping XML Messages with XML Maps