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
5dd595d0
Commit
5dd595d0
authored
Feb 28, 2011
by
Jérôme Maloberti
Browse files
Correct whitespace normalization in atomic types before validation.
parent
d8865607
Changes
1
Hide whitespace changes
Inline
Side-by-side
schema/schema_validator.ml
View file @
5dd595d0
...
...
@@ -267,13 +267,17 @@ struct
end
(** {2 Simple type validation} *)
let
rec
validate_simple_type
def
s
=
match
def
with
let
rec
validate_simple_type
def
s
=
match
def
with
|
{
st_name
=
Some
name
}
when
Schema_builtin
.
is
name
->
(
try
Schema_builtin
.
validate
(
Schema_builtin
.
get
name
)
s
with
Schema_builtin
.
Error
name
->
error
(
sprintf
"%s isn't a valid %s"
(
Utf8
.
to_string
s
)
name
))
let
value
=
(
match
def
with
{
st_variety
=
Atomic
st
;
st_facets
=
facets
}
->
normalize_white_space
(
fst
facets
.
whiteSpace
)
s
|
_
->
s
)
in
(
try
Schema_builtin
.
validate
(
Schema_builtin
.
get
name
)
value
with
Schema_builtin
.
Error
name
->
error
(
sprintf
"%s isn't a valid %s"
(
Utf8
.
to_string
value
)
name
))
|
{
st_variety
=
Atomic
st
;
st_facets
=
facets
}
->
let
literal
=
normalize_white_space
(
fst
facets
.
whiteSpace
)
s
in
let
value
=
validate_simple_type
st
literal
in
...
...
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