This repository was archived by the owner on Nov 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
XML Namespace Management
isubiker edited this page Nov 11, 2011
·
11 revisions
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.
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:
- /manage/namespace/myns?uri=http://example.com/myns
To get a list of all the namespaces that are configured, make a GET request to:
/manage/namespaces
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
{
"prefix": "myns",
"uri": "http://example.com/myns"
}
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