Load & Parse an XML file without using JS or IE data Islands

  • bgraybr
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 11, 2009
  • Posts: 26
  • Status: Offline

Post May 10th, 2009, 7:01 pm

Like I said, I'm wondering if there is a way to load and parse an XML file without using JavaScript or Internet Explorer data Islands. I'm using XML to store data for a news bar on a website (Ex. instead of having to edit the news bar on every single page I can edit just the XML file). I'd rather not use JavaScript. The only other way I could find is IE data islands, which would only work in IE.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 10th, 2009, 7:01 pm

  • bgraybr
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 11, 2009
  • Posts: 26
  • Status: Offline

Post May 11th, 2009, 5:45 am

In other words, I want to know if its possible to do http://www.w3schools.com/xml/xml_parser.asp <-that without using any JavaScript.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post May 11th, 2009, 6:03 am

Are you willing to do this server-side? If so, there are several language choices for this. If you maintain that it must be done client-side, then JS may be your only choice.
I'd love to change the world, but they won't give me the source code.
  • bgraybr
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 11, 2009
  • Posts: 26
  • Status: Offline

Post May 11th, 2009, 3:39 pm

UPSGuy wrote:
Are you willing to do this server-side? If so, there are several language choices for this. If you maintain that it must be done client-side, then JS may be your only choice.


Now that you mentioned that, I just found out how to do something similar in PHP. Thanks for the help. (http://www.w3schools.com/php/php_xml_parser_expat.asp)
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post May 11th, 2009, 4:18 pm

Great choice for PHP. If you're willing to work with PEAR, then this is a good choice, too.
I'd love to change the world, but they won't give me the source code.
  • PatrickMc
  • Born
  • Born
  • No Avatar
  • Joined: Jun 08, 2009
  • Posts: 1
  • Status: Offline

Post June 8th, 2009, 7:42 am

I have been using biterscripting. It works without anything else and is free. For example, if you want to extract <newsitem></newsitem> from an XML file something.xml,

Code: [ Select ]
var str xml ; cat "something.xml" > $xml
stex -cr "^<newsitem\>&</newsitem\>^" $xml
  1. var str xml ; cat "something.xml" > $xml
  2. stex -cr "^<newsitem\>&</newsitem\>^" $xml


will print the news item. To replace the news items to your own string "Latest News - XYZ",

Code: [ Select ]
var str xml ; cat "something.xml" > $xml
sal -cr "^<newsitem\>&</newsitem\>^" "^<newsitem\>Latest News - XYZ</newsitem\>^" $xml > "something.xml"
  1. var str xml ; cat "something.xml" > $xml
  2. sal -cr "^<newsitem\>&</newsitem\>^" "^<newsitem\>Latest News - XYZ</newsitem\>^" $xml > "something.xml"


will do that. stex = string extractor, sal = string alterer, -c = case insensitive, -r = regular expression, etc.

I have been using it. Downloaded biterscripting from http://www.biterscripting.com .I use it for system admin purposes - parsing things, logs, web pages, xml and other files, ... There are several posts on various forums about parsing XML with biterscripting - google up biterscripting and XML.

Patrick

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 108 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.