Re: Make its:param optional?

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