XPath plugin

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