W3C home > Mailing lists > Public > public-multilingualweb-lt@w3.org > October 2012

Re: Make its:param optional?

From: Jirka Kosek <jirka@kosek.cz>
Date: Thu, 11 Oct 2012 17:08:02 +0200
Message-ID: <5076E0D2.6030403@kosek.cz>
To: Shaun McCance <shaunm@gnome.org>
CC: public-multilingualweb-lt@w3.org
On 11.10.2012 15:40, Shaun McCance wrote:

> JavaScript. I'm prototyping an in-browser solution, and there doesn't
> seem to be a cross-browser way to support XPath variables.

Yep, JavaScript has very poor XML tooling. But anyway it should be
possible to support XPath variables here.

You can either use JS XPath library (instead of native one) that
implements variable resolvers, e.g.: http://mcc.id.au/xpathjs

Alternatively you can parse XPath expression, find all variable
references, replace them with parameter value and then reconstruct back
XPath expression. It wouldn't be twoliner, but it is certainly doable.

				Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------


Received on Thursday, 11 October 2012 15:08:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:31:55 UTC