{"id":380,"date":"2008-11-04T00:05:20","date_gmt":"2008-11-04T07:05:20","guid":{"rendered":"https:\/\/dubinko.info\/blog\/?p=380"},"modified":"2008-11-04T00:05:20","modified_gmt":"2008-11-04T07:05:20","slug":"xix-details-about-xforms-in-xquery","status":"publish","type":"post","link":"https:\/\/dubinko.info\/blog\/2008\/11\/xix-details-about-xforms-in-xquery\/","title":{"rendered":"XiX: Details about XForms in XQuery"},"content":{"rendered":"<p>I was asked offline for more details about what I have in mind around XiX.<\/p>\n<p>Take a simple piece of XML, like this: <code>&lt;root&gt;&lt;a&gt;3&lt;\/a&gt;&lt;b&gt;4&lt;\/b&gt;&lt;total\/&gt;&lt;\/root&gt;<\/code>.<\/p>\n<p>An XForms Model can be applied, in an out-of-line fashion, to that instance. This is done through a <code>bind<\/code> element, with XPath to identify the nodes in question, plus other &#8220;model item properties&#8221; to annotate the instance. The <code>calculate<\/code> property is a good one: <code>&lt;bind nodeset=\"total\" calculate=\"..\/a + ..\/b\"\/&gt;<\/code>. When called upon to refresh the instance, as you would expect, the result contains the node <code>&lt;total&gt;7&lt;\/total&gt;<\/code>.<\/p>\n<p>Like lots of algorithms, though, XForms is defined in a thoroughly procedural manner. Functional programming has a stricture against assignment operators, like setting the value &#8220;7&#8221; into the calculated node above. So the challenge is coming up with an implementation that works within these bounds. For example, perhaps a function that takes an original instance as input, and returns a newly-created updated instance. Simple enough for the example here, but in more complex cases with different and interacting model item properties, regenerating the entire instance frequently has performance penalties.<\/p>\n<p>So, I&#8217;m trying to find the right expression of the XForms Model in a functional guise. (As <a href=\"http:\/\/rdfa.info\/wiki\/Functional_RDFa\">with<\/a> RDFa). I&#8217;m curious about what anyone else has come up with in this area. -m<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was asked offline for more details about what I have in mind around XiX. Take a simple piece of XML, like this: &lt;root&gt;&lt;a&gt;3&lt;\/a&gt;&lt;b&gt;4&lt;\/b&gt;&lt;total\/&gt;&lt;\/root&gt;. An XForms Model can be applied, in an out-of-line fashion, to that instance. This is done through a bind element, with XPath to identify the nodes in question, plus other &#8220;model&#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":[13,32,124],"tags":[504,364,503,1157,502,1169,96],"class_list":["post-380","post","type-post","status-publish","format-standard","hentry","category-xforms","category-xpath","category-xquery-standards","tag-calculate","tag-functional","tag-model","tag-xforms","tag-xix","tag-xpath","tag-xquery"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8eo8l-68","_links":{"self":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts\/380","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=380"}],"version-history":[{"count":0,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/posts\/380\/revisions"}],"wp:attachment":[{"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/media?parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/categories?post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dubinko.info\/blog\/wp-json\/wp\/v2\/tags?post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}