{"id":6563,"date":"2016-06-24T20:34:19","date_gmt":"2016-06-24T18:34:19","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=6563"},"modified":"2021-09-15T17:14:57","modified_gmt":"2021-09-15T15:14:57","slug":"an-xquery-recipe-generating-lots-of-documents-in-a-single-xquery-run","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2016\/06\/24\/an-xquery-recipe-generating-lots-of-documents-in-a-single-xquery-run\/","title":{"rendered":"an XQuery recipe: generating lots of documents in a single XQuery run \u2026"},"content":{"rendered":"<ul>\n<li><a href=\"http:\/\/www.gnu.org\/software\/qexo\/XQ-Gen-XML.html\">http:\/\/www.gnu.org\/software\/qexo\/XQ-Gen-XML.html<\/a>\u00a0\u2013 search there for &#8220;<em>Generate all the HTML output files<\/em>&#8220;!<\/li>\n<\/ul>\n<p>\u2026\u00a0by putting them in a single large XML object \u2013 then use a\u00a0post-processor to split this into separate files. (Alright this isn&#8217;t really a <strong>true<\/strong> &#8220;single XQuery run&#8221; approach. But it is close enough.)<\/p>\n<p>With Saxon-HE there is no way to write to separate text files from within a true single XQuery run, but using xmlstarlet (or whatever) the mentioned post-processor is rather easy to implement:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/xml\/xml_extract_files.sh\">https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/xml\/xml_extract_files.sh<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/xml\/xml_extract_files.0--sample.xml\">https:\/\/github.com\/JochenHayek\/misc\/blob\/master\/xml\/xml_extract_files.0&#8211;sample.xml<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/www.gnu.org\/software\/qexo\/XQ-Gen-XML.html\u00a0\u2013 search there for &#8220;Generate all the HTML output files&#8220;! \u2026\u00a0by putting them in a single large XML object \u2013 then use a\u00a0post-processor to split this into separate files. (Alright this isn&#8217;t really a true &#8220;single XQuery run&#8221; approach. But it is close enough.) With Saxon-HE there is no way to write to separate text [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[851,732,733],"tags":[1281],"class_list":["post-6563","post","type-post","status-publish","format-standard","hentry","category-xmlstarlet","category-xpath","category-xquery","tag-saxon"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-1HR","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=6563"}],"version-history":[{"count":1,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6563\/revisions"}],"predecessor-version":[{"id":11881,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6563\/revisions\/11881"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=6563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=6563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=6563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}