XPath plugin

This commit is contained in:
Gregory Schier committed 2024-01-15 21:27:47 -08:00
1 parent 1e79f76701
commit c8bd4d0ae0
15 files changed
+8542 -133

No files matched your search

+8
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 };
}