title: Neko parser is stripping out <ul><li> tags when parsing HTML string
body: <p>I have a string that I want to transform to DocumentFragment. The problem is that the children <code>&lt;ul&gt;&lt;li&gt;... &lt;/li&gt;&lt;/ul&gt;</code>are being stripped completely. I don't know why this is happening.</p>
  
  <p>Any configuration that I need to add or update?</p>
  
  <p>Input</p>
  
  <pre><code>&lt;div class="faq-content-area"&gt;
  &lt;p&gt;You can receive Preferred Rewards benefits on your existing accounts, but you'll need:&lt;/p&gt;
  &lt;ul&gt;
  &lt;li&gt;A &lt;a target="_self" href="/deposits/savings/rewards-money-market-savings-account.go" id="rmms-prtfaq" name=""&gt;Rewards Money Market Savings account&lt;/a&gt; to receive the money market savings interest rate booster&lt;/li&gt;
  &lt;li&gt;An eligibile &lt;a target="_self" href="/credit-cards/overview.go" id="creditcard-prtfaq" name=""&gt;Bank of America credit card&lt;/a&gt;, such as BankAmericard Cash Rewards&amp;trade; or BankAmericard Travel Rewards&lt;sup&gt;&amp;reg;&lt;/sup&gt;, to receive the credit card rewards bonus&lt;/li&gt;
  &lt;/ul&gt;
  &lt;p&gt;After you enroll in Preferred Rewards, you can talk to a specialist to convert your existing money market savings account to a Rewards Money Market Savings account or to open a new credit card account that’s eligible for the rewards bonus.&lt;/p&gt;
  &lt;p&gt;If you already have a Rewards Money Market Savings account or an eligible credit card, you’ll automatically receive Preferred Rewards benefits after you enroll.&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The output is given below</p>
  
  <pre><code>&lt;DIV class="faq-content-area hide"&gt;
  &lt;P&gt;You can receive Preferred Rewards benefits on your existing accounts, but you'll need:&lt;/P&gt;    
  &lt;UL&gt;
  &lt;/UL&gt;
  &lt;/DIV&gt;
  </code></pre>
  
  <p>I don't know why this is happening.</p>
  
  <p>Java program</p>
  
  <pre><code>InputStream is = null;
      BufferedReader  br = null;
      InputSource iss = null;
      try {
        is = ClassLoader.getSystemResourceAsStream("test.txt");
        iss = new InputSource (is);
        DocumentFragment documentFragment = qaParser.parse(iss);
        System.out.println(qaParser.serialize(documentFragment));
        try {
          Path path = Paths.get("./qaAnswers.txt");
          //Files.write(path, sb.toString().getBytes(StandardCharsets.UTF_8));
          Files.write(
              path, 
              qaParser.serialize(
                  qaParser.parse(content)).getBytes(StandardCharsets.UTF_8));
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      } finally {
        if (is != null) {
          is.close();
        }
        if (br != null) {
          br.close();
        }
      }
  </code></pre>
  
  <p>Creating a DocumentFragment object.</p>
  
  <pre><code>DocumentFragment parse(InputSource input) throws Exception {
      DOMFragmentParser parser = new DOMFragmentParser();
      try {
        parser.setFeature("http://cyberneko.org/html/features/scanner/allow-selfclosing-iframe",
                true);
        parser.setFeature("http://cyberneko.org/html/features/augmentations",
                true);
        parser.setProperty("http://cyberneko.org/html/properties/default-encoding",
                defaultCharEncoding);
        parser.setFeature("http://cyberneko.org/html/features/scanner/ignore-specified-charset",
                true);
        parser.setFeature("http://cyberneko.org/html/features/balance-tags/ignore-outside-content",
                false);
        parser.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment",
                true);
        parser.setFeature("http://cyberneko.org/html/features/report-errors",
                LOG.isTraceEnabled());
      } catch (SAXException e) {}
      // convert Document to DocumentFragment
      HTMLDocumentImpl doc = new HTMLDocumentImpl();
      doc.setErrorChecking(false);
      DocumentFragment res = doc.createDocumentFragment();
      DocumentFragment frag = doc.createDocumentFragment();
      parser.parse(input, frag);
      res.appendChild(frag);
  
      try {
        while(true) {
          frag = doc.createDocumentFragment();
          parser.parse(input, frag);
          if (!frag.hasChildNodes()) break;
          if (LOG.isInfoEnabled()) {
            LOG.info(" - new frag, " + frag.getChildNodes().getLength() + " nodes.");
          }
          res.appendChild(frag);
        }
      } catch (Exception e) { 
        LOG.error("Error: ", e);
        };
      return res;
    }
  </code></pre>
  
  <p>Serialization function</p>
  
  <pre><code>// Custom method to serialize HTML.
  String serialize(Node node) {
    try {
         TransformerFactory transformerFactory = TransformerFactory.newInstance();
         Transformer transformer = transformerFactory.newTransformer();
         transformer.setOutputProperty(OutputKeys.INDENT, "yes");
         transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
         transformer.setOutputProperty(OutputKeys.METHOD, "html");
         StringWriter sw = new StringWriter();
         transformer.transform(new DOMSource(node), new StreamResult(sw));
         return sw.toString();
    } catch (Exception e) {
         e.printStackTrace();
         return null;
    }
  }
  </code></pre>