[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: More about the variable matching question at the end of the last TC call
Variable Matching Question
One final question arose at the end of the call with regard to the variable matching rules for the following two expressions:
=markus{}<#tel>
=markus{<#tel>}
The question is: do they both evaluate to the same set of matching nodes? Or does the first one specify a single match because it ends in concrete singleton?
Let's add a few more patterns here:3. =markus{}{<#tel>}4. =markus{<#>}<#tel>5. =markus{<#>}{<#tel>}
6. =markus{}{<#>}<#tel>7. =markus{}{<#>}{<#tel>}Then I think the patterns would match as follows:A =markus<#tel> 1, 2, 3B =markus[<#tel>]<!:uuid:1111> 2, 3E =markus#profile<#tel> 1, 3C =markus<#home><#tel> 1, 3, 4, 5, 6, 7D =markus<#home>[<#tel>]<!:uuid:1111> 3, 5, 7H =markus#profile<#home>[<#tel>]<!:uuid:1111> 3, 7F =markus#profile[<#tel>]<!:uuid:1111> 3G =markus#profile<#home><#tel> 1, 3, 6, 7This is my intuition, I'd need a bit more time to fully put that into words..I think this means that the {} common variable may match any number of arcs (including zero), whereas all others have to match at least 1 arc.
=markus{1}<#tel> <-- would match exactly one instance of a <$tel> singleton at any depth=markus{1}{<#tel>} <-- would match exactly one instance of a <$tel> singleton or collection member at any depth=markus{0-2}<#tel> <-- would match zero, one, or two instances of a <$tel> singleton at any depth (zero means a match is optional)=markus{0-2}{<#tel>} <-- would match zero, one, or two instances of a <$tel> singleton or collection member at any depth
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]