XML Namespace Management

isubiker edited this page Nov 11, 2011 · 11 revisions

XML Namespace Management

XML namespaces can be tedious, but useful. Before any namespaced XML can be indexed or queried, a prefix for the namespace must be defined, even if the XML doesn't use a namespace prefix.

Declare a namespace

Assignes a namespace prefix to a namespace URI. This prefix can be used to build indexes and queries. If the prefix already exists it is overwritten with the new namespace URI.

  • Endpoint: /manage/namespace/<prefix>
  • Request type: POST
  • Returns:
    • If the prefix was successfully defined a 200 is returned
    • If the prefix is not a legal XML namespace prefix a 400 is returned
  • Examples:

Get a list of all configured namespaces

To get a list of all the namespaces that are configured, make a GET request to:

/manage/namespaces

Get info about a namespace

Returns the namespace URI for a given prefix

  • Endpoint: /manage/namespace/<prefix>
  • Request type: GET
  • Returns:
    • If the namespace prefix is defined a 200 is returned with the body being a JSON document that provides info about the namespace.
    • If the namespace prefix is undefined a 404 is returned
  • Example:
    • /manage/namespace/myns

Sample Response

{
    "prefix": "myns",
    "uri": "http://example.com/myns"
}

Delete a namespace definition

Removes the namespace definition from the database. Once removed, queries using this namespace prefix will no longer work.

  • Endpoint: /manage/namespace/<prefix>
  • Request type: DELETE
  • Returns:
    • If the namespace prefix was deleted a 200 is returned with an empty response
    • If the namespace prefix is undefined a 404 is returned
  • Example:
    • /manage/namespace/myns
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.