Categories
Technology

The XInclude namespace foolishness

I was going through XInclude for my project.

The project required me to use Xerces SAX parser.

My input XML document used 2003 in the XInclude namespace (http://www.w3.org/2003/XInclude). The XInclude processor in Xerces does not support 2003 namespace but only 2001 (http://www.w3.org/2001/XInclude) apparently because this namespace is no longer recognized (this document says so). So the processor was not working as I felt it would. I tried hard the whole day trying to find a solution and did a lot of silly things (You would expect anyone to do silly things in case they don't get a solution for a long time when they expect the solution to be simple). Finally I tumbled across this FAQ and lo, it said all!!!

Here's what the recommendation says:

Please note that the namespace URI has been reverted back to the URI found in earlier drafts of XInclude. This document defines the namespace URI http://www.w3.org/2001/XInclude; the http://www.w3.org/2003/XInclude namespace URI found in the Last Call is made obsolete by this document.

Too late to realize? 🙁

Categories
World Wide Web

1,286 search plugins for Firefox!!!

Are you looking for some search plug-ins for Firefox (the one that goes into the little text box to the top-right)?

Then your search should end here.

You can easily find the search plug-in of your choice here.

Categories
World Wide Web

New to tagging?

Are you a newbie to the concept of tagging?

If you are still in doubts about why tagging can be of help, you need to check this article.

Categories
General

Random thought

An advice:

Read your daily horoscopes at the end of the day, to know how your day went by.

Categories
My Updates

What a week!

What a week it has been!

It has been only a week since I joined ISL and my name has been put up everywhere!

Know why?

I participated in a skit (!!!) and my name was printed in all the posters put up to invite people.

“Me in a skit?”, you may ask, but it's true.

I don't know how I did, but I am sure it wasn't bad.

This skit was part of ISL Innovation Day. And for my efforts, I also got a cool memento. Thanks IBM, ISL and Deepu (director of the skit).

Categories
World Wide Web

The default namespace problem in XSLT 1.0

(This blog is only for my reference. Non-XSLT users please dis-regard
this blog entry. XSLT users please suggest some alternatives/comments.)

There is a problem popularly called the default namespace problem in
XSLT 1.0. Supposedly this problem has been solved in the newer version
of XSLT (XSLT 2.0).

The problem is not discussed here, rather the solution is given below:

Consider an input XML file bound to a default namespace:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="new.xsl"?>
<catalog xmlns="http://buzypi.50webs.com/">
 <entry>1</entry>
 <entry>2</entry>
 <entry>3</entry>
</catalog>


Consider the XSLT style-sheet:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my="http://buzypi.50webs.com/"
>

<xsl:template match="/">
 <html>
 <body>
  <xsl:apply-templates select="my:catalog/my:entry" />
 </body>
 </html>
</xsl:template>

<xsl:template match="my:entry">
 <h1><xsl:value-of select="." /></h1>
</xsl:template>

</xsl:stylesheet>

The problem is thus solved by defining our own namespace and using it to refer to all default namespace elements.

There is another solution using local-name() function of XPath (Please refer to biglist link below for that solution).

XSLT 2.0 has something called default-xpath-namespace, which is used to solve the problem.

This thread on biglist deals with the default namespace problem.

Categories
General

Random thought

It's a matter of time before something happens 🙂

Categories
General

Random thought

… and thus ultimately it's all mathematics.

Categories
World Wide Web

My tags

So you are not interested in my blogs on tech? But I just can't stop blogging about tech.

So here's the solution:

1. For general blog entries visit: General (Tag name – general). (Sorry, if some tech jargons creep in.)

2. For technical entries: Tech (Tag name – tech).

Sub-categories in tech:

Khoj (Tag name – khoj) – These are cool things that I find on the net.
Problem (Tag name – problem) – These are some problems that I face/ problems that I think are not yet solved.
Thoughts (Tag name – thoughts) – These are certain things that might need some thought and analysis.
Semantic Web (Tag name – sw) – You know what 🙂

Other tags:

College (Tag name – college) – About my college days and new things HAPPENING in college.
IBM (Tag name – ibm) – About my association with IBM.
LJ (Tag name – livejournal) – About new things that come up in LJ and anything concerned with LJ (like this blog entry).
Jobless (Tag name – jobless) – Those “Find your friends”, “Find when you die” etc utilities that work over LJ.

And in case your RSS reader supports filtering, you could use the tags
specified to filter my entries (All my tags are in lowercase).

And since I like XSLT here's the XSLT snippet to filter out my 'tech' blog entries and display the titles:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <xsl:for-each
select="document('http://www.livejournal.com/users/gauthampai/data/rss')/rss/channel/item">
     <xsl:for-each select="category">
       <xsl:variable name="temp" select="." />
       <xsl:if test="$temp = 'tech' " >
        <xsl:value-of select="../title" /><br />
       </xsl:if>
     </xsl:for-each>
    </xsl:for-each>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

Categories
World Wide Web

Semantic Web is not AI?

An article in W3 says that Semantic Web is not AI.

But an article on Knowledge representation in Wikipedia says, this:

# RDF is a simple notation for representing relationships between and among objects

Examples of artificial languages intended for knowledge representation include:

# CycL
# …
# OWL
# …

Both SW related technologies figure in an article related to AI!

The confusion seems to be in the interpretation of what is meant by AI. This word could be interpreted at 2 different levels. I could either call robots with their own intelligence as AI, or just the representation of information and infering from it as AI.

But this thought definitely needs some grinding and digesting.