===================================
Metavariable tag
===================================
<$X>foo</$X>
---

(document
  (element
    (start_tag (semgrep_start_tag (semgrep_metavariable)))
    (text)
    (end_tag (semgrep_end_tag (semgrep_metavariable)))))

===================================
Metavariable attribute
===================================
<span $X="foo">Hello</span>

---

(document
  (element
    (start_tag (tag_name)
       (attribute (attribute_name) (quoted_attribute_value (attribute_value))))
    (text)
    (end_tag (tag_name))))

===================================
Metavariable attribute value
===================================
<span a="$X">Hello</span>

---

(document
  (element
    (start_tag (tag_name)
       (attribute (attribute_name) (quoted_attribute_value (attribute_value))))
    (text)
    (end_tag (tag_name))))

===================================
Metavariable body
===================================
<span>$BODY</span>

---
(document
   (element
      (start_tag (tag_name))
      (text)
      (end_tag (tag_name))))

===================================
Ellipsis in attributes and body
===================================

<script ... >...</script>

---
(document
  (script_element
     (start_tag (tag_name) (attribute (attribute_name)))
     (raw_text)
     (end_tag (tag_name))))

===================================
XML constructs
===================================

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"></xs:schema>

---
(document
      (xmldoctype
        (attribute
          (attribute_name)
          (quoted_attribute_value
            (attribute_value)))
        (attribute
          (attribute_name)
          (quoted_attribute_value
            (attribute_value))))
      (element
        (start_tag
          (tag_name)
          (attribute
            (attribute_name)
            (quoted_attribute_value
              (attribute_value))))
        (end_tag
          (tag_name))))

===================================
Attribute pattern
===================================
foo="true"
---
(document
      (toplevel_attribute
        (attribute_name)
        (quoted_attribute_value
          (attribute_value))))
