XML路径提取器
使用XPath表达式从XML文档中提取值。非常适合从复杂的嵌套XML结构、API响应、RSS源和配置文件中提取特定数据。
API 文档
请求端点
POST /zh/api/tools/xml-path-extractor
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| xmlInput | textarea | 是 | - |
| xpathExpressions | textarea | 否 | XPath表达式用于提取值。示例: //* - 所有元素 //book/title - 所有书籍标题 //person[@age>18] - 年龄大于18岁的人 留空则提取所有元素 |
| outputFormat | select | 是 | - |
| includePaths | checkbox | 否 | 包含每次提取使用的XPath表达式 |
| includeAttributes | checkbox | 否 | 包含提取元素的属性 |
| flattenArrays | checkbox | 否 | 将多个结果视为单个项目而不是数组 |
| preserveOrder | checkbox | 否 | 保持XML文档中元素的原始顺序 |
| namespaceAware | checkbox | 否 | 启用命名空间感知的XPath评估 |
| nullValues | checkbox | 否 | 在提取结果中包含空元素和null值 |
响应格式
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}
文本:
文本
AI MCP 文档
将此工具添加到您的 MCP 服务器配置中:
{
"mcpServers": {
"elysiatools-xml-path-extractor": {
"name": "xml-path-extractor",
"description": "使用XPath表达式从XML文档中提取值。非常适合从复杂的嵌套XML结构、API响应、RSS源和配置文件中提取特定数据。",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=xml-path-extractor",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。
如果遇见问题,请联系我们:[email protected]