{"id":16,"date":"2004-04-26T13:48:14","date_gmt":"2004-04-26T20:48:14","guid":{"rendered":"http:\/\/www.laurenwood.org\/anyway\/index.php\/archives\/2004\/04\/26\/technology-works\/"},"modified":"2007-02-16T16:36:07","modified_gmt":"2007-02-17T00:36:07","slug":"technology-works","status":"publish","type":"post","link":"https:\/\/www.laurenwood.org\/anyway\/2004\/04\/technology-works\/","title":{"rendered":"Technology Works?"},"content":{"rendered":"<p>I\u2019ve been slowly work\u00ading on a tutori\u00adal for using entity res\u00adol\u00adu\u00adtion cata\u00adlogs that I prom\u00adised the <span class=\"caps\">OASIS<\/span> Entity Res\u00adol\u00adu\u00adtion Tech\u00adnic\u00adal Com\u00admit\u00adtee (<span class=\"caps\">ERTC<\/span>) I\u2019d do (I chair the <span class=\"caps\">TC<\/span>). As befits a prop\u00ader tutori\u00adal, I figured I should test out the bits as I\u2019m writ\u00ading them in more than one imple\u00adment\u00ada\u00adtion, just so I can warn people of the poten\u00adtial pit\u00adfalls. This has proven to be a frus\u00adtrat\u00ading exper\u00adi\u00adence for me, and I can see why so many people say tech\u00adno\u00adlogy is just too&nbsp;hard.<\/p>\n<p><!--more--><\/p>\n<p>The cata\u00adlog spe\u00adcific\u00ada\u00adtion itself is fine; not widely imple\u00admen\u00adted enough in my opin\u00adion (for example, <span class=\"caps\">MSXML<\/span> does\u00adn\u2019t sup\u00adport it) but we\u2019re hop\u00ading to change that in the <span class=\"caps\">TC<\/span>. Even those tools that do sup\u00adport cata\u00adlogs often do so piece\u00admeal; for example I\u2019ve tested the cata\u00adlog sup\u00adport in jEd\u00adit and it works as expec\u00adted \u2014 but not in the <span class=\"caps\">XSLT<\/span> plu\u00adgin. Sup\u00adport\u00ading files that the edit\u00ador finds aren\u2019t found when you come to trans\u00adform the doc\u00adu\u00adment you\u2019re edit\u00ading. The <span class=\"caps\">XSLT<\/span> trans\u00adform uses Xalan so I can prob\u00adably fig\u00adure out how to make it work with a cata\u00adlog \u2014 but I should\u00adn\u2019t need&nbsp;to.<\/p>\n<p>And talk\u00ading of Xalan \u2014 this whole sys\u00adtem is just too hard. In the tutori\u00adal I wanted to use the <span class=\"caps\">XML<\/span> stylesheet <span class=\"caps\">PI<\/span> as an example of the <code>uri<\/code> ele\u00adment to keep the con\u00adcepts simple. And Xalan, being part of the Apache <span class=\"caps\">XML<\/span> pro\u00adject, is reas\u00adon\u00adably widely used. So here are the steps I went through to try to have my stylesheet be some\u00adwhere oth\u00ader than in the same dir\u00adect\u00adory as the doc\u00adu\u00adment says it&nbsp;is.\u2026<\/p>\n<ol>\n<li>Down\u00adload <a href=\"http:\/\/xml.apache.org\/xalan-j\/index.html\" title=\"link to Xalan\">Xalan<\/a> and install<\/li>\n<li>Down\u00adload Norm Walsh\u2019s <a href=\"http:\/\/xml.apache.org\/commons\/components\/resolver\/index.html\" title=\"entity resolver link\">entity resolv\u00ader<\/a> for Java (so far, so&nbsp;good)<\/li>\n<li>test with the cata\u00adlog I\u2019ve been using up till now. No&nbsp;luck<\/li>\n<li>dis\u00adcov\u00ader that the <span class=\"caps\">JDK<\/span> that you just installed on the new <span class=\"caps\">PC<\/span> did\u00adn\u2019t add itself to the <span class=\"caps\">PATH<\/span> and so the <span class=\"caps\">PC<\/span> is mer\u00adrily using whatever <code>java<\/code> execut\u00adable it found in the Win\u00addows sys\u00adtem dir\u00adect\u00adory. Sigh. Add the Java bin dir\u00adect\u00adory by hand to the <span class=\"caps\">PATH<\/span> envir\u00adon\u00adment variable.<\/li>\n<li>the cata\u00adlog still isn\u2019t being found. Hunt around on google for poten\u00adtial answers<\/li>\n<li>Dis\u00adcov\u00ader that the <span class=\"caps\">JDK<\/span> 1.4.2 comes with its own ver\u00adsion of Xalan, which is too old, and does\u00adn\u2019t allow you to reset the resolv\u00ader with com\u00admand line options, and you have to tell Java that the Xalan dir\u00adect\u00adory is <em>\u201cendorsed\u201d<\/em> (whose bright idea was this? Just over\u00adwrit\u00ading the jar files with the new set should be suf\u00adfi\u00adcient, but no, you have to tell java as well that you really meant for the new Xalan to be&nbsp;used).&nbsp;<\/li>\n<li>This does\u00adn\u2019t work either, but the error mes\u00adsages are dif\u00adfer\u00adent now, so some\u00adthing changed\u2026 dis\u00adcov\u00ader that you also have to put the resolv\u00ader jar into the same <em>\u201cendorsed\u201d<\/em> directory<\/li>\n<li>the cata\u00adlog still does\u00adn\u2019t work, and run\u00adning the \u201cverb\u00adose\u201d option on the resolv\u00ader gives you more details\u2026 now you\u2019ve run into what I con\u00adsider a bug in <span class=\"caps\">SAX<\/span> (for details, see <a href=\"http:\/\/www.xml.com\/pub\/a\/2001\/06\/20\/catalogs.html\" title=\"link to article on SAX and catalogs\">Leigh Dod\u00add\u2019s art\u00adicle<\/a>) which means you have to rewrite the entity cata\u00adlog to put in abso\u00adlute URIs where you had rel\u00adat\u00adive URIs before since <span class=\"caps\">SAX<\/span> only passes abso\u00adlute URIs (this does some\u00adwhat lower the ues\u00adful\u00adness of cata\u00adlogs since you can\u00ad\u2019t move your dir\u00adect\u00ador\u00adies around as eas\u00adily any more). Change all the cata\u00adlogs (but not the ones for the oth\u00ader applic\u00ada\u00adtions which don\u2019t require this).<\/li>\n<li>Now the basic cata\u00adlog works, so let\u2019s try it with the stylesheet. Com\u00admand line at this stage is <code>java -Djava.endorsed.dirs=\"c:\\java\\xalan-j_2_6_0\\bin\" org.apache.xalan.xslt.Process -in example.xml -xsl example.xsl -out example.html<br>\n-URIRESOLVER org.apache.xml.resolver.tools.CatalogResolver -ENTITYRESOLVER org.apache.xml.resolver.tools.CatalogResolve <\/code><br>\nDis\u00adcov\u00ader that Xalan does\u00adn\u2019t apply the entity resolv\u00ader to the com\u00admand line. And using the <span class=\"caps\">XML<\/span> stylesheet <span class=\"caps\">PI<\/span> does\u00adn\u2019t seem to work either.&nbsp;<\/li>\n<li>Give up on Xalan and resolve to try <code>libxml<\/code><\/li>\n<\/ol>\n<p>Stay tuned for adven\u00adtures from the <code>libxml<\/code> world. And when I have suf\u00adfi\u00adcient energy I\u2019ll go back and see if I can nail down why I can\u00ad\u2019t get Xalan to work with the stylesheet <span class=\"caps\">PI<\/span> (it\u2019s meant to, apparently).<\/p>\n<p>Ser\u00adi\u00adously, it\u2019s no won\u00adder people say tech\u00adno\u00adlogy is just too hard. I have the advant\u00adage of being reas\u00adon\u00adably tech\u00adnic\u00adal, and know\u00ading people like Norm Walsh who told me about the <span class=\"caps\">SAX<\/span> prob\u00adlems. How are people without those con\u00adnec\u00adtions meant to be able to put all this together?&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve been slowly work\u00ading on a tutori\u00adal for using entity res\u00adol\u00adu\u00adtion cata\u00adlogs that I prom\u00adised the <span class=\"caps\">OASIS<\/span> Entity Res\u00adol\u00adu\u00adtion Tech\u00adnic\u00adal Com\u00admit\u00adtee (<span class=\"caps\">ERTC<\/span>) I\u2019d do (I chair the <span class=\"caps\">TC<\/span>). As befits a prop\u00ader tutori\u00adal, I figured I should test out the bits as I\u2019m writ\u00ading them in more than one imple\u00adment\u00ada\u00adtion, just so I can warn people of the poten\u00adtial pit\u00adfalls. This has proved to be a frus\u00adtrat\u00ading exper\u00adi\u00adence for me, and I can see why so many people say tech\u00adno\u00adlogy is just too&nbsp;hard.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[10,6],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-rants","category-technology"],"_links":{"self":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":0,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}