[WSG] Exporting inline CSS

2005-05-31 Thread Jacobus van Niekerk
Hi all,

Quick question, I have a client with lots of HTML file that have inline CSS.
(Over 300 docs) I am looking for some software, or way, that will export
this inline css into a external css file. Or even just move it into a
embedded style sheet.

Thanks in advance for any help.

Kind Regards
Jacobus van Niekerk

Creative Consultant


web: http://www.catics.com/  |  http://www.freelancecontractors.com
tel: + 27 21 982 7805

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



RE: [WSG] Exporting inline CSS

2005-05-31 Thread Scott Swabey \(Lafinboy Productions\)
 Quick question, I have a client with lots of HTML file that 
 have inline CSS. (Over 300 docs) I am looking for some 
 software, or way, that will export this inline css into a 
 external css file. Or even just move it into a embedded style sheet.

Am not aware on any package that would do this for you, but it should be
quite easy to set up a Regular Expression routine to strip all style='foo'
content from a page.

Regards 


Scott Swabey
General Manager

Lafinboy Productions
:: website design :: website development :: graphic design

e  [EMAIL PROTECTED]
t   +61 (0)415 193 126
w  www.lafinboy.com

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: [WSG] Exporting inline CSS

2005-05-31 Thread Patrick H. Lauke

Scott Swabey (Lafinboy Productions) wrote:


Am not aware on any package that would do this for you, but it should be
quite easy to set up a Regular Expression routine to strip all style='foo'
content from a page.


The harder part would be to have it not just strip out the styles, but 
externalise them while keeping them working in the final output. The 
brute force approach would be to just assign a unique, random ID to each 
element where a style attribute is found, then create a matching, 
specific entry in the new external CSS. The - hypothetical - right way 
would be for a parser to analyse the entire document structure, work out 
how styles can be applied generically (all paragraphs inside this div 
have a certain style, so create a rule for div#blah p rather than 
individual style rules), and still find the odd few special cases and 
assign a class.


Sounds like AI to me...even if you can find a halfway automated system, 
I doubt that the final result would be any more satisfactory than just 
leaving the style attributes in the markup, I'm afraid...


--
Patrick H. Lauke
_
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com

**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**



RE: [WSG] Exporting inline CSS

2005-05-31 Thread John Horner

  Quick question, I have a client with lots of HTML file that

 have inline CSS. (Over 300 docs) I am looking for some
 software, or way, that will export this inline css into a
 external css file. Or even just move it into a embedded style sheet.


Am not aware on any package that would do this for you, but it should be
quite easy to set up a Regular Expression routine to strip all style='foo'
content from a page.


I think the question related to style blocks in the HTML, not 
style= attributes. Surely the question is, are we sure the CSS is 
all the same for all those 300 files? If it is, it's trivial to do it 
with regular expression-type searching as you say. If not, it could 
be very tricky.


   Have You Validated Your Code?
John Horner(+612 / 02) 8333 3488
Developer, ABC Kids Onlinehttp://www.abc.net.au/

**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**



Re: [WSG] Exporting inline CSS

2005-05-31 Thread Ben
If the HTML files were valid XHTML it would be a relatively easy job extracting the styles using XSLT.On 6/1/05, Patrick H. Lauke 
[EMAIL PROTECTED] wrote:Scott Swabey (Lafinboy Productions) wrote:
 Am not aware on any package that would do this for you, but it should be quite easy to set up a Regular _expression_ routine to strip all style='foo' content from a page.The harder part would be to have it not just strip out the styles, but
externalise them while keeping them working in the final output. Thebrute force approach would be to just assign a unique, random ID to eachelement where a style attribute is found, then create a matching,
specific entry in the new external CSS. The - hypothetical - right waywould be for a parser to analyse the entire document structure, work outhow styles can be applied generically (all paragraphs inside this div
have a certain style, so create a rule for div#blah p rather thanindividual style rules), and still find the odd few special cases andassign a class.Sounds like AI to me...even if you can find a halfway automated system,
I doubt that the final result would be any more satisfactory than justleaving the style attributes in the markup, I'm afraid...--Patrick H. Lauke_
re·dux (adj.): brought back; returned. used postpositively[latin : re-, re- + dux, leader; see duke.]www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com**The discussion list forhttp://webstandardsgroup.org/
 See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list  getting help**



Re: [WSG] Exporting inline CSS

2005-05-31 Thread Bert Doorn

G'day


Quick question, I have a client with lots of HTML file that
 have inline CSS. (Over 300 docs) I am looking for some
 software, or way, that will export this inline css into a
 external css file. Or even just move it into a embedded style sheet.


Replacing the styles (whether style blocks in the head of the 
documents or inline as attributes) will be difficult.


Removing them should be simple could be done with Macromedia 
Dreamweaver.  It can go through a whole site, find all elements 
with a style attribute, and remove the attribute.


If each doc has a style element in the head section, you could 
use the same method to replace it to use an imported style sheet.


Biggest question is: how consistent is the site's layout?  Will 
it work with an overall style sheet or two?


Regards
--
Bert Doorn, Better Web Design
http://www.betterwebdesign.com.au/
Fast-loading, user-friendly websites

**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**



Re: [WSG] Exporting inline CSS

2005-05-31 Thread Matt Thommes
 Quick question, I have a client with lots of HTML file that have inline CSS.
 (Over 300 docs)

Good Lord, what was that previous author thinking!??

There's no escaping this problem - you're just gonna have to start
from scratch. Don't waste your time with export/import methods.


MATTHOM
matthom.com/


On 5/31/05, Jacobus van Niekerk [EMAIL PROTECTED] wrote:
 Hi all,
 
 Quick question, I have a client with lots of HTML file that have inline CSS.
 (Over 300 docs) I am looking for some software, or way, that will export
 this inline css into a external css file. Or even just move it into a
 embedded style sheet.
 
 Thanks in advance for any help.
 
 Kind Regards
 Jacobus van Niekerk
 
 Creative Consultant
 
 
 web: http://www.catics.com/  |  http://www.freelancecontractors.com
 tel: + 27 21 982 7805
 
 **
 The discussion list for  http://webstandardsgroup.org/
 
  See http://webstandardsgroup.org/mail/guidelines.cfm
  for some hints on posting to the list  getting help
 **
 

**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**