Wednesday 15 June 2011

server side - CSS syntax not for STYLE -


I think CSS syntax and base principles can be very useful, not just for style, is there any PARSE engine Which can work with rules like CSS, for example XML?


For example, we can create some similar profiles (yes, second one) in which we define the page in XML style (examples only, maybe very stupid or two complex): < / P>

  & lt; Page id = "index" url = "/" controller = "static page" /> & Lt; Page id = "about" url = "/" controller = "static page" action = "about" /> & Lt; Page id = "post" url = "/ post / (\ d +)" type = "regex" controller = "post" square = "" & gt; & Lt; Param id = "1" name = "post_id" /> & Lt; / Page & gt; & Lt; Page id = "post_comment" url = "/ comment / (\ d +)" type = "regex" controller = "post" action = "comment" class = "authneeded" & gt; & Lt; Param id = "1" name = "post_id" /> & Lt; / Page & gt; & Lt; Page id = "post_write" url = "/ write" type = "regex" controller = "static page" action = "type" class = "authneeded" />  

And type a "CSS" for this:

  * {layout: "layout.html"; // default layout} * [action = ''] {action: "index"; // default action} #post_write {layout: "adminlayout.html"; } .authneeded {redirect: "/"; }. Athaned: Login {// pseudoclas which is only entered when the user has entered. // (Maybe post: log in. Only one // incorrect for implementing pseudoculse) Redirect: incorrect; // No, we do not have to redirect the user to log in}  

Is not it an interesting way to configure? Even better, we can create an administrator script (jquery-inspired;)

  ./ admin # addoutClass authneeded ./admin "#post PARAM" attr id param_post  

Is there any engine that can work with rules like CSS?

Actually there is no CSS, but when you mention xml, always happens, Which can be used to convert XML to different ways. For example, you can create an HTML list from a simple XML file and similarly.


No comments:

Post a Comment