File: xmerl_xpath.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (97 lines) | stat: -rw-r--r-- 2,425 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.TH xmerl_xpath 3 "xmerl  1.1.9" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
xmerl_xpath \- The xmerl_xpath module handles the entire XPath 1\&.0 spec XPath expressions typically occurs in XML attributes and are used to addres parts of an XML document\&.
.SH DESCRIPTION
.LP
The xmerl_xpath module handles the entire XPath 1\&.0 spec XPath expressions typically occurs in XML attributes and are used to addres parts of an XML document\&. The grammar is defined in \fIxmerl_xpath_parse\&.yrl\fR\&. The core functions are defined in \fIxmerl_xpath_pred\&.erl\fR\&.
.LP
Some useful shell commands for debugging the XPath parser

.nf
 c(xmerl_xpath_scan)\&.
 yecc:yecc("xmerl_xpath_parse\&.yrl", "xmerl_xpath_parse", true, [])\&.
 c(xmerl_xpath_parse)\&.

 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("position() > -1"))\&.
 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("5 * 6 div 2"))\&.
 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("5 + 6 mod 2"))\&.
 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("5 * 6"))\&.
 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("-----6"))\&.
 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("parent::node()"))\&.
 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("descendant-or-self::node()"))\&.
 xmerl_xpath_parse:parse(xmerl_xpath_scan:tokens("parent::processing-instruction(\&'foo\&')"))\&.
  
.fi

.SH DATA TYPES
.RS 2
.TP 4
.B
\fIdocEntity() = xmlElement() | xmlAttribute() | xmlText() | xmlPI() | xmlComment()\fR:

.TP 4
.B
\fInodeEntity() = xmlElement() | xmlAttribute() | xmlText() | xmlPI() | xmlNamespace() | xmlDocument()\fR:

.TP 4
.B
\fIoption_list()\fR:

.RS 4
.LP
Options allows to customize the behaviour of the XPath scanner\&. 
.LP
Possible options are: 
.RS 2
.TP 4
.B
\fI{namespace, #xmlNamespace}\fR:
Set namespace nodes, from XmlNamspace, in xmlContext
.TP 4
.B
\fI{namespace, Nodes}\fR:
Set namespace nodes in xmlContext\&.
.RE
.LP

.RE
.RE
.SH EXPORTS
.LP
.B
string(Str, Doc) -> docEntity()
.br
.RS
.LP
Equivalent to string(Str, Doc, [])\&.
.RE
.LP
.B
string(Str, Doc, Options) -> docEntity()
.br
.RS
.LP
Equivalent to string(Str, Doc, [], Doc, Options)\&.
.RE
.LP
.B
string(Str, Node, Parents, Doc, Options) -> docEntity()
.br
.RS
.TP
Types
Str = xPathString()
.br
Node = nodeEntity()
.br
Parents = parentList()
.br
Doc = nodeEntity()
.br
Options = option_list()
.br
.RE
.RS
.LP
Extracts the nodes from the parsed XML tree according to XPath\&.
.RE