{"id":442,"date":"2007-08-18T22:07:00","date_gmt":"2007-08-18T21:07:00","guid":{"rendered":"http:\/\/blog.widmann.org.uk\/?p=442"},"modified":"2007-08-18T22:07:00","modified_gmt":"2007-08-18T21:07:00","slug":"xslt-syntax","status":"publish","type":"post","link":"https:\/\/widmanniana.org\/blog\/xslt-syntax\/","title":{"rendered":"XSLT syntax"},"content":{"rendered":"<div style=\"float: right; margin-left: 10px; margin-bottom: 10px;\"> <a href=\"http:\/\/www.flickr.com\/photos\/mollyeh11\/433909427\/\" title=\"photo sharing\"><img decoding=\"async\" src=\"http:\/\/farm1.static.flickr.com\/183\/433909427_e69e130d99_m.jpg\" alt=\"\" style=\"border: 2px solid rgb(0, 0, 0);\" \/><\/a><br \/>\n<span style=\"margin-top: 0px;font-size:0;\" >  <a href=\"http:\/\/www.flickr.com\/photos\/mollyeh11\/433909427\/\">XSLT, Sexy?<\/a><br \/>\nOriginally uploaded by <a href=\"http:\/\/www.flickr.com\/people\/mollyeh11\/\">mollyeh11<\/a> <\/span><\/div>\n<p>I taught myself XSLT last Thursday, and I must admit I&#8217;m in two minds about it.<\/p>\n<p>On the one hand, it&#8217;s a really nice way to deal with many common transformations, but on the other hand, I&#8217;m getting sick and tired of typing <tt>&lt;xsl:<\/tt> all the time.<\/p>\n<p>It&#8217;d be really nice to have a preprocessor to transform a somewhat saner syntax to real XSLT.  What I imagine is something that would allow me to write something like this:<\/p>\n<pre>      exec entity-ref (name=\"nbsp\");\n      print \"&lt;b>\\n\";\n      if xsl:* {\n          print \"x\"\n      }\n      print \"&lt;\/b>\\n\";\n      print $name(.);<\/pre>\n<p> instead of this:<\/p>\n<pre>      &lt;xsl:call-template name=\"entity-ref\">\n         &lt;xsl:with-param name=\"name\">nbsp&lt;\/xsl:with-param>\n      &lt;\/xsl:call-template>\n      &lt;b>\n      &lt;xsl:if test=\"xsl:*\">\n          &lt;xsl:text>x&lt;\/xsl:text>\n      &lt;\/xsl:if>\n      &lt;\/b>\n      &lt;xsl:value-of select=\"name(.)\"\/><\/pre>\n<p>Has anybody done that yet?  Or will I have to do that myself if I want it badly enough?  Is there any good reason for not doing it (apart from not getting begin and end tags matched for free in cases such as <tt>&lt;b&gt;...&lt;\/b&gt;<\/tt> above)?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>XSLT, Sexy? Originally uploaded by mollyeh11 I taught myself XSLT last Thursday, and I must admit I&#8217;m in two minds about it. On the one hand, it&#8217;s a really nice way to deal with many common transformations, but on the other hand, I&#8217;m getting sick and tired of typing &lt;xsl: all the time. It&#8217;d be really nice to have a preprocessor to transform a somewhat saner syntax to real XSLT. What I imagine is something that would allow me to write something like this: exec entity-ref (name=&#8221;nbsp&#8221;); [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[159,114],"tags":[],"class_list":["post-442","post","type-post","status-publish","format-standard","hentry","category-en","category-computing"],"_links":{"self":[{"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":0,"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"wp:attachment":[{"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/widmanniana.org\/blog\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}