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 6474509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:35:42+00:00 2026-05-25T06:35:42+00:00

<p> Normal text <b> bolded </b> finish normal text </p> Im processing that xml

  • 0
<p> Normal text <b> bolded </b> finish normal text </p>

Im processing that xml (example reduced) with OmniXML (but I believe the solution will apply to other XML parsers). Im traversing the xml and everytime I process a p or b tag I change some font settings etc.

The problem is that when I have a Node var pointing to the p tag and I do

Node.TextNode

it returns “Normal text bolded finish normal text” the complete text, but I want to return only the part up to the first tag (and also latter the last part); This way when y process the tag thereafter I can change the font settings, and print the bolded text..

How I can do that?

  • 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-05-25T06:35:43+00:00Added an answer on May 25, 2026 at 6:35 am
    uses
      OmniXML,
      OmniXMLUtils;
    
    procedure ProcessNode(const node: IXMLNode; nodeText: TStrings);
    
      procedure CollectNodes(const node: IXMLNode; const nodeList: IXMLNodeList);
      var
        childNode: IXMLNode;
        iChild   : integer;
      begin
        for iChild := 0 to node.ChildNodes.Length-1 do begin
          childNode := node.ChildNodes.Item[iChild];
          if childNode.NodeType = TEXT_NODE then
            nodeText.Add(childNode.NodeValue)
          else if childNode.NodeType = ELEMENT_NODE then begin
            nodeText.Add(childNode.NodeName);
            CollectNodes(childNode, nodeList);
            nodeText.Add('/' + childNode.NodeName);
          end;
        end;
      end; { CollectNodes }
    
    var
      childNode: IXMLNode;
      nodeList : IXMLNodeList;
    begin
      nodeList := TXMLNodeList.Create;
      CollectNodes(node, nodeList);
    end; { ProcessNode }
    
    procedure TForm39.FormCreate(Sender: TObject);
    var
      xml: IXMLDocument;
      nodeText: TStringList;
    begin
      xml := CreateXMLDoc;
      if XMLLoadFromString(xml, '<test><p> Normal text <b> bolded </b> finish normal text </p></test>') then begin
        nodeText := TStringList.Create;
        try
          ProcessNode(xml.SelectSingleNode('test'), nodeText);
        finally FreeAndNil(nodeText); end;
      end;
    end;
    

    Will give you:

    p
     Normal text
    b
     bolded
    /b
     finish normal text
    /p
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some text/images that I only want to display in the normal state
I've got a view that filters by year. The year is a normal text
Is there a way to make that normal text and links share the same
Is there a way to replace the normal text within a table element that
I want to convert normal text to \x codes for e.g \x14\x65\x60 For example
I have a series of <p> tags, an example: <p>normal text<a href=#>link anchor text</a>more
is there an easy possibility to highlight a portion of text in a normal
Using C#, when a user types a text in a normal textbox, how can
In normal text editors, you select the block of text and then press Tab
I have a database full of text fields that look like this: (paragraph 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.