Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      '// Note the change in section/div/h2
      Dim t = uc.NewTransformer()
      
      '// The parent rule will find the <section> block and make its content available to a local transformer.
      '// StatementSensitive(false) is needed so the multiline content is captured.
      Dim parentRule = t.Pattern("<section>{body}</section>")
      parentRule.StatementSensitive = false
      
      '// Get the local transformer for the <section> block.
      Dim section_t = parentRule.LocalTransformer
      
      '// These rules will ONLY run on the content inside the <section> tag.
      section_t.FromTo("<h2>{text}</h2>", "<h1>====> {@Eval: UCase(text)} <====</h1>")
      section_t.FromTo("<p>{text}</p>", "<p>SELECTED: {text}</p>")
      
      Dim sourceHtml =
      "
<div>
  <h2>Article One</h2>
  <p>This is NOT in the section.</p>
</div>

<section>
  <div>
    <h2>Article Two</h2>
    <p>This one IS inside the section.</p>
  </div>
</section>
"
      
      t.Text = sourceHtml
      t.Transform()
      Console.WriteLine(t.Text)
   End Sub
End Module