text: Tightrope Walking on the Metaphorical Web
  Expand Messages
  - -----------------------------------------
  Tightrope Walking on the Metaphorical Web
  -----------------------------------------
  by Kurt Cagle
  October 14, 2002
  Many years ago as a teenager, when I dabbled briefly in the Mediaeval
  Faire scene, I discovered one of those profound truths that you can
  only learn from experience -- no one will miss the chance to watch a
  man possibly make a fool of himself. I had come as a monk, dressed in
  brown robes, and fit into the milleaux, but I did not at that time
  have anything specific to do. So, on a whim, I started to tell a
  story, and like an idiot attempted to do so in rhyme. Quickly people
  gathered round, more quickly than I had anticipated, and I discovered
  then that any talent for rhyme that I may have had abandoned me right
  then and there. I sputtered to a halt, people laughed, then walked
  off a little perplexed.
  Some time thereafter, overcoming my own embarassment, I chose to do
  this again, though without the added complexity of introducing rhyme
  into the story. Again, the crowd gathered, but this time,
  concentrating more on the story and the intent, I was actually able
  to keep this impromptu performance going for nearly an hour, weaving
  in additional threads and strands from the audience as I did so.
  T'was a great success, and the applause I received afterwards
  redeemed my earlier efforts. In many ways my love for the art of
  writing and story-telling had at least one of its roots in that
  realization.
  I'm walking that tightrope again with this newsletter. There is a
  certain degree of the impromptu associated with it, no doubt, the
  sense of sitting on a haybale and attempting to spin something of
  value and entertainment to my readers. There is also a sense of the
  absurd, a feeling that my thoughts, ideas and concepts may very well
  be of some utility to others.
  Still, I'm not doing this just for ego's sake. There are a lot of
  things going on with the industry that I'm in, which I would loosely
  call the Web/XML/Application Space, many more things than may be
  apparent from the minimal press releases and desperate earnings
  statements from companies. Indeed, I think that there is all too much
  of a tendency to forget that companies do not invent anything - it is
  the individual effort of people, some in the concert of companies,
  some alone or through more ad hoc groups, that ultimately are
  responsible for everything that happens -- a company or corporation
  is simply a legal fiction, a fiefdom that makes it easier to organize
  those ideas and pass capitol and protection to taking those ideas
  from concept to viable products. I am not going to be talking to
  companies in this newsletter; I'll be talking to (and hopefully with)
  people.
  So, the jesters are dancing in the background, the trumpets sounding
  panoplys in the distance as this poor monk sits down on a bale of hay
  and spins out his stories, his thoughts, his songs. Hear ye, hear ye,
  one and all...
  *********************
  XDocs, A Few Thoughts
  *********************
  I caught the recent press announcement by Microsoft about XDocs, and
  its given me quite a bit to think about. My first impression was
  basically "What took you so long?" There's a curious disconnect
  sometimes with Microsoft, something that I think they need to
  seriously examine - they often have some of the most powerful,
  pervasive tools on the planet for making things work, and I think it
  is fair to say that the company has, with the occasional exception,
  been a major force for bringing computing to the masses.
  Yet at the same time, arenas that you would expect them to be in,
  such as content management, they pass by in favor of what often seems
  the more technically cool. Microsoft Office is one of the few
  complete monopolies that Microsoft really has, and they have been
  critical towards establishing the concept of XML as a data format.
  For all of that, they have only slowly come back to the realization
  that XML is ultimately SGML, a proven technical language for building
  documents that has a forty year pedigree.
  Before they get too far into the full deployment of XDocs, it may
  behoove the program manager to take a serious look at the W3C Web
  Ontology language (). I work with
  schemas every day, but I prefer not to have to write them unless it
  becomes absolutely necessary, because they are in fact a pain in the
  butt to create. Realistically, then, Microsoft's XDoc team might
  seriously want to think about building a tool - a free-form
  brainstorming tool, as it were - that helps people make schemas in
  the first place, putting together the building blocks for Schemas in
  the process -- and not coincidentally, making an RDF/OWL (formerly
  RDF/DAML+OIL) document in the process that can be used for building a
  firm abstraction base. Like much of XML, the back in data formats
  don't ever really need to be seen, but I see them as really critical.
  The semantic web is more than just web services.
  One of the comments that really bothered me from an analyst
  commenting about XDocs was "It'll be useful for large enterprise
  customers, but be pretty much useless for the mom and pop shops."
  Wrong! Wrong! Wrong! The large enterprise customers already have
  realized the value of XML as a document abstraction format and are
  already moving in that direction with their own efforts. The small
  shops, on the other hand, produce a great deal of information that is
  probably more valuable per person than what is produced at the
  enterprise level, and the same can be said to be applicable at the
  individual level. Content management at the level of me consists of
  spending huge amounts of time trying to search through my e-mails for
  that message I sent, trying to keep track of what I wrote last month
  (or six months ago), trying to maintain a cohesive sense of what I
  have done.
  In other words, content management must be local, must be centered
  around the individual, in order for Microsoft's initiatives to
  succeed. There may be a market here, but I honestly think that if MS
  is going to take the effort to make their documents schematized
  around an XML basis, the additional effort to create a personal CM
  tool that could be shipped with Office 11 would probably energize
  that product and give people some real reason to buy it.
  One final thought here. XDocs may also very well be Microsoft's
  attempt to put to rest not only Adobe PDFs (possible, though
  unlikely -- PDFs have been declared dead many times before and
  somehow keep outlasting the competition) but also, perhaps more
  importantly, the XForms initiative out of the W3C
  (). This is not necessarily a hard thing
  to imagine -- XForms have been a non-starter for years, in great part
  because there has been very little support for it from Microsoft. On
  the other hand, if you start thinking about state handling multi-
  frame processing (e.g., wizards) its interesting to ponder the fact
  that if Microsoft does support multi-frame processing then they also
  have a solution that renders easily into both web processing and
  presentation management (in other words, expect that Power Point 11
  will rely heavily upon XDocs).
  For a beta picture of the new XDocs check out:
  *********************
  Portland and Seattle
  *********************
  I've been shuttling back and forth between Woodinville, Washington
  (in Microsoft's backyard) and Portland, Oregon, and its given me a
  chance to compare the state of the two most depressed software
  regions in the country. Things aren't good either place, which makes
  me a little worried for the company at large. Seattle has been
  touting that it is moving away from being a one company town (Boeing)
  for some time, but those claims ring a little hollow as Boeing gears
  up for yet another reduction in forces. Housing in Kirkland (near
  Seattle), which has typically been an area of mixed and somewhat
  older money remains inordinately high -- I've seen apartments going
  for $4000 a month, yet if you look in Redmond, which of course sits
  at the center of Seattle's computer infrastructure, comparable
  apartments are running about half that, or less.
  I attribute this in part to the lack of demand due to the dotCom
  collapse, which in many ways has affected Seattle and Portland worse
  even than it did Silicon Valley. Portland is somewhat cheaper still --
  rent prices are dropping there fast, and you're seeing more agencies
  offering first month off with no last deposit and few fees just to
  get people renting. Some of it may be due to the low interest rates,
  but at the same time, I think that the people who are buying houses
  right now are not first-time homeowners, but boomer empty nesters
  that don't need the space for families anymore and are seeking
  smaller, less expensive (and less maintenance) houses. Renters are
  typically young and mobile, and keeping an eye on the rental market
  gives you a much better sense of the economy, especially wrt the
  largely younger tech community.
  You see this in the jobs listings as well; the companies hiring are
  not, in general, the quirky little startups with the odd names, but
  are generally established companies. A job fair I was at recently had
  only about a dozen companies represented (actually less, since the
  universities and the military have both begun recruiting potential
  students and soldiers from the depressed people at the job fairs),
  and at least two of these companies indicated that they were NOT
  looking for employees for positions in the region.
  Portland is, in many ways, somewhat worse off, though not in all
  areas. Seattle and Portland diverged at some point, with Seattle
  taking most of the software development jobs and Portland
  concentrating on the hardware. Intel's website no longer lists its
  available jobs. I would guess that they realized that the amount of
  work necessary to deal with the additional resumes was not worth the
  chance of potentially finding a gem in the dross. Other hardware
  companies in Portland are cutting to the bone or leaving entirely,
  typically overseas.
  All is not lost, however. Programmers are, by and large, a
  resourceful lot, and also tend to be naturally frugal (except for
  computer equipment ... and books & magazines). I expect that marriage
  counselling is probably a growth industry right now as all of those
  spouses who married programmers find that programmers don't tend to
  be all that sociable when at home and unemployed, but instead escape
  inside their computers. However, there's likely to be some real
  growth in open-source code, driven in part to build resume samples,
  in part because writing code is more interesting than sending out yet
  another resume to Monster.com, Dice, et al. Now would be the time for
  venture capitalists to seriously start exploring a lot of the open
  source projects and sites -- SourceForge
  (), Yahoo Groups (),
  Microsoft's Workspaces
  (); rather than trying
  to come up with a niche idea to try to fill (which is what I think
  caused a lot of the late-dotCOM foment) it makes a lot more sense to
  see what tools are being developed to fill real niches.
  *********************
  Code for the Day
  *********************
  I will not promise that I'll have new code in every issue, but I'll
  try to make sure that there's at least some gem to keep from issue to
  issue. This one comes from my recent explorations of Xpath and XSLT
  2.0, the upcoming version of which may revive XSLT's flagging
  fortunes of late.
  Sequences are an integral part of the new XPath 2 spec, and are worth
  exploring in their own right. I won't be doing that here (I'll
  probably do so in an upcoming XML Inquiry article), but I did find
  that sequences are not the same as vectors. For instance, if you
  attempt to add two sequences together:
  (1,2,3) + (4,5,6)
  the answer is => 5
  That's because the plus operator is not overloaded to handle
  sequence/sequence operations, so the XPath processor evaluates the
  first item in each list and exits the operation if it is non-zero.
  Interestingly, this also means that
  (1,2,3) + (-1,0,1) => 2
  since the first number evaluates to 0, an implicit Boolean false()
  value.
  On the other hand, there is no obvious way to get the result
  (1,2,3) + (4,5,6) => (5,7,9)
  However, you can use the tokenize() function, which I am becoming
  convinced will be the most important new function added to XSLT, in
  order to create an implicit list that can be converted into a
  sequence. I specifically created a new library called vector: (in the
  file vector.xsl) below, that defines a number of useful vector
  functions in XSLT 2:
  vector.xsl
  <xsl:stylesheet
  xmlns:xsl=""
  xmlns:vector=""
  xmlns:math="java:java.lang.Math"
  xmlns:
  <xsl:output
  <xsl:function
  :diff">
  :scalarMult">
  <xsl:param
  <xsl:param
  <xsl:variable
  <xsl:for-each
  <xsl:variable
  <xsl:value-of select="number($vec[$pos])
  *number($scalar)"/><xsl:if,</xsl:if>
  </xsl:for-each>
  </xsl:variable>
  <xsl:result
  </xsl:function>
  <xsl:function
  <xsl:param
  <xsl:param
  <xsl:variable name="vectorDiff" select="vector:diff
  ($vec2,$vec1)"/>
  <xsl:variable name="vectorSumDiffs" select="vector:dot
  ($vectorDiff,$vectorDiff)"/>
  <xsl:result
  </xsl:function>
  <xsl:function
  ="sum(tokenize($vectorSum,','))"/>
  </xsl:function>
  <xsl:function
  <xsl:param
  <xsl:result>[<xsl:for-each<xsl:value-
  of<xsl:if test="position() ne last
  ()">,</xsl:if></xsl:for-each>]</xsl:result>
  </xsl:function>
  </xsl:stylesheet>
  You would invoke the functions in the vector: namespace by importing
  it into the calling XSLT and defining the namespace in the
  <xsl:stylesheet> header. The following XSLT importing document
  illustrates the usage for both two and three dimensional vectors:
  <xsl:stylesheet
  xmlns:xsl=""
  xmlns:
  <xsl:import
  <xsl:output
  <xsl:template
  <html>
  <xsl:variable
  <xsl:variable
  <xsl:variable
  <xsl:variable
  <head>Vector Test</head>
  <body>
  <h1>Vector Test</h1>
  <p>Vector $p1 = <xsl:value-of select="vector:toString
  ($p1)"/></p>
  <p>Vector $p2 = <xsl:value-of select="vector:toString
  ($p2)"/></p>
  <p>vector:add($p1,$p2) = <xsl:value-of</p>
  <p>vector:diff($p2,$p1) = <xsl:value-of</p>
  <p>vector:scalarMult(5,$p1) = <xsl:value-of</p>
  <p>vector:distance($p1,$p2) = <xsl:value-of</p>
  <p>vector:dot($p1,$p2) = <xsl:value-of</p>
  <hr/>
  <p>Vector $p3 = <xsl:value-of select="vector:toString
  ($p3)"/></p>
  <p>Vector $p4 = <xsl:value-of select="vector:toString
  ($p4)"/></p>
  <p>vector:add($p3,$p4) = <xsl:value-of</p>
  <p>vector:diff($p4,$p3) = <xsl:value-of</p>
  <p>vector:scalarMult(5,$p3) = <xsl:value-of</p>
  <p>vector:distance($p3,$p4) = <xsl:value-of</p>
  <p>vector:dot($p3,$p4) = <xsl:value-of</p>
  </body>
  </html>
  </xsl:template>
  </xsl:stylesheet>
  Note that I am using the Java java.util.Math class in order to
  determine the square root of the squares of the differences for the
  distance, but other than that the code is all XSLT. The output looks
  (more or less) like:
  Vector Test
  -----------
  Vector $p1 = [3,5]
  Vector $p2 = [6,11]
  vector:add($p1,$p2) = [9,16]
  vector:diff($p2,$p1) = [3,6]
  vector:scalarMult(5,$p1) = [15,25]
  vector:distance($p1,$p2) = 6.708203932499369
  vector:dot($p1,$p2) = 73
  ----------------------------------------------------------------------
  ----------
  Vector $p3 = [3,5,2]
  Vector $p4 = [6,11,-1]
  vector:add($p3,$p4) = [9,16,1]
  vector:diff($p4,$p3) = [3,6,-3]
  vector:scalarMult(5,$p3) = [15,25,10]
  vector:distance($p3,$p4) = 7.3484692283495345
  vector:dot($p3,$p4) = 71
  I'll be adding more classes like this over time. I'm using Michael
  Kay's Saxon 7.2, but am only employing XSLT 2 functionality.
  Until next time,
  Kurt Cagle
  (kurt@...)
  P.S.: I am available for consultation or possible full time work.
  Please contact me at (360) 951-6159 for more information.
  Your message has been successfully submitted and would be delivered to recipients shortly.