XPath plugin

This commit is contained in:
Gregory Schier
2024-01-15 21:27:47 -08:00
parent 1e79f76701
commit c8bd4d0ae0
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 };
}