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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:31:54+00:00 2026-06-13T09:31:54+00:00

I am trying to select a random Bible verse from XML files I already

  • 0

I am trying to select a random Bible verse from XML files I already have. I’d like to extract a random verse, display it then also display the verse number and book name.

I have several XML files so converting them to Plist might be a hassle and I am not sure if I use a dictionary that I can also extract the chapter number and book name.

The XML files look like this…

    <bible translation="KJV">
    <testament name="Old">

        <book index="1" name="Genesis">
            <chapter index="1">
                <verse index="1" text="In the beginning God created the heaven and the earth."/>
                <verse index="2" text="And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters."/>

                <!-- THE REST OF THE XML HERE -->

            </chapter>
       </book>
</testament>

Any idea on how I can select a random verse in and then display the text, book name and chapter number?

  • 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-13T09:31:55+00:00Added an answer on June 13, 2026 at 9:31 am

    A fairly simple solution would be to take your XML file and format it as a ‘Property List’ (plist) file – these can be handled easily in Objective-C. Essentially a ‘Property List’ is just an XML file so the effort in converting it should be minimal.

    You can then fill an array or dictionary with the contents of your ‘plist’ file and simply generate a random number to use as the index to select an object from your array. There’s plenty of info around the web for how to handle plist files, a simple tutorial you can check out here

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

Sidebar

Related Questions

I am trying to select three values from xml document. I want to get
I’m trying to display a list of shops each with 3 random items from
My scenario is like this: I'm trying to select a class from a list
Im trying to select random datasets with DataMapper, but seems like there is no
I am trying to select Random 15 ImageViews out of the 21 from the
Using MySQL and PHP. I'm trying to select 4 random ads from a table.
Trying to select a random row from a table, based on autoincremented primary key
I'm trying to Select a random set of results (5 results) from a table
I'm trying to select a random 10% sampling from a small table. I thought
I'm trying to fetch random no. of entries from a database by using SELECT

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.