xs.property()

Read(508) Label: node strings, property values,

Description:

Read property values from node strings.

Syntax:

xs.property(n,v)

Note:

The function returns values under node n in node strings xs. Set n’s value as v if string parameter v is present, and delete n if v is absent.

Parameter:

xs

Node strings, whose format isname1=value1 name2=value2...

n

Node string name; return a table sequence made up of all properties when it is absent

v

Null or a string

Option:

@c

Separate node strings by commas or semicolons; use spaces by default

@j

Use colons to separate node string name and its value; use the equal sign by default

@q

Enclose values by double quotation marks

@v

Read the string and then parse it into value; return a sequence by default

Return value:

A value/a sequence

Example:

 

A

 

1

color=red size=20 price=500

 

2

=A1.property("color","blue")

Change the value of node string named “color” into “blue” .

3

=A1.property@q("size")

Enclose the value with double quotation marks.

4

=A1.property@v("size")

Read the string first and then parse it into a value.

5

color:red;size:20;price:500

 

6

=A5.property@cj("color",)

Use @c option to separate node string by semicolons; use @j to separate node string name and value by colon; since the value of “color” is null, delete the node from the node strings.