XPath plugin

This commit is contained in:
Gregory Schier
2024-01-15 21:27:47 -08:00
parent 5e75d8c9a7
commit d6331022ad
15 changed files with 8542 additions and 133 deletions

View File

@@ -0,0 +1,8 @@
import xpath from 'xpath';
import { DOMParser } from '@xmldom/xmldom';
export function pluginHookResponseFilter(filter, text) {
const doc = new DOMParser().parseFromString(text, 'text/xml');
const filtered = `${xpath.select(filter, doc)}`;
return { filtered };
}