Is there any way to get newline delimited output on multiple matching nodes for Saxon-HE 9.6 ?

I use this wrapper named `saxon-lint` :

```
#!/bin/bash

java -cp /path/to/saxon9he.jar net.sf.saxon.Query -s:"$2" -qs:"$1" !method=text

```

Example :

### file.xml

```
<house_pet_hazards>
  <hazard type="cleanup">
    <name>hairballs</name>
    <guilty_party species="cat">Dilly</guilty_party>
    <guilty_party species="cat">Nameless</guilty_party>
    <guilty_party species="cat">Katie</guilty_party>
  </hazard>
</house_pet_hazards>

```

### COMMAND LINE :

```
$ saxon-lint '/house_pet_hazards/hazard/guilty_party' file.xml

```

### OUTPUT :

```
DillyNamelessKatie

```

### EXPECTED OUTPUT :

```
Dilly
Nameless
Katie

```

---

### EDIT

[I've found a semi-working solution by searching google hardly](http://sourceforge.net/p/saxon/mailman/message/20634561/) proposed by [Michael Kay](https://stackoverflow.com/users/415448/michael-kay), so I wrote this wrapper :

```
#!/bin/bash

xpath="$1"
[[ -s $2 ]] && file="$(readlink -f "$2")" || file=/dev/stdin

java -cp saxon9he.jar net.sf.saxon.Query -qs:"for \$x in doc('file://$file')$xpath
return (data(\$x),text{'&#10;'})" !method=text

```

### output :

```
$ saxon-lint "/house_pet_hazards/hazard/guilty_party" /tmp/file.xml
Dilly
Nameless
Katie

```

But the problem I found is that when I use the path 

```
house_pet_hazards/hazard/guilty_party

```

I get error 

```
Error on line 1 column 37 
  XPST0003 XQuery syntax error near #...p/file.xml')house_pet_hazards/#:
    expected "return", found name "house_pet_hazards"
Static error(s) in query

```

or

```
./house_pet_hazards/hazard/guilty_party

```

I get error :

```
Error on line 1 column 37 
  XPST0003 XQuery syntax error near #... doc('file:///tmp/file.xml')./#:
    expected "return", found "."
Static error(s) in query

```

---

### [The wrapper](https://github.com/sputnick-dev/saxon-lint)

---