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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:29:00+00:00 2026-06-01T02:29:00+00:00

I have a file which i’m parsing out myself. Every time i spot a

  • 0

I have a file which i’m parsing out myself. Every time i spot a “<” or “>” i split the string like so:

xml = file.split("[<>]"); 

This will give me the tag, the data and the closing tag.

once this is done i determine what type of tag it is and handle it differently. In the case that it is an item tag, it has a description. like so:

<description>
<![CDATA[
<img width="460" height="259" src="http://www.cbc.ca/gfx/images/news/topstories/2012/03/28/hi-parliament-stop-852-7931-6col.jpg"><br/><p>Finance Minister Jim Flaherty's budget will take the shine off what critics call MPs' gold-plated pensions, reports Greg Weston for CBC News.</p>
]]>
</description>

the problem here is that it will split on all the “<” and “>” so the description part that i’m looking for gets lost.

how can i get around the description and possibly other tags i’m searching for containing multiple “<” and “>” which i don’t care about? (ones which are not surrounding the opening tag and closing tag?

  • 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-01T02:29:01+00:00Added an answer on June 1, 2026 at 2:29 am

    If you want to learn how to write a good XML parser, then why not look at some open source XML parsers? Read the source, Luke!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have XML file which looks like this: <?xml version=1.0?> <results> <row id=100><name>name blah</name></row>
Suppose I have file which goes like this : a void measure() { a
I have a file which looks like this: a_12_3_5- k_3_4_6-a_12_3_5- q_1_5_7_9- q_1_5_7_9- a_9_4_5-c_3_4_6- c_3_4_6-r_4_5_7-
I have file which looks like this: >gi|358482566|ref|NW_003766328.1| Gallus gallus breed Red Jungle fowl,
I have a file which is space delimited which looks like this: probeset_id submitted_id
I have file which contains some data, like this 2011-01-02 100100 1 2011-01-02 100200
I have a file which has contents on every line following this format (A,
I have XML file which is looks like: <Report> <Total> <RecordValues> <Record> <FieldValue fieldName=index
I have a config file which lists all the configuration details for Logback.xml like
I have a file which looks like this (3 columns and n number 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.