Class RelaxNGUtils

java.lang.Object
org.eclipse.lemminx.extensions.relaxng.utils.RelaxNGUtils

public class RelaxNGUtils extends Object
RelaxNG utilities.
Author:
Angelo ZERR
  • Field Details

  • Constructor Details

    • RelaxNGUtils

      public RelaxNGUtils()
  • Method Details

    • createFilesChangedTracker

      public static FilesChangedTracker createFilesChangedTracker(RelaxNGGrammar grammar)
    • getBindingType

      public 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).
      Parameters:
      originAttr - the origin attribute (ex : ref/@name)
      Returns:
      the binding type of the origin attribute (ex : ref/@name) which bounds an another target attribute (ex : define/@name).
    • searchRNGTargetAttributes

      public 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.
      Parameters:
      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.
    • searchRNGOriginAttributes

      public static void searchRNGOriginAttributes(DOMNode targetNode, BiConsumer<DOMAttr,DOMAttr> collector, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
      Search origin attributes from the given target node..
      Parameters:
      targetNode - the referenced node
      collector - the collector to collect reference between an origin and target attribute.
    • isInclude

      public static boolean isInclude(Element element)
    • isExternalRef

      public static boolean isExternalRef(Element element)
    • isDefine

      public static boolean isDefine(Element element)
    • isRef

      public static boolean isRef(Element element)
    • isRNGTargetElement

      public static boolean isRNGTargetElement(Element element)
      Returns true if the given element is an RNG target element (define element) and false otherwise.
      Parameters:
      element - the DOM element.
      Returns:
      true if the given element is an RNG target element (define element) and false otherwise.
    • getHref

      public static DOMAttr getHref(DOMElement element)