<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>lekkimworld.comxpath</title>
    <link>http://lekkimworld.com/tags/xpath/</link>
    <description>IBM Lotus Notes/Domino, Websphere, IBM Connections, mobile, web, JavaScript, Java...</description>
    <language>en</language>
    <copyright>Mikkel Flindt Heisterberg (mh [at] intravision [dot] dk</copyright>
    <pubDate>Sat, 19 May 2012 06:50:25 GMT</pubDate>
    <dc:creator>Mikkel Flindt Heisterberg (mh [at] intravision [dot] dk</dc:creator>
    <dc:date>2012-05-19T06:50:25Z</dc:date>
    <dc:language>en</dc:language>
    <dc:rights>Mikkel Flindt Heisterberg (mh [at] intravision [dot] dk</dc:rights>
    <image>
      <title>lekkimworld.comxpath</title>
      <url>http://lekkimworld.com/tags/xpath/</url>
    </image>
    <item>
      <title>Using Abdera XPath on the Lotus Connections service document</title>
      <link>http://lekkimworld.com/2009/12/04/using_abdera_xpath_on_the_lotus_connections_service_document.html</link>
      <content:encoded>&lt;p&gt;
As always namespaces and XPath/XSLT is "funny" to play around with. Tonight I have been messing a little with the ATOM feeds available in Lotus Connections and needed to use XPath to extract a URL from the service document instead of the object model in &lt;a href="http://abdera.apache.org"&gt;Abdera&lt;/a&gt;. I didn't find it all together easy to figure out so I'll post it here in case it helps anyone. The key is to specify a java.util.Map with the two namespaces in use (atom, app) when doing the XPath (the "ns" variable) and remembering to use the correct namespaces in the actual XPath string.
&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;
Document&amp;lt;Service&amp;gt; doc = ...;
XPath x = Abdera.getNewXPath();
Map&lt;String, String&gt; ns = new HashMap&lt;String, String&gt;();
ns.put("atom", "http://www.w3.org/2005/Atom");
ns.put("app", "http://www.w3.org/2007/app");

String link = x.valueOf("/app:service/app:workspace" + 
   "/atom:link[@rel='http://www.ibm.com/xmlns/prod/sn" + 
   "/mv/theboard']/@href", service, ns));
System.out.println("Link: " + link);
&lt;/pre&gt;
&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/tags/abdera/">abdera</category>
      <category domain="http://lekkimworld.com/tags/lotus_connections/">lotus_connections</category>
      <category domain="http://lekkimworld.com/tags/xpath/">xpath</category>
      <pubDate>Fri, 04 Dec 2009 15:58:33 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2009-12-04:default/1259942313890</guid>
      <dc:date>2009-12-04T15:58:33Z</dc:date>
    </item>
    <item>
      <title>Tool of the day: XPather</title>
      <link>http://lekkimworld.com/2008/09/23/tool_of_the_day_xpather.html</link>
      <content:encoded>&lt;p&gt;
Simple, powerful and easy to use XPath extension for Firefox to easily work with XPath statements: &lt;a href="http://xpath.alephzarro.com"&gt;XPather&lt;/a&gt;.
&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/tags/extension/">extension</category>
      <category domain="http://lekkimworld.com/tags/firefox/">firefox</category>
      <category domain="http://lekkimworld.com/tags/xml/">xml</category>
      <category domain="http://lekkimworld.com/tags/xpath/">xpath</category>
      <pubDate>Tue, 23 Sep 2008 12:56:00 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2008-09-23:default/1222174560000</guid>
      <dc:date>2008-09-23T12:56:00Z</dc:date>
    </item>
    <item>
      <title>Building XPath expression from XML node</title>
      <link>http://lekkimworld.com/2007/06/19/building_xpath_expression_from_xml_node.html</link>
      <content:encoded>Ever do parsing of large XML/DXL documents? Does the parsing ever fail? If it does you know you need some way to log the offending element in a compact and standardized way. For situations like this (and numerous others) XPath is the way to go and with code like I'll show in this post you are good to go. Java code ahead!&lt;p&gt;&lt;a href="http://lekkimworld.com/2007/06/19/building_xpath_expression_from_xml_node.html"&gt;Read more...&lt;/a&gt;&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/categories/java/">Java</category>
      <category domain="http://lekkimworld.com/categories/xml/">XML</category>
      <category domain="http://lekkimworld.com/tags/dom/">dom</category>
      <category domain="http://lekkimworld.com/tags/dxl/">dxl</category>
      <category domain="http://lekkimworld.com/tags/java/">java</category>
      <category domain="http://lekkimworld.com/tags/xml/">xml</category>
      <category domain="http://lekkimworld.com/tags/xpath/">xpath</category>
      <pubDate>Tue, 19 Jun 2007 06:27:36 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2007-06-19:default/1182234456228</guid>
      <dc:date>2007-06-19T06:27:36Z</dc:date>
    </item>
    <item>
      <title>Free on-line XPath tool</title>
      <link>http://lekkimworld.com/2007/06/16/free_on_line_xpath_tool.html</link>
      <content:encoded>&lt;p&gt;
If you occasionally need to do a XPath query against a XML document and don't want to shell out the money for a professional tool to cover that need you should take a look at the &lt;a href="http://www.bit-101.com/xpath/"&gt;BIT-101 XPath Query Tool&lt;/a&gt;.
&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/categories/xml/">XML</category>
      <category domain="http://lekkimworld.com/tags/xml/">xml</category>
      <category domain="http://lekkimworld.com/tags/xpath/">xpath</category>
      <pubDate>Sat, 16 Jun 2007 14:20:01 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2007-06-16:default/1182003601161</guid>
      <dc:date>2007-06-16T14:20:01Z</dc:date>
    </item>
    <item>
      <title>Ahhh - there is of cause the Microsoft (proprietary) solution</title>
      <link>http://lekkimworld.com/2006/08/04/ahhh_there_is_of_cause_the_microsoft_proprietary_solution.html</link>
      <content:encoded>&lt;p&gt;
As &lt;a href="http://lekkimworld.com/2006/08/03/how_i_hate_reinventing_the_wheel.html"&gt;mentioned 
yeasterday&lt;/a&gt; I have been reinventing the wheel and (re)writing XPath 2.0 functions as named XSLT templates since the MSXML 3 in Internet Explorer 6 isn't XPath 2.0 compliant. As always there is however a Microsoft proprietary solution using the urn:schemas-microsoft-com:xslt namespace. This namespace adds support for a number of utility functions as mentioned in the "&lt;a href="http://msdn2.microsoft.com/en-us/library/ms256453.aspx"&gt;Microsoft XPath Extension Functions&lt;/a&gt;"-article over at &lt;a href="http://msdn.microsoft.com"&gt;Microsoft Developer Network&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
You have to be running MSXML 4 for this namespace to work however which means that even the proprietary solution isn't workable for me since MSXML 3 is the default for Internet Explorer 6.
&lt;/p&gt;
&lt;p&gt;
While researching this subject I found that MSXML 3 (or 4) isn't the newest version. There is a MSXML 5 (only used with Office 2003) and a MSXML 6 (supplied with Visual Studio 2005). Even the newest MSXML 6 doesn't however support XPath 2.0. The supported API's in MSXML 6 is:
&lt;ul&gt;
&lt;li&gt;XML 1.0 (DOM &amp; SAX2 APIs)&lt;/li&gt;
&lt;li&gt;XML Schema (XSD) 1.0&lt;/li&gt;
&lt;li&gt;XPath 1.0&lt;/li&gt;
&lt;li&gt;XSLT 1.0&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
Come on already - please implement the standards!
&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/categories/xml/">XML</category>
      <category domain="http://lekkimworld.com/tags/ie/">ie</category>
      <category domain="http://lekkimworld.com/tags/microsoft/">microsoft</category>
      <category domain="http://lekkimworld.com/tags/msxml/">msxml</category>
      <category domain="http://lekkimworld.com/tags/proprietary/">proprietary</category>
      <category domain="http://lekkimworld.com/tags/xml/">xml</category>
      <category domain="http://lekkimworld.com/tags/xpath/">xpath</category>
      <pubDate>Fri, 04 Aug 2006 04:44:34 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2006-08-04:default/1154666674239</guid>
      <dc:date>2006-08-04T04:44:34Z</dc:date>
    </item>
    <item>
      <title>How I hate reinventing the wheel</title>
      <link>http://lekkimworld.com/2006/08/03/how_i_hate_reinventing_the_wheel.html</link>
      <content:encoded>&lt;p&gt;
I'm doing quite a lot of work at the moment defining XML document "languages" and associated XML schemas (why I'm happy for the great XML and XML Schema (XSD) support in &lt;a href="http://www.eclipse.org/callisto"&gt;Callisto&lt;/a&gt;) at the moment. In that connection I'm also doing XSLT stylesheets for end-user presentation in Internet Explorer (version 6 or higher). We have to make Internet Explorer a requirement for user-presentation since &lt;a href="http://lekkimworld.com/2006/05/29/1148906293084.html"&gt;Firefox doesn't support resolving entity references when using XSLT&lt;/a&gt; which we need for content reuse.
&lt;/p&gt;
&lt;p&gt;
Once this was settled it was all well and good until I yesterday discovered that Internet Explorer 6 (and hence MSXML 3.0) doesn't support XPath 2.0 which means that all the &lt;a href="http://www.w3schools.com/xpath/xpath_functions.asp"&gt;nifty XSLT functions defined in XPath 2.0&lt;/a&gt; such as the &lt;a href="http://www.w3schools.com/xpath/xpath_functions.asp#datetime"&gt;date/time functions&lt;/a&gt; cannot be used. Bummer!
&lt;/p&gt;
&lt;p&gt;
So here I am back at reinventing the wheel rewriting all the date/time functions as named templates using the substring XPath 1.0 substring function. Even more bummer!
&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/categories/xml/">XML</category>
      <category domain="http://lekkimworld.com/tags/xml/">xml</category>
      <category domain="http://lekkimworld.com/tags/xpath/">xpath</category>
      <pubDate>Thu, 03 Aug 2006 07:26:06 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2006-08-03:default/1154589966793</guid>
      <dc:date>2006-08-03T07:26:06Z</dc:date>
    </item>
  </channel>
</rss>


