Hi Mike,
I'd been thinking on the lines of using regexs and managed to do tags and 
attributes.

Your suggestion of doing it per char is a much better approach.
Have been trying to learn more about regexs and must have got tunnel vision.

Some attributes like ids and classes are capitalized, and need to remain that 
way.
So your method would be easy to filter these.
I'm on the case.
Thanks, Bob.



----- Original Message ----- 
From: "Mike Franks" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, July 31, 2005 7:13 PM
Subject: Re: [php-list] Lowercase problem

> Bob, from what you're describing, I'd recommend writing your own file
> parsing routine to fix these files. It's not a difficult algorithm.
> 
> Open input file
> Open new output file
> Parse each char from input file, looking for "<"
> When "<" found, examine next char, to determine it is either "/" or
> an alpha. If so, call a user function. I'll use lcTags() for my example.
> 
> function lcTags() {
> lowercase each char until ">" or "=" is found
> if "=" check next char for single or double quote
> if quoted, leave case as is until matching closing quote
> if ">" return
> }
> 
> I'm sure you get the idea. Be sure to parse by character rather than by
> line.
> 
> hth,
> Mike



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h5r3sak/M=362335.6886445.7839731.1510227/D=groups/S=1705005703:TM/Y=YAHOO/EXP=1122843721/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In
 low income neighborhoods, 84% do not own computers. At Network for Good, help 
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to