Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8167079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:05:27+00:00 2026-06-06T20:05:27+00:00

I need to parse through a CMS generated HTML page and add list item

  • 0

I need to parse through a CMS generated HTML page and add list item tags around any HTMLAgiligyPack nodes with a child node that have a name attribute of “Example”.

C# code

HtmlDocument doc = new HtmlDocument();
doc.Load("test.htm");
foreach (HtmlNode docObjects in doc.DocumentNode.SelectNodes("//object[@type='text/sitemap']"))
{
  HtmlNodeCollection paramNodes = docObjects.ChildNodes;
  foreach (HtmlNode paramNode in paramNodes)
  {
    string paramName = paramNode.GetAttributeValue("name", null);
    string paramValue = paramNode.GetAttributeValue("value", null);
    HtmlNode findItem = paramNode.NextSibling;
    if (paramName == "Example")
    {
     //Add listitem (<li>) tags to the paramName node 
    }
  }
}

test.htm

<OBJECT type="text/sitemap">
    <param name="Example" value="Help.chm::\toc.hhc">
</OBJECT>
<OBJECT type="text/sitemap">
    <param name="Example" value="Help2.chm::\toc.hhc">
</OBJECT>
<OBJECT type="text/sitemap">
    <param name="Example" value="Help3.chm.chm::\toc.hhc">
</OBJECT>

needs to be

<li><OBJECT type="text/sitemap">
    <param name="Example" value="Help.chm::\testing.htm">
</OBJECT></li>
<li><OBJECT type="text/sitemap">
    <param name="Example" value="Help2.chm::\testing.htm">
</OBJECT></li>
<li><OBJECT type="text/sitemap">
    <param name="Example" value="Help3.chm::\testing.htm">
</OBJECT></li>

Any assistance you can provide would be greatly appreciated. This is part of a bigger project I’m working on and will likely be requesting help with in the future. Need a crash course back into C# – thanks you all ahead of time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:05:29+00:00Added an answer on June 6, 2026 at 8:05 pm

    Here is one way (code goes within your if clause):

    var objectNode = paramNode.ParentNode;
    var li = doc.CreateElement("li");
    objectNode.Remove();
    li.AppendChild(objectNode);
    
    doc.DocumentNode.AppendChild(li);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to parse through a string and add single quotes around each Guid
I'm able to parse through the directory and list all images with any of
I need parse through a file and do some processing into it. The file
I retrieve mail using net/pop , but I also need to parse through the
I need to parse a log in the following format: ===== Item 5483/14800 =====
I need to parse html for a project and looking for a good html
i need to parse through a text file and process the data. the valid
I need to parse through the aspx file (from disk, and not the one
I have the need to parse through a large pipe-delimited file to count the
Is there any thread library which can parse through code and find blocks of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.