* [Caml-list] pxp question
@ 2004-04-26 10:42 Paul Argentoff
2004-04-26 11:30 ` Gerd Stolpmann
2004-04-26 11:44 ` Jacques GARRIGUE
0 siblings, 2 replies; 4+ messages in thread
From: Paul Argentoff @ 2004-04-26 10:42 UTC (permalink / raw)
To: caml-list
Hello World.
I'm a novice in pxp, so here is one of my firs problems: when I compile this:
...
let collector = find ~deeply:true (fun node -> node # id_attribute_value =
colr_name) collectors
...
I get:
This expression has type
('a Pxp_document.node #Pxp_document.extension as 'a) Pxp_document.node ->
'a Pxp_document.node
but is here used with type
('b Pxp_document.node #Pxp_document.extension as 'b) Pxp_document.node =
< add_node : ?force:bool -> 'b Pxp_document.node -> unit;
add_pinstr : Pxp_dtd.proc_instruction -> unit;
append_node : 'b Pxp_document.node -> unit;
attribute : string -> Pxp_core_types.att_value;
attribute_names : string list;
attribute_type : string -> Pxp_core_types.att_type;
attributes : (string * Pxp_core_types.att_value) list;
attributes_as_nodes : 'b Pxp_document.node list;
classify_data_node : 'b Pxp_document.node ->
Pxp_document.data_node_classification;
comment : string option; complement_attlist : unit -> unit;
create_data : Pxp_dtd.dtd -> string -> 'b Pxp_document.node;
create_element : ?name_pool_for_attribute_values:Pxp_core_types.pool ->
?position:string * int * int ->
?valcheck:bool ->
?att_values:(string * Pxp_core_types.att_value) list ->
Pxp_dtd.dtd ->
Pxp_document.node_type ->
(string * string) list -> 'b Pxp_document.node;
create_other : ?position:string * int * int ->
Pxp_dtd.dtd ->
Pxp_document.node_type -> 'b Pxp_document.node;
data : string; delete : unit; dtd : Pxp_dtd.dtd;
dump : Format.formatter -> unit;
encoding : Pxp_core_types.rep_encoding; extension : 'b;
id_attribute_name : string; id_attribute_value : string;
idref_attribute_names : string list;
insert_nodes : ?pos:int -> 'b Pxp_document.node list -> unit;
internal_adopt : 'b Pxp_document.node option -> int -> unit;
internal_delete : 'b Pxp_document.node -> unit;
internal_init : string * int * int ->
Pxp_core_types.pool option ->
bool ->
Pxp_dtd.dtd ->
string ->
(string * string) list ->
(string * Pxp_core_types.att_value) list -> unit;
internal_init_other : string * int * int ->
Pxp_dtd.dtd -> Pxp_document.node_type -> unit;
internal_set_pos : int -> unit;
iter_nodes : ('b Pxp_document.node -> unit) -> unit;
iter_nodes_sibl : ('b Pxp_document.node option ->
'b Pxp_document.node ->
'b Pxp_document.node option -> unit) ->
unit;
local_validate : ?use_dfa:bool ->
?check_data_nodes:bool -> unit -> unit;
localname : string; namespace_info : 'b Pxp_document.namespace_info;
namespace_manager : Pxp_dtd.namespace_manager; namespace_uri :
string; next_node : 'b Pxp_document.node; node_path : int list;
node_position : int; node_type : Pxp_document.node_type;
normprefix : string; nth_node : int -> 'b Pxp_document.node;
optional_list_attribute : string -> string list;
optional_string_attribute : string -> string option;
orphaned_clone : 'b Pxp_document.node;
orphaned_flat_clone : 'b Pxp_document.node;
parent : 'b Pxp_document.node;
pinstr : string -> Pxp_dtd.proc_instruction list;
pinstr_names : string list; position : string * int * int;
previous_node : 'b Pxp_document.node;
quick_set_attributes : (string * Pxp_core_types.att_value) list -> unit;
remove : unit -> unit;
remove_nodes : ?pos:int -> ?len:int -> unit -> unit;
required_list_attribute : string -> string list;
required_string_attribute : string -> string;
reset_attribute : string -> unit; root : 'b Pxp_document.node;
set_attribute : ?force:bool ->
string -> Pxp_core_types.att_value -> unit;
set_attributes : (string * Pxp_core_types.att_value) list -> unit;
set_comment : string option -> unit; set_data : string -> unit;
set_namespace_info : 'b Pxp_document.namespace_info option -> unit;
set_nodes : 'b Pxp_document.node list -> unit;
sub_nodes : 'b Pxp_document.node list; validate : unit -> unit;
validate_attlist : unit -> unit;
validate_contents : ?use_dfa:bool ->
?check_data_nodes:bool -> unit -> unit;
write : ?prefixes:string list ->
?default:string ->
Pxp_core_types.output_stream -> Pxp_core_types.encoding -> unit
>
Maybe I haven't understood the idea of Pxp_document.find function?
--
Yours truly, WBR, Paul Argentoff.
Jabber: paul@jabber.rtelekom.ru
RIPE: PA1291-RIPE
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] pxp question
2004-04-26 10:42 [Caml-list] pxp question Paul Argentoff
@ 2004-04-26 11:30 ` Gerd Stolpmann
2004-04-26 12:02 ` Paul Argentoff
2004-04-26 11:44 ` Jacques GARRIGUE
1 sibling, 1 reply; 4+ messages in thread
From: Gerd Stolpmann @ 2004-04-26 11:30 UTC (permalink / raw)
To: argentoff; +Cc: caml-list
Am Mon, 2004-04-26 um 12.42 schrieb Paul Argentoff:
> Hello World.
>
> I'm a novice in pxp, so here is one of my firs problems: when I compile this:
> ...
> let collector = find ~deeply:true (fun node -> node # id_attribute_value =
> colr_name) collectors
> ...
> I get:
I think this snippet of code is not enough to see the error. The error
message looks like as if [collectors] is a function, and of course,
[find] expects that it is a node.
Gerd
> This expression has type
> ('a Pxp_document.node #Pxp_document.extension as 'a) Pxp_document.node ->
> 'a Pxp_document.node
> but is here used with type
> ('b Pxp_document.node #Pxp_document.extension as 'b) Pxp_document.node =
> < add_node : ?force:bool -> 'b Pxp_document.node -> unit;
> add_pinstr : Pxp_dtd.proc_instruction -> unit;
> append_node : 'b Pxp_document.node -> unit;
> attribute : string -> Pxp_core_types.att_value;
> attribute_names : string list;
> attribute_type : string -> Pxp_core_types.att_type;
> attributes : (string * Pxp_core_types.att_value) list;
> attributes_as_nodes : 'b Pxp_document.node list;
> classify_data_node : 'b Pxp_document.node ->
> Pxp_document.data_node_classification;
> comment : string option; complement_attlist : unit -> unit;
> create_data : Pxp_dtd.dtd -> string -> 'b Pxp_document.node;
> create_element : ?name_pool_for_attribute_values:Pxp_core_types.pool ->
> ?position:string * int * int ->
> ?valcheck:bool ->
> ?att_values:(string * Pxp_core_types.att_value) list ->
> Pxp_dtd.dtd ->
> Pxp_document.node_type ->
> (string * string) list -> 'b Pxp_document.node;
> create_other : ?position:string * int * int ->
> Pxp_dtd.dtd ->
> Pxp_document.node_type -> 'b Pxp_document.node;
> data : string; delete : unit; dtd : Pxp_dtd.dtd;
> dump : Format.formatter -> unit;
> encoding : Pxp_core_types.rep_encoding; extension : 'b;
> id_attribute_name : string; id_attribute_value : string;
> idref_attribute_names : string list;
> insert_nodes : ?pos:int -> 'b Pxp_document.node list -> unit;
> internal_adopt : 'b Pxp_document.node option -> int -> unit;
> internal_delete : 'b Pxp_document.node -> unit;
> internal_init : string * int * int ->
> Pxp_core_types.pool option ->
> bool ->
> Pxp_dtd.dtd ->
> string ->
> (string * string) list ->
> (string * Pxp_core_types.att_value) list -> unit;
> internal_init_other : string * int * int ->
> Pxp_dtd.dtd -> Pxp_document.node_type -> unit;
> internal_set_pos : int -> unit;
> iter_nodes : ('b Pxp_document.node -> unit) -> unit;
> iter_nodes_sibl : ('b Pxp_document.node option ->
> 'b Pxp_document.node ->
> 'b Pxp_document.node option -> unit) ->
> unit;
> local_validate : ?use_dfa:bool ->
> ?check_data_nodes:bool -> unit -> unit;
> localname : string; namespace_info : 'b Pxp_document.namespace_info;
> namespace_manager : Pxp_dtd.namespace_manager; namespace_uri :
> string; next_node : 'b Pxp_document.node; node_path : int list;
> node_position : int; node_type : Pxp_document.node_type;
> normprefix : string; nth_node : int -> 'b Pxp_document.node;
> optional_list_attribute : string -> string list;
> optional_string_attribute : string -> string option;
> orphaned_clone : 'b Pxp_document.node;
> orphaned_flat_clone : 'b Pxp_document.node;
> parent : 'b Pxp_document.node;
> pinstr : string -> Pxp_dtd.proc_instruction list;
> pinstr_names : string list; position : string * int * int;
> previous_node : 'b Pxp_document.node;
> quick_set_attributes : (string * Pxp_core_types.att_value) list -> unit;
> remove : unit -> unit;
> remove_nodes : ?pos:int -> ?len:int -> unit -> unit;
> required_list_attribute : string -> string list;
> required_string_attribute : string -> string;
> reset_attribute : string -> unit; root : 'b Pxp_document.node;
> set_attribute : ?force:bool ->
> string -> Pxp_core_types.att_value -> unit;
> set_attributes : (string * Pxp_core_types.att_value) list -> unit;
> set_comment : string option -> unit; set_data : string -> unit;
> set_namespace_info : 'b Pxp_document.namespace_info option -> unit;
> set_nodes : 'b Pxp_document.node list -> unit;
> sub_nodes : 'b Pxp_document.node list; validate : unit -> unit;
> validate_attlist : unit -> unit;
> validate_contents : ?use_dfa:bool ->
> ?check_data_nodes:bool -> unit -> unit;
> write : ?prefixes:string list ->
> ?default:string ->
> Pxp_core_types.output_stream -> Pxp_core_types.encoding -> unit
> >
>
> Maybe I haven't understood the idea of Pxp_document.find function?
> --
> Yours truly, WBR, Paul Argentoff.
> Jabber: paul@jabber.rtelekom.ru
> RIPE: PA1291-RIPE
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>
>
--
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de
------------------------------------------------------------
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] pxp question
2004-04-26 10:42 [Caml-list] pxp question Paul Argentoff
2004-04-26 11:30 ` Gerd Stolpmann
@ 2004-04-26 11:44 ` Jacques GARRIGUE
1 sibling, 0 replies; 4+ messages in thread
From: Jacques GARRIGUE @ 2004-04-26 11:44 UTC (permalink / raw)
To: argentoff; +Cc: caml-list
From: Paul Argentoff <argentoff@rtelekom.ru>
> I'm a novice in pxp, so here is one of my firs problems: when I compile this:
> ...
> let collector = find ~deeply:true (fun node -> node # id_attribute_value =
> colr_name) collectors
> ...
> I get:
>
> This expression has type
> ('a Pxp_document.node #Pxp_document.extension as 'a) Pxp_document.node ->
> 'a Pxp_document.node
> but is here used with type
> ('b Pxp_document.node #Pxp_document.extension as 'b) Pxp_document.node =
[...]
I am no expert in PXP, but this error message simply tells you that
you are passing a function where a node is expected (unfortunately you
didn't show the position highlighted by the error).
Looking at the type of find in the PXP manual, it looks like your
"collectors" is a function.
This kind of thing can happen when using let...in and forgetting an
argument; it gets a bit of habit to see what can cause an error.
Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-04-26 12:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-26 10:42 [Caml-list] pxp question Paul Argentoff
2004-04-26 11:30 ` Gerd Stolpmann
2004-04-26 12:02 ` Paul Argentoff
2004-04-26 11:44 ` Jacques GARRIGUE
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox