CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [mohan] Script to find unused CSS styles: Edit Log


Aug 7, 2016, 9:41 PM

Views: 17104
Re: [mohan] Script to find unused CSS styles

1) Xpaths are used to navigate xml type documents. An xpath represents a path to a single or set of elements. Its much like a CSS selector, but has support for other complexities, In your case, we are converting selectors to xpaths so that we can navigate the html document and check if the element(s) exist. xpath is in the output data structure because we generate them in the first iteration group ( css ), then actually use them in the second iteration group ( html ) as this is most efficient. Feel free to delete it afterwards.

2) Yes, as mentioned in my previous post, you should simplify the data structure to suit your needs. The information you request is already part of the current data structure, but perhaps not laid our how you expect. Also, be careful with terminology, don't mix selector with class. If you really are only interested in selectors that lead to classes ( direct or indirect ), you can use CSS::Selector::Parser, and check that the last array of the last array has a class atrribute. Currently the code has no knowledge of specific types of element.

3) In the $input hash, you can modify the list of properties, currently there are two, margin and width.


(This post was edited by Zhris on Aug 8, 2016, 8:44 AM)

Edit Log:
Post edited by Zhris (Enthusiast) on Aug 7, 2016, 9:46 PM
Post edited by Zhris (Enthusiast) on Aug 7, 2016, 9:46 PM
Post edited by Zhris (Enthusiast) on Aug 8, 2016, 8:44 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives