MCPcopy Create free account
hub / github.com/NaturalIntelligence/fast-xml-parser / MatcherView

Class MatcherView

src/fxp.d.ts:85–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 * This is the type received by all FXP user callbacks when `jPath: false`.
84 */
85export class MatcherView {
86 readonly separator: string;
87
88 /** Check if current path matches an Expression. */
89 matches(expression: Expression): boolean;
90
91 /** Get current tag name, or `undefined` if path is empty. */
92 getCurrentTag(): string | undefined;
93
94 /** Get current namespace, or `undefined` if not present. */
95 getCurrentNamespace(): string | undefined;
96
97 /** Get attribute value of the current node. */
98 getAttrValue(attrName: string): any;
99
100 /** Check if the current node has a given attribute. */
101 hasAttr(attrName: string): boolean;
102
103 /** Sibling position of the current node (child index in parent). */
104 getPosition(): number;
105
106 /** Occurrence counter of the current tag name at this level. */
107 getCounter(): number;
108
109 /** Number of nodes in the current path. */
110 getDepth(): number;
111
112 /** Current path as a string (e.g. `"root.users.user"`). */
113 toString(separator?: string, includeNamespace?: boolean): string;
114
115 /** Current path as an array of tag names. */
116 toArray(): string[];
117}
118
119/**
120 * @deprecated Use {@link MatcherView} instead.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected