Ideally, both:

> myDocument / 'entity' @ 'name'
> 
> or
> 
> myDocument / #entity @ #name.

should work. You are here defining a small api to formulate xpath queries, 
which is great. However, I am not sure that your api will cover all features 
offered by xpath. The syntax "myDocument xPath: 'entity/@name’”  may also be 
supported.

Alexandre



> On Sep 17, 2015, at 11:10 AM, Peter Uhnák <i.uh...@gmail.com> wrote:
> 
> Are there some best practices regarding using strings and symbols?
> 
> For example I am processing XML and I might query it via xpath...
> 
> myDocument xPath: 'entity/@name',
> 
> or
> 
> myDocument xPath: #'entity/@name'
> 
> or
> 
> myDocument / 'entity' @ 'name'
> 
> or
> 
> myDocument / #entity @ #name.
> 
> So does it make sense to prefer one over the other here?
> 
> Any opinion/advice appreciated,
> 
> Peter

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply via email to