Created
May 2, 2014 00:28
-
-
Save grantmacken/7a3621ccaba917294641 to your computer and use it in GitHub Desktop.
using map in tests to check if node has tag-name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
%test:args('<a class="h-entry" href="http://microformats.org/2012/06/25/microformats-org-at-7">microformats.org at 7</a>') | |
%test:assertExists | |
%test:assertTrue | |
%test:assertXPath("count($result) = 1") | |
%test:assertXPath("local-name($result[1]) eq 'entry'") | |
%test:assertXPath(" 'name' = ( map(function($n) { local-name($n) }, $result[1]/*) ) ") | |
%test:assertXPath(" 'url' = ( map(function($n) { local-name($n) }, $result[1]/*) ) ") | |
function st:just-a-hyperlink($node as element()) as element() { | |
mf2:dispatch($node) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
'joe' = ( jack, jim , joe, )
true in xquery as 'joe' appears in sequence
our test
element tag-name should be nested in container element
use map to create sequence
'name' = ( map(function($n) { local-name($n) }, $result[1]/*) )