xslt-processor icon indicating copy to clipboard operation
xslt-processor copied to clipboard

local-name()

Open JonathanRowell opened this issue 6 years ago • 3 comments

One could do with local-name(), useful when dynamically creating elements and it should be simple to implement as it follows on from 'name'. `` 'local-name' (ctx) { assert(this.args.length == 1 || this.args.length == 0); let n; if (this.args.length == 0) { n = [ctx.node]; } else { n = this.args[0].evaluate(ctx).nodeSetValue(); }

    if (n.length == 0) {
        return new StringValue('');
    } else {
        let name = n[0].nodeName;
        if(name.contains':') {
        	return new StringValue(name.slice(name.indexOf(':')+1));
        } else {
        	return new StringValue(name);
        }
    }
},

`

JonathanRowell avatar Nov 18 '19 14:11 JonathanRowell

Sorry I got the code insert wrong!

JonathanRowell avatar Nov 18 '19 14:11 JonathanRowell

Ah, missed this, I just implemented this in #36.

But in general this package doesn't handle namespaces.

berenddeboer avatar Jan 03 '20 06:01 berenddeboer

Hey there, is there any chance this feature is going to be released soon?

josiahwitheford avatar Aug 16 '22 00:08 josiahwitheford

Hi @josiahwitheford. This was released on https://github.com/DesignLiquido/xslt-processor/releases/tag/v1.0.0. Please let me know if any adjustments are required.

leonelsanchesdasilva avatar Jun 28 '23 22:06 leonelsanchesdasilva

For now I'm closing this, but should return in the future if any problems arise from this implementation.

leonelsanchesdasilva avatar Jul 15 '23 15:07 leonelsanchesdasilva