# Assert\_select and xml:base

**URL:** <https://www.ruby-forum.com/t/assert-select-and-xml-base/113040>\
**Category:** Rails\
**Created:** [August 26, 2007, 7:04pm UTC](https://www.ruby-forum.com/t/assert-select-and-xml-base/113040 "2007-08-26T19:04:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 26, 2007, 7:04pm UTC](https://www.ruby-forum.com/t/assert-select-and-xml-base/113040/1 "2007-08-26T19:04:16Z")

</div>

I trying to use assert\_select to verify some xml content, where I  
specify an xml:base attribute:

However I get an ‘invalid selector’ error when doing this

assert\_select "group[xml:base=‘[http://blah/](http://blah/)’]

I’ve tried variations like putting a blackslash in front of the colon,  
quoting xml:base etc., all to no avail. Anyone know how to do this?

Thanks!

Steve

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 26, 2007, 7:33pm UTC](https://www.ruby-forum.com/t/assert-select-and-xml-base/113040/2 "2007-08-26T19:33:19Z")

</div>

stevemolitor wrote:

> However I get an ‘invalid selector’ error when doing this
> 
> assert\_select "group[xml:base=‘[http://blah/](http://blah/)’]
> 
> I’ve tried variations like putting a blackslash in front of the colon,  
> quoting xml:base etc., all to no avail. Anyone know how to do this?

Try assert\_xpath:

[http://assertxpath.rubyforge.org/classes/AssertXPath.html#assert\_xpath](http://assertxpath.rubyforge.org/classes/AssertXPath.html#assert_xpath)

I just recently tried it, with the REXML backend, on a fb:else tag,  
and it  
worked. I didn’t put a colon in the predicate, though!

I don’t know if assert\_hpricot will work, from the same library, but  
REXML  
is tricky, so read this to learn the issue:

> **[O'Reilly Media - Technology and Business Training](https://www.oreilly.com)**
>
> Gain technology and business knowledge and hone your skills with learning resources created and curated by O'Reilly's experts: live online training, video, books, our platform has content from 200+ of the world's best publishers.

–  
Phlip  
[http://www.oreilly.com/catalog/9780596510657/](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax
