Support » Fixing WordPress » Possible to import external XML data into a specific page?

  • Resolved CHICAGO-lollie

    (@chicago-lollie)


    Hi folks,

    I’m currently in the (rather drawn-out) process of building my site up around an installation of WordPress, and I’m digging around for possible options to get it off the ground. I’m no code guru with this, so keep the tech-terms simple please. ):

    The scenario: One of the things I plan for the site is to be able to display my animation work (a little like [this image]). However, rather than make a separate WP page for every single animation (because that would be messy), I’d like to be able to have two or three pages that pull all the required information off some personally-created XML files: One page that lists all the animations, and one that displays the animation depending on whatever was selected (eg: http://mysite.com/page_viewanimation.php?movie_id=##).

    The question: Is it possible for WordPress to import data from an external XML file and into a specific page?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Man, I hate bumpin’ up topics, but- Anyone? Yes it’s possible, no it’s not?

    It’s possible; you would need to write a plugin that would do it though…

    Or, you could import the XML to your WordPress install and THEN create a CUSTOM PAGE to list all the links OR ala the ARCHIVES page with list of categories and links. Each link will display the animation and whatever text you place in the post in the single post page.

    Actually, even if you do go with the custom page option, you still can access the XML file from wherever it is; there’s no need to import it anywhere…

    But speaking of XML, is it really necessary? Won’t CSV do the job? The reason I am asking is, PHP has several XML extensions, so if you move your WordPress from one host to another, you may find that the XML extension you had on the old host is not available on the new one.

    NC@WP said:
    Actually, even if you do go with the custom page option, you still can access the XML file from wherever it is; there’s no need to import it anywhere…

    I suppose “import” was a poor choice of words, I meant something along the lines of “display whatever information is called in”. But I think you just answered my question with “access”, to which I say: Awesome.

    NC@WP said:
    But speaking of XML, is it really necessary? Won’t CSV do the job?

    I only really mention XML because I don’t know of any alternative formats that are as easy to edit – It’s a little hard to forget which information goes where in an XML. Like I (very briefly) mentioned in the first post, I’m no coder. A lot of this is going to be trial and error to the extreme.

    …Maybe a little less extreme though, with that link to PHP’s XML extensions. Thanks a bunch for that link!

    I don’t know if CSV can handle data the way I’d need it to. If you look at [this basic draft-in-progress-example of the XML layout], there’s going to be data with specific needs: linking to file paths for embedding, or specifying width and height, for example.

    CHICAGO-lollie,

    I only really mention XML because I don’t know of any alternative formats that are as easy to edit

    Well, the easiest format to edit is plain text, of which CSV is a variation…

    It’s a little hard to forget which information goes where in an XML.

    Maybe, but it’s VERY easy to make a syntax error in XML. You forget a quote or a closing tag somewhere, and your entire file becomes useless…

    Like I (very briefly) mentioned in the first post, I’m no coder.

    This is exactly why you should reconsider using XML. First, you will have to figure out which, if any, XML processing extensions your host supports. Then, you’ll have to wrap your mind around using whatever XML parser is available, which is not for the faint-hearted. And that’s before you even begin to integrate your code into WordPress…

    NC@WP said:
    Maybe, but it’s VERY easy to make a syntax error in XML. You forget a quote or a closing tag somewhere, and your entire file becomes useless…

    That actually doesn’t worry me too much. I can always keep a blank template handy for adding complete new entries.

    I’m already aware that this is gonna be tooough, but if there is a possibility for WP to read off an XML for a specific page, then that’s good enough for me to try and give this deathwish a shot. It’ll just mean a lot of reading and digging around for examples to pick apart. Besides, I’m a stubborn ass.

    …and if all else fails, there’s always WP-Pro!


    Edit:
    Actually, I’m gonna mark this as resolved, because you answered my question. Yes, WP can read off XML files. The way I want it to read XML is going to be very far from easy, but it’s possible.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Possible to import external XML data into a specific page?’ is closed to new replies.