ldh-AddXHTMLBlock
Appends a well-formed XHTML block as canonical XML to a LinkedDataHub document using sequence properties, with optional title, description, and fragment identifier.
Instructions
Appends an XHTML block to a LinkedDataHub document using sequence properties. Only XHTML blocks and object blocks are shown in the content mode. Other resources can still be added to the document, but they will not be displayed in the content mode.
IMPORTANT: The value parameter must be canonical XML literal - well-formed XHTML content
that will be stored as rdf:XMLLiteral datatype.
The top-level XHTML element must be <div xmlns="http://www.w3.org/1999/xhtml"></div>.
The XHTML can use CSS classes for inline elements from Bootstrap 2.3.2, but no inline CSS styles.
Canonical XML Rules (TL;DR):
✅ Well-formed XML - proper opening/closing tags, escaped special chars (< > &)
✅ Attributes alphabetically ordered - <tag attr1="x" attr2="y"> not <tag attr2="y" attr1="x">
✅ No comments or processing instructions - strip <!-- --> and <?xml ?>
✅ Consistent encoding - UTF-8, normalized whitespace
Bottom line: Valid XML + deterministic formatting = canonical XML.
This tool:
- Fetches the current document to find the next sequence number (rdf:_1, rdf:_2, etc.)
- Creates an ldh:XHTML resource with rdf:value containing the XML literal
- Posts the new XHTML block to the target document
- Supports optional title, description, and fragment identifier
Returns True if the operation was successful, False otherwise.
Note: This operation does not return the updated graph, it only confirms the success of the operation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>",
"value": "<value>"
},
"name": "ldh-AddXHTMLBlock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URI of the document to append the XHTML block to. | |
| title | No | Optional title for the XHTML block. | |
| value | Yes | XHTML content as canonical XML literal (must be well-formed XML). | |
| fragment | No | Optional fragment identifier for the XHTML block URI (e.g., 'intro' creates #intro). | |
| description | No | Optional description for the XHTML block. |