Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
7adc4fb0
Commit
7adc4fb0
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2005-02-17 14:46:44 by afrisch] Rework schema
Original author: afrisch Date: 2005-02-17 14:46:44+00:00
parent
9aca22a4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
schema/schema_parser.ml
View file @
7adc4fb0
This diff is collapsed.
Click to expand it.
schema/schema_xml.ml
View file @
7adc4fb0
...
...
@@ -75,6 +75,11 @@ let _may_elem e (n: node) =
try
Some
(
Pxp_document
.
find_element
e
n
)
with
Not_found
->
None
let
_elems
e
n
=
Pxp_document
.
find_all_elements
e
n
let
_filter_elems
p
n
=
Pxp_document
.
find_all
(
fun
n
->
match
n
#
node_type
with
|
Pxp_document
.
T_element
s
->
List
.
mem
s
p
|
_
->
false
)
n
let
_line
n
=
match
n
#
position
with
(
_
,
l
,_
)
->
l
...
...
@@ -86,6 +91,16 @@ let _iter_elems n f = n#iter_nodes
|
Pxp_document
.
T_element
s
->
f
n
s
|
_
->
()
)
let
_fold_elems
n
x
f
=
let
x
=
ref
x
in
n
#
iter_nodes
(
fun
n
->
match
n
#
node_type
with
|
Pxp_document
.
T_element
s
->
x
:=
f
!
x
n
s
|
_
->
()
);
!
x
let
_tag
n
=
match
n
#
node_type
with
...
...
schema/schema_xml.mli
View file @
7adc4fb0
...
...
@@ -11,11 +11,13 @@ val _is_attr: string -> node -> string -> bool
val
_attr
:
string
->
node
->
Utf8
.
t
val
_may_elem
:
string
->
node
->
node
option
val
_elems
:
string
->
node
->
node
list
val
_filter_elems
:
string
list
->
node
->
node
list
val
_line
:
node
->
int
val
_iter_nodes
:
node
->
(
node
->
unit
)
->
unit
val
_iter_elems
:
node
->
(
node
->
string
->
unit
)
->
unit
val
_fold_elems
:
node
->
'
a
->
(
'
a
->
node
->
string
->
'
a
)
->
'
a
val
_tag
:
node
->
string
val
_has_tag
:
node
->
(
string
->
bool
)
->
bool
val
_namespaces
:
node
->
(
string
*
string
)
list
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment