@tradik/xslt-processor 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.js ADDED
@@ -0,0 +1,66 @@
1
+ /**
2
+ * xslt-processor
3
+ *
4
+ * JavaScript implementation of XSLTProcessor for browser environments.
5
+ *
6
+ * This package provides a JavaScript implementation of the W3C XSLTProcessor API
7
+ * that can be used as a drop-in replacement for the native browser implementation.
8
+ *
9
+ * Specifications implemented:
10
+ * - XPath 1.0: http://www.w3.org/TR/1999/REC-xpath-19991116
11
+ * - XSLT 1.0: http://www.w3.org/TR/1999/REC-xslt-19991116
12
+ * - DOM Level 3: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/
13
+ *
14
+ * @example
15
+ * // ESM import
16
+ * import { XSLTProcessor, installGlobal } from 'xslt-processor';
17
+ *
18
+ * // Install as global replacement
19
+ * installGlobal();
20
+ *
21
+ * // Or use directly
22
+ * const processor = new XSLTProcessor();
23
+ * processor.importStylesheet(xsltDoc);
24
+ * const result = processor.transformToFragment(xmlDoc, document);
25
+ */
26
+
27
+ // Main XSLTProcessor class
28
+ export {
29
+ XSLTProcessor,
30
+ isNativeXSLTSupported,
31
+ installGlobal,
32
+ default as default,
33
+ } from "./XSLTProcessor.js";
34
+
35
+ // XPath module (for advanced users)
36
+ export {
37
+ evaluate as evaluateXPath,
38
+ select as selectXPath,
39
+ selectFirst as selectFirstXPath,
40
+ XPathEvaluator,
41
+ XPathContext,
42
+ XPathResultType,
43
+ parse as parseXPath,
44
+ } from "./xpath/index.js";
45
+
46
+ // XSLT engine (for advanced users)
47
+ export { XsltEngine, XsltContext } from "./xslt/index.js";
48
+
49
+ /**
50
+ * Version information
51
+ */
52
+ export const VERSION = "1.0.0";
53
+
54
+ /**
55
+ * Check if we're running in a browser environment
56
+ */
57
+ export const isBrowser =
58
+ typeof window !== "undefined" && typeof document !== "undefined";
59
+
60
+ /**
61
+ * Check if we're running in Node.js
62
+ */
63
+ export const isNode =
64
+ typeof process !== "undefined" &&
65
+ process.versions != null &&
66
+ process.versions.node != null;