>>We already have XPath. Why use it? Because its like all computer related thing >>teached us for years. Everybody know that ".." means parent. > > > but the question is - what means child? > > "../" is well known in xpath as well as in filesystems for being "one > level up". So what would be the syntax for "one level down" then? AFAICS > there is none for a filesystem. the closest would be "/*/*/*/1" as xpath > syntax. but actually the (virtual) tree of matcher/action results is > > level1 > +-1 > +-2 > | > +-level2 > +-1 > +-2 > +-3 > | > > > for something like this: > > <map:match pattern="**.*"> > <map:match pattern="**/*.*"> > ... > > so adressing the results absolute would be > > /level1/1 > /level1/level2/2 > > which could be written as /*/1 and /*/*/1 or (since we always start with > level1) to /1 and /*/1. which in turn could be reduced to /1 and //2. > > > admittingly {////1} is not very expressive but should be not too hard to > grasp. as I said: it was my first guess... and I asked for comments. but > please be a little more constructive then "it's really poor". next time > please come up with a better syntax ;)
Sorry for my destructiveness, but I don't see any particular reason for adding a new path description. > I must admit that I am not really in favor of Ilya's proposal because it > will virtually flatten the variable tree and will give problems with > variable name clashes. as well is the {bla:something} syntax already > used by the InputModules. I don't need Ilya's proposal too, it was more a compromise. > but I also not very clear myself it is really necessary or useful. an > example would be: > > <map:match pattern="**.html"> > <map:act type=".."> > <map:act type=".."> > <map:generate src="{//fromfirstaction"/> > </map:act> > <map:generate src="{//fromfirstaction"/> > > the absolute refering of the result of the first action would save you > from counting the levels for each position where you want to use the > variable. Which means in XPath fromfirstaction in every level ;-) So it's only confusing. > <map:match pattern="**.html"> > <map:act type=".."> > <map:act type=".."> > <map:generate src="{../fromfirstaction"/> > </map:act> > <map:generate src="{fromfirstaction"/> > > and as soon as you surround a subtree of the pipeline (insert another > act e.g.) you currently have to add a "../" on each use of a variable > from the parent tree. Where you must add a '/' on each use of a variable from the subtree. So is there really a simplification? The only way out of adding '/' or '../' to variable uses from outer or inner tree is the direct accessing of variables via Ilya's proposal. So in my opinion it's nice, independent of possibility of implementation. Regards, Joerg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]