I have a copy of that book (paper so far), and I am tempted to use certain smples. Other publishers supply you with TAR balls, that you can download from their web-sites, so that you can play with the samples. I didn’t find that mentioned in that book, but to be honest with you: I haven’t yet read this book all through, I rather assume I will only look up certain things occasionally, and actually this is just my “thank you!” to Bob Stayton, the brave DocBook warrior.
Looks like you can only copy+paste the code from the PDF (purchase it!) or from the free HTML.