Common order of elements

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Has anyone ever done a study about which elements are more likely to be parent elements, rather than child elements ?

For instance, would I be more likely to see
Code: [ Select ]
<pre> <*> <form>


Or would this be more likely
Code: [ Select ]
<form> <*> <pre>


But for the global set of [X]HTML elements.

It would be nice to have consideration given to which orders are likely to contain more child elements as well.
For instance if <form> was more likely to contain <pre> by a rate of 1.5:1, it would be nice to know when it's the other way around, ie <pre><form> that there's an average of 4 child <form> elements per <pre>.

The reason I'm looking for this, is I will be removing sections of [X]HTML based on their context before finally working with what's left over.

It makes sense to remove all <pre> elements before removing <form> elements if <pre> is more likely to contain a <form>, that way only one removal is done since the child <form> would be removed with the <pre>.

But if there's likely to be instances where <form> would contain multiple <pre> elements that outnumber the other way around, it would make sense to remove <form> first.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

First of all, to be honest, I have no idea what you're on about. :)

However, taking a shot in the dark, the FORM element is block level and the PRE element is inline. A block level element is never nested in an inline element, according to my understanding.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Yeah, I discovered I used a bad example when I looked at a few DOCTYPES.

I'm calculating Flesch-Kincaid & Gunning-Fog scores/indexes from text.
For anyone who's unaware what those are, the Flesch-Kincaid grade level is the thing you see during US Presidential debates when the network is telling you at what school grade level the candidate is speaking at.

In order to prevent the scores from being skewed by such things as context changes by elements like <blockquote>, I remove those elements & their contents before doing anything else.

I have somthing in place, I'm just nitpicking efficiency right now.
I'd rather remove an element that's likely to contain another context altering element before removing the child elements.
That way instead of removing the child element, then removing the parent element that contained the child element in the first place, I can just remove the parent element.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

And in case anyone's wondering, yes, yes I will be playing with Ozzu & Opera user.js when I'm done with this. :lol:
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

It's looking like just doing block-level elements, then doing inline elements is the simple solution.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 60 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
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.