-
I've posted an example of an XML handling utility
I've been working on @ http://209.71.59.34/bb1/
a sample application is provided @
http://209.71.59.34/bb1/flaxReader.swf
This should be regarded as an alpha version as there
are still a few bugs and brick-a-brack left over from previous
generations.
The utility generates an orginal "flaXiMaL" object under the name you
specify as well as two standard arrays one of which provides an straight
index of all Node Elements and another which maps the parent/child heirarchy
of the XML doc as well as name/ value pairs for data nodes.
The flaXiMaL object maps a well formed XML document to
both relative and absolute array hierarchies. It also provides access to
a variety of methods for stripping node elements and values as well as
dynamically instantiating methods, arrays and properties during
run-time.
**place the sample xml files, or your own, in an appropriate local
directory run the *.fla in the zip file then look at your debugger. The load
routine is in the second frame of the *.fla - you can modify this to accept
other xml docs.
please excuse the fact that there is no documentation - this will be
posted shortly along with other examples.
again, this is an alpha - any feedback , bug reports, or advice will be appreciated
-
nice idea and hope realization
please explain how to use it.
first we should include your code file "flaxObjec.as".
then we generate new object by writing:
foo = new flaximal("testXML");
it is clear.
what to do next?
usually we load xml data from server. so how cud we use functions of flaximal on this data, and which functions should be used for different purposes.
IMHO
ur fla structure is not so clear for educational purposes.
Some people may have difficulties understanding your ideas with such short documentation.
May be u should provide list of member functions with more detailed explanations of usage.
I think my comments will help you.
-
don't worry I'll post some documentation ASAP, the example assumes some familiarity with xml - it simply demonstrates that the mapping works and how the resulting data is organized. Check out your debugger after running the examples locally , it's much more interesting .
as far as loading xml
//~~~~~~~~~~~~~flaximal takes one argument which is the desired name
//of the resulting object. The following will produce a flaximal object named helloXML.
// you could name it a anything you want as long as all the letters are connected.
foo = new flaximal("helloXML");
foo.flaximal_obj.onLoad = loaded ;
foo.load(example) ;
if you look at the code you'll see that by instantiating flaximal you're creating an xml object called flaximal_obj associated with helloXML. You've now got helloXML.flaximal_obj().
function flaximal (name) {
flax = name ;
eval(flax) = new Object ;
this.flaximal_obj = new XML();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~``
The XML object takes the url of the XML document as it's argument.
foo.load("http://www.yoursite.net/slashdot.xml") ;
helloXML.flaximal_obj would then contain the slashdot.xml file data
flaximal will create 3 sets of arrays which can be access in different manners.
you should really look at the debugger to understand what's happening past this point.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|