From: <bin...@li...> - 2001-10-09 21:53:23
|
> 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. I believe the href tag is the only tag we have right now which can accept other bc tags as params... so I think the internal 'sub-parsing' is 100% applicable, and valid + clean. _alex > > 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 > > > _______________________________________________ > binarycloud-dev mailing list > bin...@li... > https://lists.sourceforge.net/lists/listinfo/binarycloud-dev > http://www.binarycloud.com > http://www.sf.net/projects/binarycloud/ > |