OK got non-standard attributes. It forces one rule, that all non-
standard attributes for an element must follow 'id' and 'label'. This
is standardized in setting "var z=2", as it skips past the first
attributes and finds the remaining. Though this is a lot of code for
each level of elements;
var
Slick, and super fast. Makes it so that I do not even want to move
onto JSON ;-)... (JK, my engineers are forcing me too)
Made some minor mods, these add a little time and still processes over
50K lines in about 6-8 seconds, and 100K right about 10 seconds. Now
everything is its own html object re
OK, so this is much better than a lesson in parsing XML. Showing the
errors that I had made in my process, you have also shown sound jQuery
which I was having a hard time picking up from the documentation. I
tend to learn best by doing and getting feedback. Mike, thank you. I
am going to keep this
That is really nice. 100K lines really fast no script time outs. I
need to get back and study a little more. I was so terribly close, but
missed some really basic principles.
I was headed in this direction I was trying to get to the function
(i,parent),function(j,child) I had not quite figured that part out
which is obvious. Let's see what this does.
Thanks
Chad
Let's me have multiple children:
function parseXml(xml) {
$(xml).find('sites').each(function(){
var PARENTarr = jQuery.makeArray($(this).find('>element'));
$(PARENTarr).each(function(i){
$("div").append(""+
This is better. The arrays are much more efficient, and I cut the code
by more than half. I know, I know JSON, I will get there, this is
teaching me way more though. I still would like to be able to
determine my level of nesting abstractly, and also getting out non-
standard attributes.
BTW proces
This is better. The arrays are much more efficient, and I cut the code
by more than half. I know, I know JSON, I will get there, this is
teaching me way more though. I still would like to be able to
determine my level of nesting abstractly, and also getting out non-
standard attributes.
function
OK this is some progress. Still want more abstraction where I can,
though this is much improved. I also need to be able to get arrays of
attributes abstractly.
function parseXml(xml) {
$(xml).find('sites').each(function(){
var PARENTarr = jQuery.makeArray($(this).
this treats processes each order of element separately as a variable.
If I can append these correctly. I think that this might be a slightly
better process. It is at least treating things in a more object
oriented manner.
$(xml).find('sites').each(function(){
PARENT = $(this);
Now I am treating each order of elements separately as their own
objects. This is much faster, if I can figure out how to append the
results correctly.
function parseXml(xml) {
$(xml).find('sites').each(function(){
PARENT = $(this);
var PAR
This gets the variables at the top level and gives me the correct
count for each level.
function parseXml(xml) {
$(xml).find('sites').each(function(){
var PARENT = $(this).children($(this).attr('id'));
var PARENTcount = PARE
Small Tweaks, less lines of code. Still no major breaks in breaking
the nested model for XML parsing. Things that I am interested in are
being able to determine levels of nesting abstractly, being able to
determine attributes abstractly, being able to hold results in an
Array, build the array, and
http://groups.google.com/group/jquery-en/browse_thread/thread/9bc8d31e9cef30f2
This sort of deals with the namespace issues. Linear but it beats it.
--
View this message in context:
http://old.nabble.com/Some-issue-with-%22parent-%3E-child%22-selector-with-XML-and-namespaces-tp13245898s27240p27
Mike,
Thanks so much for taking the time for writing this tutorial. I see
how this is effective. I attempted to do similar things with the XML
however...
The Data Objects for JSON are much more simplistic structurally, and a
little obtuse for reading visually. As I mentioned this simply is a
model
Funny thing is, my lead engineer said the same thing...
Mostly this was an experiment to gain a better understanding of DOM
outside of HTML. This is about as exciting as a SAX parser when it
comes to speed (<5sec in safari for 20K lines, slightly longer in
FireFox, and noticeably longer in Chrome)
I spent a couple days looking all over the web for how to do this
well. I did some picking and choosing of methods, and I came up with
this. It works best in Safari, then FireFox, and then Chrome. I have
not tested in IE (do I have to?). It runs up to just over 20,000 lines
of XML well, over that m
17 matches
Mail list logo