classafBounce::SizzleMiddleware
sys::Obj afBounce::SizzleMiddleware : afButter::ButterMiddleware
Middleware that lets you make CSS selector queries against the HTTP response.
You need to make sure the ButterResponse
holds a well formed XML document else an XErr
is thrown. If rendering Slim templates then make sure it compiles XHTML documents (and not HTML):
slim := Slim(TagStyle.xhtml)
SizzleMiddleware
lazily parses the ButterResponse
into a SizzleDoc
so you can still make requests for non XML documents - just don't query them!
- select
XElem[] select(Str cssSelector)
Selects elements from the
SizzleDoc
.- sendRequest
virtual override ButterResponse sendRequest(Butter butter, ButterRequest req)
- sizzleDoc
SizzleDoc sizzleDoc { private set }
The
SizzleDoc
associated with the last request.- useHtmlParser
Bool useHtmlParser := true
If
true
(the default) then HtmlParser is used to parse the response for HTML.If
false
then the standard Fantom XML parser is used.