Skip to content

Javascript code to transform XML into a javascript object using the BadgerFish convention.

Notifications You must be signed in to change notification settings

jodytate/badgerfishjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

BadgerFish JS

BadgerFish JS is a javascript function that uses jQuery to transform XML into a JavaScript object using the BadgerFish convention.

Usage:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
        <title>BadgerFish JS Example</title>
        <script src="jquery.js"></script>
        <script src="badgerfish.js"></script>
        <script>
        
            var xml = "<foo name='Statler'><bar>Waldorf</bar><waka>Fozzie</waka><waka>Bear</waka></foo>";
            var obj = badgerFish(xml);
            obj.foo["@name"] === "Statler"; // true
            obj.foo.bar === "Waldorf"; // true
            $.isArray(obj.foo.waka); // true
            obj.foo.waka[0] === "Fozzie"; // true

        </script>
    </head>
    <body>
    </body>
</html>

About

Javascript code to transform XML into a javascript object using the BadgerFish convention.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%