Data Processing
使用XPath表达式从XML文档中提取值。非常适合从复杂的嵌套XML结构、API响应、RSS源和配置文件中提取特定数据。
Appelez cet outil depuis votre code en trois langages.
curl -X POST 'https://api.elysiatools.com/fr/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}'Envoyez une requête POST avec vos entrées en JSON. Les paramètres de type fichier nécessitent un upload préalable.
POST https://api.elysiatools.com/fr/api/tools/xml-path-extractor| Nom | Type | Requis | Description |
|---|---|---|---|
| xmlInput | textarea | Oui | — |
| xpathExpressions | textarea | Non | 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 | Oui | — |
| includePaths | checkbox | Non | Include the XPath expression used for each extraction |
| includeAttributes | checkbox |
Ajoutez cet outil à votre serveur Model Context Protocol pour que les agents IA puissent le lister et l'appeler.
Ajoutez ce bloc à la configuration de votre client MCP :
{
"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"
}
}
}Après connexion au point d'accès SSE, listez les outils exposés :
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Appelez l'outil par son id ; les arguments sont construits à partir de ses paramètres :
{
"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
}
}
}Des questions ou un problème ? Contactez [email protected]
| Non |
| Include attributes for extracted elements |
| flattenArrays | checkbox | Non | Treat multiple results as individual items instead of arrays |
| preserveOrder | checkbox | Non | Maintain the original order of elements in the XML document |
| namespaceAware | checkbox | Non | Enable namespace-aware XPath evaluation |
| nullValues | checkbox | Non | Include empty elements and null values in the extraction results |
Résultat texte
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}