public class RelaxNGUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RelaxNGUtils.BindingType
Binding type of rng grammar
|
Constructor and Description |
---|
RelaxNGUtils() |
Modifier and Type | Method and Description |
---|---|
static FilesChangedTracker |
createFilesChangedTracker(RelaxNGGrammar grammar) |
static RelaxNGUtils.BindingType |
getBindingType(DOMAttr originAttr)
Returns the binding type of the origin attribute (ex : ref/@name) which
bounds an another
target attribute (ex : define/@name).
|
static DOMAttr |
getHref(DOMElement element) |
static boolean |
isDefine(Element element) |
static boolean |
isExternalRef(Element element) |
static boolean |
isInclude(Element element) |
static boolean |
isRNGTargetElement(Element element)
Returns true if the given element is an RNG target element (define element)
and false
otherwise.
|
static void |
searchRNGOriginAttributes(DOMNode targetNode,
BiConsumer<DOMAttr,DOMAttr> collector,
org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
Search origin attributes from the given target node..
|
static void |
searchRNGTargetAttributes(DOMAttr originAttr,
RelaxNGUtils.BindingType bindingType,
boolean matchAttr,
boolean searchInExternalSchema,
BiConsumer<String,DOMAttr> collector)
Collect RNG target attributes declared in the RNG grammar according the given
attribute and binding type.
|
public static FilesChangedTracker createFilesChangedTracker(RelaxNGGrammar grammar)
public static RelaxNGUtils.BindingType getBindingType(DOMAttr originAttr)
originAttr
- the origin attribute (ex : ref/@name)public static void searchRNGTargetAttributes(DOMAttr originAttr, RelaxNGUtils.BindingType bindingType, boolean matchAttr, boolean searchInExternalSchema, BiConsumer<String,DOMAttr> collector)
originAttr
- the origin attribute.matchAttr
- true if the attribute value must match the
value of target attribute value and false
otherwise.searchInExternalSchema
- true if search must be done in included XML
Schema (include) and false otherwise.collector
- collector to collect RNG target attributes.public static void searchRNGOriginAttributes(DOMNode targetNode, BiConsumer<DOMAttr,DOMAttr> collector, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
targetNode
- the referenced nodecollector
- the collector to collect reference between an origin and
target attribute.public static boolean isInclude(Element element)
public static boolean isExternalRef(Element element)
public static boolean isDefine(Element element)
public static boolean isRNGTargetElement(Element element)
element
- the DOM element.public static DOMAttr getHref(DOMElement element)
Copyright © 2022. All rights reserved.