473,770 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tool to group STYLE tags together?

I am using an application that dynamically creates style tags all over the
place in the html file. I mean some inside the head section and some in the
body section. I have no control over this.

Is there a tool/utility out there which reads in such a file, moves all the
STYLE tags and groups them together in the head section or an external
file? (Just grouping them is fine with me)

John Dalberg
Nov 3 '06 #1
3 1759

John Dalberg wote:
I am using an application that dynamically creates style tags all over the
place in the html file. I mean some inside the head section and some in the
body section. I have no control over this.

Is there a tool/utility out there which reads in such a file, moves all the
STYLE tags and groups them together in the head section or an external
file? (Just grouping them is fine with me)

John Dalberg
If you have a program that uses HTML-Tidy, like HTML-Kit
<http://www.chami.com/html-kit/you can clean it up that way.
Personally, I prefer TopStyle <http://www.bradsoft.co m/top-style/>. If
also has a means to clean up external stylesheets and get everything
ordered.

--
Adrienne Boswell at work
Administrator nextBlock.com
http://atlas.nextblock.com/files/
Please respond to the group so others can share

Nov 3 '06 #2
John Dalberg wrote:
I am using an application that dynamically creates style tags all
over the place in the html file.
What is that application? Do you have an URL for the files?
I mean some inside the head section
and some in the body section. I have no control over this.
Is there a tool/utility out there which reads in such a file, moves
all the STYLE tags and groups them together in the head section or an
external file? (Just grouping them is fine with me)
I cann't imagine there is such a tool. Maybe a search&replace can replace
the inline styles with classes.

--
Nico Schuyt
http://www.nicoschuyt.nl/
Nov 4 '06 #3
John Dalberg wrote:
I am using an application that dynamically creates style tags all over
the place in the html file. I mean some inside the head section and some
in the body section. I have no control over this.
Do you mean style *elements* or style *attributes*? Style *elements* look
something like this:

<style type="text/css">
...
</style>

whereas style attributes look like this:

style="..."

It really helps if you use the correct terminology, as the answers may be
different for each interpretation.

In the case of <styleelement s, it should be relatively easy to
post-process the page (using e.g. regular expressions in PHP) to merge
pull out the CSS from several style blocks and concatenate them into one.

In the case of style attributes on other elements, things get a bit more
tricky. It could also be done with a bit of scripting, but would require
more work.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Nov 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3034
by: vincent_delft | last post by:
I'm looking for a Web Tool kit to build web pages with the following criteria (in priority order) : - easy to use, develop (reuseability of code, ...) - flexible (ideally should run with Python CGIHTTPServer and/or with Apache (with or wihout mod_python) - possibility to have load balancing and/or caching (for very high loaded web pages) I've founded lot of tools ...
0
1185
by: Brynn | last post by:
I thought since I am building my site a 'Contact Me' page ... I may has well include it in my sites scripts (I am doing this with quite a few other tools of my site as well). It isn't perfect yet, but it is good. Currently you have 2 options for the way the message gets to you ... through Persits ASPEmail component or just writing the messages (very cleanly) to a text file. ((Which by the way, I am going to be also including a way to...
2
1688
by: Florian Brucker | last post by:
Yeah, that's right, this question is not about styling HTML with CSS, but instead about how one should arrange his CSS code so that it is easy to understand and modify. The thing that I've got problems is that CSS does not seem to support variables or conditionals (if/else). This makes it IMO difficult to arrange the code, especially if several tags share one attribute (same background for example). How do you organise your files? 1....
16
4452
by: michael | last post by:
Is it possible to get all href URLs contained in a unordered list and place them in an array? Or in fact two different arrays, differently named one for each <ul> group? <ul> <li><a href="lemurs.html">Lemurs</a></li> <li><a href="chameleons.html">Chameleons</a></li> </ul> <ul>
2
2310
by: nickdu | last post by:
Is there a tool that will merge XML documents? We also need the reverse, we need to be able to create a Diff of two documents. What we're trying to do is just store differences of documents at different levels of hierarchy in our configuration store. As an example, lets say at a certain hierarchy in our configuration store is the following document: <grid bgColor="Red" fgColor="Green" Width="200" Height="100"> <font name="Arial"...
17
3979
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher http://forta.com/books/0672325667/
2
2938
by: Zhang Weiwu | last post by:
Hello. I am looking for a commandline tool to take an html document (or html document segment, a.k.a. without beginign "<html><head>..</head><body>") and process it by removing all css style settings and javascripts, and output a clean html/xhtml. Optionally, it would be nice if this tool can take an acceptable tag list and remove all tags not in this list. I need such a tool to process a lot of static html document I am working on....
26
25618
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any idea? Thanks you very much
3
3376
by: Paul Jung | last post by:
Hello there, how to cut a certain group of words in a string, for example, "<img src='images/smiles/grin.gif' smilietext=':grin:' border='0' style='vertical-align:middle' alt=':grin:' title=':grin:' />" "<img src='images/smiles/smile.gif' smilietext=': smile:' border='0' style='vertical-align:middle' alt=': smile:' title=': smile:' />" ¡­.. from a forum comment.
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.