From: <bin...@li...> - 2001-10-09 21:10:05
|
Hi, i'm currently on the BccHrefCompiler and the following problem occured. The Regex to grab the tags does not handle nested tags properly. preg_match_all("!<(bc:.*?)>.*?</\\1.*?>!si", $source, $match); i.e.: ... <bc:href> <id>123</id> <content> <bc:img> <id>321</id> </bc:img> </content> </bc:href> ... The regex now extracts the whole bc:href stuff including the bc:img tag. Then the href compiler is called and its output replaces the whole thing. The desired behavior is, that it first replaces the inner tag(s) calling the ImgCompiler then calling the Href Compiler. A possible solution is to call the ImgCompiler from within the Href Compiler, what I dislike. Another might be using some kind of recrusion or the php native xml_parser functions using some kind of event based parsing. Any ideas? andi |