Data Processing
使用XPath表达式从XML文档中提取值。非常适合从复杂的嵌套XML结构、API响应、RSS源和配置文件中提取特定数据。
Rufen Sie dieses Werkzeug aus Ihrem Code in drei Sprachen auf.
curl -X POST 'https://api.elysiatools.com/de/api/tools/xml-path-extractor' \
-H 'Content-Type: application/json' \
-d '{"xmlInput":"Enter your XML data...","xpathExpressions":"//*","outputFormat":"list","includePaths":true,"includeAttributes":false,"flattenArrays":true,"preserveOrder":true,"namespaceAware":false,"nullValues":false}'Senden Sie eine POST-Anfrage mit Ihren Eingaben als JSON. Dateiparameter erfordern einen vorherigen Upload.
POST https://api.elysiatools.com/de/api/tools/xml-path-extractor| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
| xmlInput | textarea | Ja | — |
| xpathExpressions | textarea | Nein | XPath expressions to extract values. Examples: //* - All elements //book/title - All book titles //person[@age>18] - Persons older than 18 Leave empty to extract all elements |
| outputFormat | select | Ja | — |
| includePaths | checkbox | Nein | Include the XPath expression used for each extraction |
| includeAttributes | checkbox |
Fügen Sie dieses Werkzeug Ihrem Model-Context-Protocol-Server hinzu, damit KI-Agenten es auflisten und aufrufen können.
Fügen Sie diesen Block Ihrer MCP-Client-Konfiguration hinzu:
{
"mcpServers": {
"elysiatools-xml-path-extractor": {
"name": "xml-path-extractor",
"description": "使用XPath表达式从XML文档中提取值。非常适合从复杂的嵌套XML结构、API响应、RSS源和配置文件中提取特定数据。",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=xml-path-extractor",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Nach dem Verbinden mit dem SSE-Endpunkt listen Sie die bereitgestellten Werkzeuge auf:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Rufen Sie das Werkzeug über seine ID auf; Argumente werden aus seiner Parameterliste gebildet:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "xml-path-extractor",
"arguments": {
"xmlInput": "Enter your XML data...",
"xpathExpressions": "//*",
"outputFormat": "list",
"includePaths": true,
"includeAttributes": false,
"flattenArrays": true,
"preserveOrder": true,
"namespaceAware": false,
"nullValues": false
}
}
}| Nein |
| Include attributes for extracted elements |
| flattenArrays | checkbox | Nein | Treat multiple results as individual items instead of arrays |
| preserveOrder | checkbox | Nein | Maintain the original order of elements in the XML document |
| namespaceAware | checkbox | Nein | Enable namespace-aware XPath evaluation |
| nullValues | checkbox | Nein | Include empty elements and null values in the extraction results |
Textergebnis
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Fragen oder Probleme? Kontakt: [email protected]