From: <hoe...@us...> - 2005-01-22 18:56:18
|
Update of /cvsroot/perl-css/CSS-SAC/lib/CSS/SAC/Selector In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8875 Modified Files: ToXPath.pm Log Message: Added todo for quote marks inside contains expressions Index: ToXPath.pm =================================================================== RCS file: /cvsroot/perl-css/CSS-SAC/lib/CSS/SAC/Selector/ToXPath.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ToXPath.pm 19 Sep 2004 21:02:11 -0000 1.1 +++ ToXPath.pm 22 Jan 2005 18:56:06 -0000 1.2 @@ -5,6 +5,27 @@ # todo: haven't looked at the code for years, # probably needs some work... +# @@ +# +# All occurences of contains(...) need some re-work to deal with +# selectors that involve quote marks, the outer marks should be +# choosen based on the inner marks and if the string contains +# both types of quote marks, the string needs to be split up and +# use concat(...) to put them together again. For example +# +# :contains(\"\'\"\') +# +# should become +# +# ... contains(..., concat('"', "'", '"', "'")) ... +# +# This can be done by e.g. the following code +# +# my $result = join ", ", map { /'/ ? qq("$_") : qq('$_') } +# grep length, +# split(/(['"])/, $string); +# + sub CSS::SAC::Selector::Sibling::_GetElement { shift->SiblingSelector->_GetElement } sub CSS::SAC::Selector::Descendant::_GetElement |