[annotator-dev] annotator-dev Digest, Vol 58, Issue 3

Khan A. A.Khan at soton.ac.uk
Wed Feb 17 12:01:54 UTC 2016


Hello all,

Does anybody have any idea why the annotation server down (http://annotateit.org/user/xyz leads to internal server error)?
Many thanks
Arshad 

-----Original Message-----
From: annotator-dev [mailto:annotator-dev-bounces at lists.okfn.org] On Behalf Of annotator-dev-request at lists.okfn.org
Sent: 17 February 2016 12:00
To: annotator-dev at lists.okfn.org
Subject: annotator-dev Digest, Vol 58, Issue 3

Send annotator-dev mailing list submissions to
	annotator-dev at lists.okfn.org

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.okfn.org/mailman/listinfo/annotator-dev
or, via email, send a message with subject or body 'help' to
	annotator-dev-request at lists.okfn.org

You can reach the person managing the list at
	annotator-dev-owner at lists.okfn.org

When replying, please edit your Subject line so it is more specific than "Re: Contents of annotator-dev digest..."


Today's Topics:

   1. annotator / xpath-range bug (Hari G)


----------------------------------------------------------------------

Message: 1
Date: Tue, 16 Feb 2016 10:29:29 -0800
From: Hari G <hari_g at hotmail.com>
To: "annotator-dev at lists.okfn.org" <annotator-dev at lists.okfn.org>
Subject: [annotator-dev] annotator / xpath-range bug
Message-ID: <BLU179-W8108D37FE35D8D555F3ECCE5AD0 at phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"




Hello All:
Looks like this a dead mailing list... anyway I will ask...
#1 I looked everywhere for the xpath-range code. The github repo https://github.com/openannotation/xpath-range and npm package has different code. The real location of the xpath-range source would be helpful.
#2 The toNode method has a bug. # Public: Finds an Element Node using an XPath relative to the document root.## If the document is served as application/xhtml+xml it will try and resolve# any namespaces within the XPath.## path - An XPath String to query.## Examples##   node = toNode('/html/body/div/p[2]')#   if node#     # Do something with the node.## Returns the Node if found otherwise null.toNode = (path, root = document) ->
It will not find the node if the attribute selector has / or : in it. Example:
toNode("//p[@resource='http://purl.org/pearson/asset/adb19cb3a588ab58cbc0db272048aed6d60a29db5']") and toNode("//p[@resource='asset:adb4afbb2c91461765201bd8eb32f54aad1bb3800']") will not work. However toNode("//p[@resource='adb4afbb2c91461765201bd8eb32f54aad1bb3800']") works.

The problem is with the following code (line 161 in xpath.coffee):      path = (for segment in path.split '/'        if segment and segment.indexOf(':') == -1          segment.replace(/^([a-z]+)/, 'xhtml:$1')        else segment      ).join('/')
This will convert the //p[@resource='http://purl.org/pearson/asset/adb19cb3a588ab58cbc0db272048aed6d60a29db5'] into //xhtml:p[@resource='http://xhtml:purl.org/xhtml:pearson/xhtml:asset/xhtml:adb19cb3a588ab58cbc0db272048aed6d60a29db5'] instead of converting to //xhtml:p[@resource='http://purl.org/pearson/asset/adb19cb3a588ab58cbc0db272048aed6d60a29db5']
I have never worked on coffee script and it took me a while to find the coffee script... by that time I made a code change to the generated code to fix the issue I am facing... Here is the screenshot of diff (which may not be useful):http://content.screencast.com/users/harinair/folders/Jing/media/fac08329-05bf-4b51-8bba-cea25913dc15/00000064.png
I can add this as a bug in github but I am not sure which github repo to add this bug to. I can also help in coding/testing if someone can give me some pointers.
Hari Gangadharan

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20160216/442627d5/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
annotator-dev mailing list
annotator-dev at lists.okfn.org
https://lists.okfn.org/mailman/listinfo/annotator-dev
Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev


------------------------------

End of annotator-dev Digest, Vol 58, Issue 3
********************************************



More information about the annotator-dev mailing list