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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:56:12+00:00 2026-05-22T15:56:12+00:00

I have a XML document which contains around 4000 entries of data. The data

  • 0

I have a XML document which contains around 4000 entries of data. The data will be used in a PHP environment and is needed for a Web-App. I thought about using “sphinx” ( http://sphinxsearch.com/docs/2.0.1/xmlpipe2.html ) for indexing the data but was wondering, what other, maybe better options are out there.

Thanks in advance,
Andy

EDIT: I don’t want to write an importer script which loads the XML file into a e.g. MySQL-DB. It should be something like: Load the file into this tool/program/whatever and then it should be searchable from PHP.

  • 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-22T15:56:13+00:00Added an answer on May 22, 2026 at 3:56 pm

    If you have 4000 entry’s and you want only one, the whole file is read until it finds your entry. That can be a long time. You might want to use a Database like MySQL.


    If you want to make your XML-file search able, you’ll end up with one of those two options:

    1. You parse the entire file into an
      Array or something that can be
      quickly searched (will cause a lot
      of memory on every call to the
      PHP-Script)
    2. You iterate through the whole XML
      file, searching for your desired
      entry (will be even slower then
      number one because you’ll have to
      see if it’s your desired entry every
      time before you can continue to
      search).

    For performance-reasons, neither of those options are really acceptable. It gets even more tricky if you want users to edit your XML-file, because they are not multi-thread save (like Databases).

    If you want a good performance for your search, you’ll want to use a Database. It’s just as easy as that.

    Yet another thing would be letting the users machine parse the XML-File (using JavaScript) and get something like a id for the desired article (which is then opened from your Server). But depending of your XML-file’s size and the power of the user’s machine, the Browser might interrupt and cancel the script.

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

Sidebar

Related Questions

I have an XML document which contains nodes like following:- <a class=custom>test</a> <a class=xyz></a>
I have a single xml document (data.xml), which I display as HTML using an
My input is a InputStream which contains an XML document. Encoding used in XML
I have an Excel worksheet in XML format which contains <Cell ss:StyleID=s127><Data ss:Type=String>Replace Me</Data></Cell>
I have an XML document which contains some invalid characters (é for example). Unfortunalty
I have an XML document which contains an element that is over 90,000 characters
I have a xml document which has a node that contains a proper name
I have a string which contains XML data and I want to convert it
I have an xml document which consists of a number of the following: -
I have an XML document which looks something like this: <meadinkent> <record> <comp_div>MENSWEAR</comp_div> <sty_ret_type>ACCESSORIES</sty_ret_type>

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.