Re: XML Paths in Programming Languages

That’s part way there; I was really after something that used the XPath syntax for variables, and passed in a hash/dictionary of mappings from variable names to native values that were automatically mapped onto XPath data types. For example:

smellyCheeses = XPath.match(doc,
                            '/cheese[@strength = $strength]',
                            ('strength' => 'smelly'))
interestingLunches = XPath.match(recipes,
                                 '/recipes/recipe/ingredient
                                    [@name = $smellyCheeses/name]',
                                 ('smellyCheeses' => smellyCheeses))

Reply

The content of this field is kept private and will not be shown publicly.