{"id":264,"date":"2008-05-21T22:06:44","date_gmt":"2008-05-22T05:06:44","guid":{"rendered":"https:\/\/dubinko.info\/blog\/?p=264"},"modified":"2008-05-21T22:09:00","modified_gmt":"2008-05-22T05:09:00","slug":"xquery-annoyances","status":"publish","type":"post","link":"https:\/\/dubinko.info\/blog\/2008\/05\/xquery-annoyances\/","title":{"rendered":"XQuery Annoyances&#8230;"},"content":{"rendered":"<p>If you are used to XSLT 1.0 and XForms, you see <code>{ $book\/bk:title }<\/code> and think nothing of it. XSLT 1.0 calls the curly-brace construct an Attribute Value Template, which is pretty descriptive of where it&#8217;s used. Always in an attribute, always converted into a string, even if you are actually pointing to an element.<\/p>\n<p>In XQuery, though, the curly-brace construct can be used in many different places. Depending on the context, the above code might well insert a <code>bk:title<\/code> element into your output. The proper thing to do, of course, is <code>{ $book\/bk:title\/text() }<\/code>. Many XSLT and XForms authors would omit the extra <code>text()<\/code> selector as superfluous, but in XQuery it matters.<\/p>\n<p>What&#8217;s worse, depending on your browser, you might not see any output on the page within a <code>&lt;bk:title&gt;<\/code> element (or a title element of any namespace). Caveat browser! -m<\/p>\n<p>-m<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are used to XSLT 1.0 and XForms, you see { $book\/bk:title } and think nothing of it. XSLT 1.0 calls the curly-brace construct an Attribute Value Template, which is pretty descriptive of where it&#8217;s used. Always in an attribute, always converted into a string, even if you are actually pointing to an element&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[33,7,14,113,13,4,124],"tags":[1170,126,103,128,129,127,1157,1153,1169,96,125],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-annoyance","category-browsers","category-firefox","category-mark-logic","category-xforms","category-xml","category-xquery-standards","tag-annoyance","tag-avt","tag-book","tag-curly-brace","tag-output","tag-title","tag-xforms","tag-xml","tag-xpath","tag-xquery","tag-xslt"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8eo8l-4g","_links":{"self":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":0,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"wp:attachment":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}