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.
Converting
Java Types in Script with Variant
ECMAScript provides a Variant
type that you can use to convert and specify Java types in script.
Removing
Elements and Attributes with the delete Operator
You can use the delete
operator to remove specified elements and attributes.
Using
XMLBeans Types in Script Functions
You can use XMLBeans schema types, such as those generated
by compiling schema, in an ECMAScript function.
Using
XQuery Within Script Functions
You can write an ECMAScript function that contains XQuery
instead of script, then call that function from an XQuery map or Java code.
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.
Using
ECMAScript From XQuery Maps
Just as with XML maps you create, ECMAScript you write for
mapping acts as a translation layer.
Functions
for Manipulating XML
Offers a reference on the functions available with extended
ECMAScript.
Creating
and Using XML Variables
Introduces the XML and XMLList data types, and shows how
you can create XML variables.
Setting
Environment Attributes for XML in ECMAScript
Lists attributes you can use to control XML output from
ECMAScript.
Type Support
in ECMAScript
Describes how types are converted between Java and
ECMAScript when using JSX files.
Summary
of ECMAScript Language Extensions
Lists the ECMAScript operators and functions designed for
handling XML.
Related Topics
Handling
and Shaping XML Messages with XML Maps
XQuery Map Samples