Question:
XML feed question - need some help?
Rhythm *
2009-03-14 11:35:17 UTC
Hi there,

I have very little experience (if any) with XML, and I am planning to build a website which incorporates feeds on live games such as poker and so on occurring. I would like to display them all together in a tabular fashion under a consistent set of headings.

Now I believe from seeing initial feeds from some sites they have sent me, that each site formats their XML in a certain way. If I wished to standardise the feeds to fit MY OWN headings, and be able to add new feeds on a regular basis, how would I go about this?

Logically I would think that there was some way of mapping their headings to fit my own the first time as a one-off and then every time new data gets published to their feed it gets mapped correctly to where I want it.

Is there a simple way to achieve this? Also, if I wanted to learn some XML, is it very difficult? I know HTML already. Any sites where I can learn would be a bonus.
Three answers:
R.F.
2009-03-14 12:01:55 UTC
I think your misunderstanding with XML is that XML is not a language like how HTML is a language with a defined set of tag names and elements.



XML is a meta-language. A meta-language is specifications and rules on how a language show be created.



For example, XHMTL. It's essentially the standard HTML tag elements, but XHTML was created following XML rules, so XTHTML is considered an XML language.



That means anyone can create any XML language, and there are a lot of them out there. So technically, you can create your own XML language if you follow XML specifications. But that's only useful for your own use. If you want to share XML files, then all parties have to agree on the XML language. For example, RSS feeds use a simple XML language, and the only reason all RSS readers understand them is because RSS feeds have to follow the RSS XML language.



If you want to use someone else's XML files, you have to find out what XML language set they are using. It could be a standard, or they might have created it themselves.
anonymous
2016-10-17 11:15:24 UTC
Extensible Markup Language (XML) is a typical-purpose specification for coming up custom markup languages.[a million] that's categorized as an extensible language, because of the fact it facilitates the person to define the mark-up factors. XML's purpose is to help tips structures in sharing based archives, extraordinarily by utilizing ability of the internet, [2] to encode records, and to serialize archives; in the final context, it compares with textual content textile-based serialization languages which contain JSON and YAML. I in basic terms googled "what's a XML feed" - you will discover greater solutions by utilizing doing an identical factor....
anonymous
2009-03-14 11:59:25 UTC
Your idea is a first step, but it's correct. Write (or download) a generic XML parser and call it to parse every feed into a generic form. Then use a site-specific routine to parse the particular feed into what your site needs. I'd write it in PHP, but if you're on an IIS server you might be limited to ASP.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...