- let d =
- (* sets the current base uri to resolve relative URIs *)
- CicParser3.current_sp := tokens_of_uri uri ;
- CicParser3.current_uri := uri ;
- let config = {Y.default_config with Y.warner = new warner} in
- Y.parse_document_entity config
-(*PXP (Y.ExtID (Pxp_types.System filename,
- new Pxp_reader.resolve_as_file ~url_of_id ()))
-*) (PxpUriResolver.from_file filename)
- CicParser3.domspec
+ let root, rootbody =
+ let config = {Y.default_config with Y.warner = new warner} in
+ let doc =
+ Y.parse_document_entity config
+ (Y.from_file ~alt:[PxpUrlResolver.url_resolver] filename)
+ CicParser3.domspec in
+ let docroot = doc#root in
+ match filenamebody with
+ None -> docroot,None
+ | Some filename ->
+ let docbody =
+ Y.parse_document_entity config
+ (Y.from_file ~alt:[PxpUrlResolver.url_resolver] filename)
+ CicParser3.domspec
+ in
+ docroot,Some docbody#root