[Ocaml-pxp-users] Several questions about PXP API

Richard Jones rich at annexia.org
Mon May 16 05:51:50 PDT 2005


Thanks for answering those questions.

Now of course I have some further ones.

Why does the document I create look like this:

<Envelope
><Body
><show
><campaign
><dailyBudget
 (etc)

Is it possible to get rid of the newlines and add the <?xml
version="1.0" encoding="UTF-8"?> at the beginning?  I'm using the
#write method on the root element (not knowing how to create a
document, or if this is necessary).

Also, I'm using the following code to parse the response from the
server:

  let data = msg#get_resp_body () in
  let doc =
    let config = Pxp_types.default_namespace_config in
    let spec = Pxp_tree_parser.default_namespace_spec in
    let src = Pxp_types.from_string data in
    Pxp_tree_parser.parse_wfdocument_entity config src spec in
  let root = doc#root in
  (* for debugging: *)
  root#display (`Out_channel stdout) `Enc_utf8;

The code crashes during the root#display method.

The document being received and parsed is:

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><showResponse xmlns="" xsi:nil="true" /></soap:Body></soap:Envelope>

and the root#display function gets as far as printing out <soap:Body
before crashing with

Fatal error: exception Pxp_core_types.Namespace_prefix_not_managed("")

How do I solve this one?

Thanks,

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com



More information about the Ocaml-pxp-users mailing list