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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:02:20+00:00 2026-05-22T12:02:20+00:00

So, I’m using an API which happens to only return XML, that sucks. What

  • 0

So, I’m using an API which happens to only return XML, that sucks. What I want to do is create a database entry for each record that get returned from the API, but I’m not sure how.

The XML that gets returned is huge and has lots of whitespace characters in it… is that normal? Here is a sample of some of the XML.

<!-- ... -->
        <attribute name="item_date">May 17, 2011</attribute>
        <attribute name="external_url">http://missionlocal.org/2011/05/rain-camioneta-part-i/</attribute>
            <attribute name="source" id="2478">Mission Loc@l</attribute>
            <attribute name="excerpt"></attribute>
    </attributes>
</newsitem>

<newsitem
    id="5185807"
    title="Lost Chrome messenger PBR bag and contents (marina / cow hollow)"
    url="http://sf.everyblock.com/lost-and-found/by-date/2011/5/17/5185807/"
    location_name="Van Ness and Filbert"
    schema="lost-and-found"
    schema_id="7"
    pub_date="May 17, 2011, 12:15 p.m."
    longitude="-122.424129925"
    latitude="37.7995100578"
>
    <attributes>
        <attribute name="item_date">May 17, 2011</attribute>
        <attribute name="external_url">http://sfbay.craigslist.org/sfc/laf/2386709187.html</attribute>
    </attributes>
</newsitem>

<newsitem
    id="5185808"
    title="Plywood Update: Dumplings &amp; Buns Aims To Be &quot;Beard Papa Of Chinese Buns&quot;"
    url="http://sf.everyblock.com/news-articles/by-date/2011/5/17/5185808/"
    location_name="2411 California Street"
    schema="news-articles"
    schema_id="5"
    pub_date="May 17, 2011, 12:15 p.m."
    longitude="-122.434000442"
    latitude="37.7888985667"
>
    <attributes>
        <attribute name="item_date">May 17, 2011</attribute>
        <attribute name="external_url">http://sf.eater.com/archives/2011/05/17/dumplings_buns_aims_to_be_beard_papa_of_chinese_buns.php</attribute>
            <attribute name="source" id="2155">Eater SF</attribute>
            <attribute name="excerpt"></attribute>
    </attributes>
</newsitem>

<newsitem
    id="5185809"
    title="Freebies: This week, Piazza D&#39;Angelo (22 Miller..."
    url="http://sf.everyblock.com/news-articles/by-date/2011/5/17/5185809/"
    location_name="22 Miller"
    schema="news-articles"
    schema_id="5"
    pub_date="May 17, 2011, 12:15 p.m."
    longitude="-122.408894997"
    latitude="37.7931966922"
>
    <attributes>
        <attribute name="item_date">May 17, 2011</attribute>
        <attribute name="external_url">http://sf.eater.com/archives/2011/05/17/freebies_24.php</attribute>
            <attribute name="source" id="2155">Eater F</attribute>
            <attribute name="excerpt"></attribute>
<!-- ... -->

Any ideas?

  • 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-22T12:02:20+00:00Added an answer on May 22, 2026 at 12:02 pm

    That’s not quite valid XML. That’s some sort of escaped-string representation of XML, perhaps console output. It also doesn’t seem to be complete. Other than that, it’s fairly normal XML. Here’s a smaller excerpt, unescaped and formatted:

    <newsitem
        id="5185807"
        title="Lost Chrome messenger PBR bag and contents (marina / cow hollow)"
        url="http://sf.everyblock.com/lost-and-found/by-date/2011/5/17/5185807/"
        location_name="Van Ness and Filbert"
        schema="lost-and-found"
        schema_id="7"
        pub_date="May 17, 2011, 12:15 p.m."
        longitude="-122.424129925"
        latitude="37.7995100578">
        <attributes>
            <attribute name="item_date">May 17, 2011</attribute>
            <attribute name="external_url">http://sfbay.craigslist.org/sfc/laf/2386709187.html</attribute>
        </attributes>
    </newsitem>
    

    You’ll just need to determine what you want to extract and put in the database, and let that drive your DB design decision. Do you need multiple models with relationships intact, or are you just concerned with a subset of the data?

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.