138

Citrix NetScaler Policy Configuration and Reference Guide

 

 

 

 

 

 

 

XPath Prefix

Description

 

 

 

 

 

 

text.XPATH_JSON(xpathex)

Operate on a JSON file and return a node-set

 

 

 

or a string. Node-sets are converted to

 

 

 

corresponding strings by using the standard

 

 

 

XPath string conversion routine.

 

 

 

For example, consider the following JSON

 

 

 

file:

 

 

 

{ "Book":{ "creator":{ "person":{

 

 

 

"name":'<name>' } }, "title":'<title>' } }

 

 

 

The following expression selects all the nodes

 

 

 

that are enclosed by “/Book" (a node-set) in

 

 

 

the first 1000 bytes of the body of the JSON

 

 

 

file and returns the corresponding string

 

 

 

value, which is "<name><title>":

 

 

 

HTTP.REQ.BODY(1000).XPATH_

 

 

 

JSON(xp%/Book%)

 

 

 

Parameters:

 

 

 

xpathex - XPath expression

 

 

 

 

 

 

text.XPATH_JSON_WITH_

Operate on an XML file and return a string

 

 

MARKUP(xpathex)

that contains the entire portion of the

 

 

 

document for the result node, including

 

 

 

markup such as including the enclosing

 

 

 

element tags.

 

 

 

For example, consider the following JSON

 

 

 

file:

 

 

 

{"Book":{ "creator":{ "person":{

 

 

 

"name":'<name>' } }, "title":'<title>' } }

 

 

 

The following expression operates on the

 

 

 

JSON file and selects all the nodes that are

 

 

 

enclosed by “/Book/creator" in the first 1000

 

 

 

bytes of the body, which is “creator:{ person:{

 

 

 

name:'<name>' } }.”

 

 

 

HTTP.REQ.BODY(1000).XPATH_JSON_

 

 

 

WITH_MARKUP(xp%/Book/creator%)

 

 

 

The portion of the JSON body that is selected

 

 

 

by the expression is marked for further

 

 

 

processing.

 

 

 

Parameters:

 

 

 

xpathex - XPath expression

 

 

 

 

Page 152
Image 152
Citrix Systems 9.2 manual For example, consider the following Json, That are enclosed by /Book a node-set, JSONxp%/Book%