W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > June 2007

Re: ACTION-512 - Research getting line and column information from XPath

From: Roland Gülle <roland@7val.com>
Date: Tue, 19 Jun 2007 08:19:53 +0200
Message-Id: <E62BE23F-2B80-46B4-8282-44C58B0AA058@7val.com>
Cc: public-mobileok-checker@w3.org
To: Sean Owen <srowen@google.com>

> 1) Does this work in Java, not just XSLT? remember we do have some
> Java code here too. :)
I'm _outside_ the Java code, so please stop me if its getting to big :)

> 2) Are we really sure we won't need any XSLT 2.0? seems like we're
> doing so much in XSLT that we'd want all the features we can get. Like
> the ones we were already using!
I can downgrade the current implementations (outside Java, inside XSLT).

> 3) Saxon also already supports line numbers in a very similar way.
<xsl:value-of select="saxon:line-number(.)" xmlns:saxon="http:// 
with using  -l at the command-line works!

But most of the mobile pages try to avoid spaces and CR/LF - so the  
source document has only one line.

> I'm pretty sure we can get line/col info into the DOM itself using
> Xerces. Well, we're trying that now. Accessing it is just a matter of
> downcasting nodes and accessing Xerces-specific methods, which
> *should* work in XSLT too. Again, to be tried.

After thinking a bit more at returning line and column direct from XSLT,
I think we need more than only the Saxon line-number() or Xerces  

The document we transform with the XSLT is the moki document,
so we will get the position in the moki document.
We can return the URI (or internal ID) and (original) XPath and solve  
this in a separate process,
or call an own function with the URI and XPath that get the line and  
column information from the original document.

So... only XSLT (1.0 or 2.0) will not solve this problem, there is  
Java code needed (and you know - I'm not the Java guy).
Maybe with a small XSLT (and a Xerces process?),
where the XSLT gets the XPath dynamic from the function and the  
source document represented by the URI.

Received on Tuesday, 19 June 2007 06:20:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:18 UTC