Commit e9cf6b90 authored by gerd's avatar gerd

New function namespace_split.


git-svn-id: https://godirepo.camlcity.org/svn/lib-pxp/[email protected] dbe99aee-44db-0310-b2b3-d33182c8eb97
parent 87ea59e2
(* $Id: pxp_aux.ml,v 1.9 2001/02/01 20:38:49 gerd Exp $
(* $Id: pxp_aux.ml,v 1.10 2001/05/17 21:38:53 gerd Exp $
* ----------------------------------------------------------------------
* PXP: The polymorphic XML parser for Objective Caml.
* Copyright by Gerd Stolpmann. See LICENSE for details.
......@@ -527,6 +527,22 @@ let normalize_public_id s =
;;
(**********************************************************************)
let namespace_split name =
(* Searches ':' in name and returns (prefix, localname).
* If there is no ':', prefix = "".
*)
try
let n = String.index name ':' in (* may raise Not_found *)
let prefix = String.sub name 0 n in
let localname = String.sub name (n+1) (String.length name - n - 1)
in
(prefix, localname)
with
Not_found -> ("", name)
;;
(**********************************************************************)
let write_markup_string ~(from_enc:rep_encoding) ~to_enc os s =
......@@ -618,6 +634,9 @@ let write_data_string ~(from_enc:rep_encoding) ~to_enc os content =
* History:
*
* $Log: pxp_aux.ml,v $
* Revision 1.10 2001/05/17 21:38:53 gerd
* New function namespace_split.
*
* Revision 1.9 2001/02/01 20:38:49 gerd
* New support for PUBLIC identifiers.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment