HttpClient

From EXPath

Revision as of 18:13, 8 January 2010 by FGeorges (Talk | contribs)
Jump to: navigation, search

The HTTP Client module provides a way to send an HTTP request and deal with its response from XPath expressions. The homepage of the module is: http://www.expath.org/modules/http-client/. There are also specific info for the implementation for Saxon.

Contents

Todo

  • Integrate the changes to the serialization part (below) into the spec.
  • Improve error reporting, see for instance the following thread.

Testing

See this interesting discussion about testing HTTP Client implementations.

Schemas

Markus Pilman, from the FLWOR foundation, contributed an XSD schema for the elements in the http:* namespace (request, response, header, etc.): File:Http-client-mpilman.xsd.

Serialization

Proposed change to the current draft, regarding the serialization of bodies. It should be possible to set any serialization parameter, as defined in XSLT and XQuery Serialization 1.1. Consistently with the current definition of fn:serialize(), @use-character-maps cannot be used. The @format attribute, which was introduced after xsl:result-document, has been removed too (at least one leading XSLT 2.0 processor does not allow an extension function to access the named output definitions, see this thread).

The @src attribute is not in Serialization 1.1. It is mutually exclusive with all other attributes (except the required @media-type). The method "binary" has been added too (must be defined precisely, but normally should only accept xs:base64Binary and xs:hexBinary items and serialize them as binary).

<http:body media-type = { string }
           src? = uri
           method? = { "xml" | "html" | "xhtml" | "text" | "binary"
             | qname-but-not-ncname }
           byte-order-mark? = { "yes" | "no" }
           cdata-section-elements? = { qnames }
           doctype-public? = { string }
           doctype-system? = { string }
           encoding? = { string }
           escape-uri-attributes? = { "yes" | "no" }
           include-content-type? = { "yes" | "no" }
           indent? = { "yes" | "no" }
           normalization-form? = { "NFC" | "NFD" | "NFKC" | "NFKD"
             | "fully-normalized" | "none" | nmtoken }
           omit-xml-declaration? = { "yes" | "no" }
           standalone? = { "yes" | "no" | "omit" }
           suppress-indentation? = { qnames }
           undeclare-prefixes? = { "yes" | "no" }
           output-version? = { nmtoken }>
   any*
</http:body>
Personal tools