Re: HTML_CSS -> howto parse?

From: Date: Sat, 08 May 2004 17:13:19 +0000
Subject: Re: HTML_CSS -> howto parse?
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29034@lists.php.net to get a copy of this message
> I do not see the sense. HTML is also used with other langs (JS,...). So, why > not stay with the current schema and call another package SVG_CSS? I was just asking a question.. I really don't mind about the chosen name ;-) I don't mind to use HTML_CSS for a SVG use, since I admit the large majority of people use CSS in HTML. > Admittedly, I've not really given too much thought to other uses of CSS > beyond (X)HTML and other XML variations. If SVG uses it, then it must > use the same schema as any regular CSS that could be used for HTML. When > I proposed the package, it seemed clear to people that it was most often > useful when used in conjunction with HTML. Hence the name I chose. > However, I fully intend to support any and all standards compliant CSS. > Whether or not it bears the proper name is a different issue, and it's > kinda late for a name change now. > > I would be interested in knowing how CSS for SVG is different from CSS > when used in conjunction with HTML. There is no difference between CSS in HTML or in SVG. We put the CSS at the begining of the SVG document, and then we can use this one with class and id tags just like in HTML. The attributes are the same, stroke, color, etc.. You can even use the same CSS for a HTML document and a SVG document. You can even mixe SVG and HTML with namespaces. ______ It is for my ImageMagick->Conjure class, as IM does not support CSS yet, I need to replace all class tags by the style tag with the css code to put each style included (and also add the css code for id tags but without removing it, or perhaps removing it since it is just a replacement in a buffer before giving it to ImageMagick in a blob). So I am searching a Pear package to parse the CSS code into a PHP variable. Is there one? And even perhaps if it exists a class to parse the document and look for matching tags with the css code? (I don't think there is yet this, but have to ask to be sure.) (Making the replacement of the CSS code to put it included in each tag would be exactly the same php code than if it was in HTML, but I don't think there is such a need to make the same thing for HTML.) Cheers.

« previous php.pear.dev (#29034) next »