@jinntec/fore 1.9.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fore-dev.js +2 -2
- package/dist/fore-dev.js.map +1 -1
- package/dist/fore.js +2 -2
- package/dist/fore.js.map +1 -1
- package/package.json +1 -1
- package/resources/fore.css +6 -41
- package/src/DependencyNotifyingDomFacade.js +2 -2
- package/src/actions/abstract-action.js +43 -41
- package/src/actions/fx-call.js +9 -0
- package/src/actions/fx-delete.js +1 -1
- package/src/actions/fx-insert.js +15 -4
- package/src/actions/fx-load.js +5 -2
- package/src/actions/fx-reload.js +1 -1
- package/src/actions/fx-send.js +8 -3
- package/src/actions/fx-setfocus.js +7 -2
- package/src/fore.js +241 -1
- package/src/fx-bind.js +12 -6
- package/src/fx-fore.js +99 -36
- package/src/fx-model.js +22 -7
- package/src/fx-submission.js +13 -14
- package/src/tools/adi.js +16 -7
- package/src/tools/fx-action-log.js +1 -1
- package/src/ui/abstract-control.js +26 -46
- package/src/ui/fx-control.js +13 -13
- package/src/ui/fx-dialog.js +2 -0
- package/src/ui/fx-group.js +4 -1
- package/src/ui/fx-repeat-attributes.js +4 -1
- package/src/ui/fx-repeat.js +21 -1
- package/src/ui/fx-repeatitem.js +5 -9
- package/src/ui/fx-trigger.js +6 -14
- package/src/xpath-evaluation.js +324 -73
- package/src/xpath-util.js +137 -132
package/src/xpath-evaluation.js
CHANGED
|
@@ -341,7 +341,18 @@ function functionNameResolver({prefix, localName}, _arity) {
|
|
|
341
341
|
case 'instance':
|
|
342
342
|
case 'log':
|
|
343
343
|
case 'parse':
|
|
344
|
+
case 'local-date':
|
|
345
|
+
case 'local-dateTime':
|
|
344
346
|
case 'logtree':
|
|
347
|
+
case 'uri':
|
|
348
|
+
case 'uri-fragment':
|
|
349
|
+
case 'uri-host':
|
|
350
|
+
case 'uri-param':
|
|
351
|
+
case 'uri-path':
|
|
352
|
+
case 'uri-port':
|
|
353
|
+
case 'uri-query':
|
|
354
|
+
case 'uri-scheme':
|
|
355
|
+
case 'uri-scheme-specific-part':
|
|
345
356
|
return {namespaceURI: XFORMS_NAMESPACE_URI, localName};
|
|
346
357
|
default:
|
|
347
358
|
if (prefix === '' && globallyDeclaredFunctionLocalNames.includes(localName)) {
|
|
@@ -407,14 +418,15 @@ function getVariablesInScope(formElement) {
|
|
|
407
418
|
* @param {Node} contextNode The start of the XPath
|
|
408
419
|
* @param {{parentNode}|ForeElementMixin} formElement The form element associated to the XPath
|
|
409
420
|
*/
|
|
410
|
-
|
|
421
|
+
/*
|
|
422
|
+
export function evaluateXPath(xpath, contextNode, formElement, variables = {}, options={}, domFacade = null) {
|
|
411
423
|
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
412
424
|
const variablesInScope = getVariablesInScope(formElement);
|
|
413
425
|
|
|
414
426
|
return fxEvaluateXPath(
|
|
415
427
|
xpath,
|
|
416
428
|
contextNode,
|
|
417
|
-
|
|
429
|
+
domFacade,
|
|
418
430
|
{...variablesInScope, ...variables},
|
|
419
431
|
fxEvaluateXPath.ALL_RESULTS_TYPE,
|
|
420
432
|
{
|
|
@@ -429,7 +441,59 @@ export function evaluateXPath(xpath, contextNode, formElement, variables = {}, o
|
|
|
429
441
|
},
|
|
430
442
|
);
|
|
431
443
|
}
|
|
444
|
+
*/
|
|
445
|
+
export function evaluateXPath(xpath, contextNode, formElement, variables = {}, options={}) {
|
|
446
|
+
try{
|
|
447
|
+
console.log('evaluateXPath',xpath);
|
|
448
|
+
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
449
|
+
const variablesInScope = getVariablesInScope(formElement);
|
|
450
|
+
|
|
451
|
+
return fxEvaluateXPath(
|
|
452
|
+
xpath,
|
|
453
|
+
contextNode,
|
|
454
|
+
null,
|
|
455
|
+
{...variablesInScope, ...variables},
|
|
456
|
+
fxEvaluateXPath.ALL_RESULTS_TYPE,
|
|
457
|
+
{
|
|
458
|
+
debug: true,
|
|
459
|
+
currentContext: {formElement, variables},
|
|
460
|
+
moduleImports: {
|
|
461
|
+
xf: XFORMS_NAMESPACE_URI,
|
|
462
|
+
},
|
|
463
|
+
functionNameResolver,
|
|
464
|
+
namespaceResolver,
|
|
465
|
+
language: options.language || evaluateXPath.XPATH_3_1
|
|
466
|
+
},
|
|
467
|
+
);
|
|
468
|
+
}catch (e){
|
|
469
|
+
formElement.dispatchEvent(new CustomEvent('error', {
|
|
470
|
+
composed: false,
|
|
471
|
+
bubbles: true,
|
|
472
|
+
detail: {
|
|
473
|
+
origin: formElement,
|
|
474
|
+
message: `Expression '${xpath}' failed`,
|
|
475
|
+
expr:xpath,
|
|
476
|
+
level:'Error'
|
|
477
|
+
},
|
|
478
|
+
}));
|
|
432
479
|
|
|
480
|
+
/*
|
|
481
|
+
formElement.dispatchEvent(
|
|
482
|
+
new CustomEvent('error', {
|
|
483
|
+
composed: false,
|
|
484
|
+
bubbles: true,
|
|
485
|
+
cancelable:true,
|
|
486
|
+
detail: {
|
|
487
|
+
origin: formElement,
|
|
488
|
+
message: `Expression '${xpath}' failed`,
|
|
489
|
+
expr:xpath,
|
|
490
|
+
level:'Error'},
|
|
491
|
+
}),
|
|
492
|
+
);
|
|
493
|
+
*/
|
|
494
|
+
return false;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
433
497
|
/**
|
|
434
498
|
* Evaluate an XPath to the first Node
|
|
435
499
|
*
|
|
@@ -439,17 +503,30 @@ export function evaluateXPath(xpath, contextNode, formElement, variables = {}, o
|
|
|
439
503
|
* @return {Node} The first node found by the XPath
|
|
440
504
|
*/
|
|
441
505
|
export function evaluateXPathToFirstNode(xpath, contextNode, formElement) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
506
|
+
try{
|
|
507
|
+
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
508
|
+
const variablesInScope = getVariablesInScope(formElement);
|
|
509
|
+
return fxEvaluateXPathToFirstNode(xpath, contextNode, null, variablesInScope, {
|
|
510
|
+
defaultFunctionNamespaceURI: XFORMS_NAMESPACE_URI,
|
|
511
|
+
moduleImports: {
|
|
512
|
+
xf: XFORMS_NAMESPACE_URI,
|
|
513
|
+
},
|
|
514
|
+
currentContext: {formElement},
|
|
515
|
+
functionNameResolver,
|
|
516
|
+
namespaceResolver,
|
|
517
|
+
});
|
|
518
|
+
} catch (e){
|
|
519
|
+
formElement.dispatchEvent(new CustomEvent('error', {
|
|
520
|
+
composed: false,
|
|
521
|
+
bubbles: true,
|
|
522
|
+
detail: {
|
|
523
|
+
origin: formElement,
|
|
524
|
+
message: `Expression '${xpath}' failed`,
|
|
525
|
+
expr:xpath,
|
|
526
|
+
level:'Error'
|
|
527
|
+
},
|
|
528
|
+
}));
|
|
529
|
+
}
|
|
453
530
|
}
|
|
454
531
|
|
|
455
532
|
/**
|
|
@@ -461,17 +538,30 @@ export function evaluateXPathToFirstNode(xpath, contextNode, formElement) {
|
|
|
461
538
|
* @return {Node[]} All nodes
|
|
462
539
|
*/
|
|
463
540
|
export function evaluateXPathToNodes(xpath, contextNode, formElement) {
|
|
464
|
-
|
|
465
|
-
|
|
541
|
+
try{
|
|
542
|
+
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
543
|
+
const variablesInScope = getVariablesInScope(formElement);
|
|
466
544
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
545
|
+
return fxEvaluateXPathToNodes(xpath, contextNode, null, variablesInScope, {
|
|
546
|
+
currentContext: {formElement},
|
|
547
|
+
functionNameResolver,
|
|
548
|
+
moduleImports: {
|
|
549
|
+
xf: XFORMS_NAMESPACE_URI,
|
|
550
|
+
},
|
|
551
|
+
namespaceResolver,
|
|
552
|
+
});
|
|
553
|
+
}catch (e){
|
|
554
|
+
formElement.dispatchEvent(new CustomEvent('error', {
|
|
555
|
+
composed: false,
|
|
556
|
+
bubbles: true,
|
|
557
|
+
detail: {
|
|
558
|
+
origin: formElement,
|
|
559
|
+
message: `Expression '${xpath}' failed`,
|
|
560
|
+
expr:xpath,
|
|
561
|
+
level:'Error'
|
|
562
|
+
},
|
|
563
|
+
}));
|
|
564
|
+
}
|
|
475
565
|
}
|
|
476
566
|
|
|
477
567
|
/**
|
|
@@ -483,17 +573,30 @@ export function evaluateXPathToNodes(xpath, contextNode, formElement) {
|
|
|
483
573
|
* @return {boolean}
|
|
484
574
|
*/
|
|
485
575
|
export function evaluateXPathToBoolean(xpath, contextNode, formElement) {
|
|
486
|
-
|
|
487
|
-
|
|
576
|
+
try{
|
|
577
|
+
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
578
|
+
const variablesInScope = getVariablesInScope(formElement);
|
|
488
579
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
580
|
+
return fxEvaluateXPathToBoolean(xpath, contextNode, null, variablesInScope, {
|
|
581
|
+
currentContext: {formElement},
|
|
582
|
+
functionNameResolver,
|
|
583
|
+
moduleImports: {
|
|
584
|
+
xf: XFORMS_NAMESPACE_URI,
|
|
585
|
+
},
|
|
586
|
+
namespaceResolver,
|
|
587
|
+
});
|
|
588
|
+
}catch (e){
|
|
589
|
+
formElement.dispatchEvent(new CustomEvent('error', {
|
|
590
|
+
composed: false,
|
|
591
|
+
bubbles: true,
|
|
592
|
+
detail: {
|
|
593
|
+
origin: formElement,
|
|
594
|
+
message: `Expression '${xpath}' failed`,
|
|
595
|
+
expr:xpath,
|
|
596
|
+
level:'Error'
|
|
597
|
+
},
|
|
598
|
+
}));
|
|
599
|
+
}
|
|
497
600
|
}
|
|
498
601
|
|
|
499
602
|
/**
|
|
@@ -514,17 +617,30 @@ export function evaluateXPathToString(
|
|
|
514
617
|
domFacade = null,
|
|
515
618
|
namespaceReferenceNode = formElement,
|
|
516
619
|
) {
|
|
517
|
-
|
|
518
|
-
|
|
620
|
+
try{
|
|
621
|
+
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
622
|
+
const variablesInScope = getVariablesInScope(formElement);
|
|
519
623
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
624
|
+
return fxEvaluateXPathToString(xpath, contextNode, domFacade, variablesInScope, {
|
|
625
|
+
currentContext: {formElement},
|
|
626
|
+
functionNameResolver,
|
|
627
|
+
moduleImports: {
|
|
628
|
+
xf: XFORMS_NAMESPACE_URI,
|
|
629
|
+
},
|
|
630
|
+
namespaceResolver,
|
|
631
|
+
});
|
|
632
|
+
}catch (e) {
|
|
633
|
+
formElement.dispatchEvent(new CustomEvent('error', {
|
|
634
|
+
composed: false,
|
|
635
|
+
bubbles: true,
|
|
636
|
+
detail: {
|
|
637
|
+
origin: formElement,
|
|
638
|
+
message: `Expression '${xpath}' failed`,
|
|
639
|
+
expr:xpath,
|
|
640
|
+
level:'Error'
|
|
641
|
+
},
|
|
642
|
+
}));
|
|
643
|
+
}
|
|
528
644
|
}
|
|
529
645
|
|
|
530
646
|
/**
|
|
@@ -545,22 +661,31 @@ export function evaluateXPathToStrings(
|
|
|
545
661
|
domFacade = null,
|
|
546
662
|
namespaceReferenceNode = formElement,
|
|
547
663
|
) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
xpath,
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
xf: XFORMS_NAMESPACE_URI,
|
|
664
|
+
try{
|
|
665
|
+
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
666
|
+
return fxEvaluateXPathToStrings( xpath, contextNode, domFacade,
|
|
667
|
+
{},
|
|
668
|
+
{
|
|
669
|
+
currentContext: {formElement},
|
|
670
|
+
functionNameResolver,
|
|
671
|
+
moduleImports: {
|
|
672
|
+
xf: XFORMS_NAMESPACE_URI,
|
|
673
|
+
},
|
|
674
|
+
namespaceResolver,
|
|
560
675
|
},
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
676
|
+
);
|
|
677
|
+
} catch (e){
|
|
678
|
+
formElement.dispatchEvent(new CustomEvent('error', {
|
|
679
|
+
composed: false,
|
|
680
|
+
bubbles: true,
|
|
681
|
+
detail: {
|
|
682
|
+
origin: formElement,
|
|
683
|
+
message: `Expression '${xpath}' failed`,
|
|
684
|
+
expr:xpath,
|
|
685
|
+
level:'Error'
|
|
686
|
+
},
|
|
687
|
+
}));
|
|
688
|
+
}
|
|
564
689
|
}
|
|
565
690
|
|
|
566
691
|
/**
|
|
@@ -581,17 +706,30 @@ export function evaluateXPathToNumber(
|
|
|
581
706
|
domFacade = null,
|
|
582
707
|
namespaceReferenceNode = formElement,
|
|
583
708
|
) {
|
|
584
|
-
|
|
585
|
-
|
|
709
|
+
try{
|
|
710
|
+
const namespaceResolver = createNamespaceResolverForNode(xpath, contextNode, formElement);
|
|
711
|
+
const variablesInScope = getVariablesInScope(formElement);
|
|
586
712
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
713
|
+
return fxEvaluateXPathToNumber(xpath, contextNode, domFacade, variablesInScope, {
|
|
714
|
+
currentContext: {formElement},
|
|
715
|
+
functionNameResolver,
|
|
716
|
+
moduleImports: {
|
|
717
|
+
xf: XFORMS_NAMESPACE_URI,
|
|
718
|
+
},
|
|
719
|
+
namespaceResolver,
|
|
720
|
+
});
|
|
721
|
+
}catch (e) {
|
|
722
|
+
formElement.dispatchEvent(new CustomEvent('error', {
|
|
723
|
+
composed: false,
|
|
724
|
+
bubbles: true,
|
|
725
|
+
detail: {
|
|
726
|
+
origin: formElement,
|
|
727
|
+
message: `Expression '${xpath}' failed`,
|
|
728
|
+
expr:xpath,
|
|
729
|
+
level:'Error'
|
|
730
|
+
},
|
|
731
|
+
}));
|
|
732
|
+
}
|
|
595
733
|
}
|
|
596
734
|
|
|
597
735
|
const contextFunction = (dynamicContext, string) => {
|
|
@@ -833,18 +971,44 @@ const instance = (dynamicContext, string) => {
|
|
|
833
971
|
{namespaceResolver: xhtmlNamespaceResolver},
|
|
834
972
|
);
|
|
835
973
|
|
|
974
|
+
let lookup = null;
|
|
975
|
+
if(string === null || string === 'default'){
|
|
976
|
+
lookup = formElement.getModel().getDefaultInstance();
|
|
977
|
+
}else{
|
|
978
|
+
lookup = formElement.getModel().getInstance(string);
|
|
979
|
+
if(!lookup){
|
|
980
|
+
document.querySelector('fx-fore').dispatchEvent(new CustomEvent('error', {
|
|
981
|
+
composed: true,
|
|
982
|
+
bubbles: true,
|
|
983
|
+
detail: {
|
|
984
|
+
origin: 'functions',
|
|
985
|
+
message: `Function not found '${localName}'`,
|
|
986
|
+
level:'Error'
|
|
987
|
+
},
|
|
988
|
+
}));
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
const context = lookup.getDefaultContext();
|
|
993
|
+
if (!context) {
|
|
994
|
+
debugger;
|
|
995
|
+
return null;
|
|
996
|
+
}
|
|
997
|
+
return context;
|
|
998
|
+
|
|
999
|
+
/*
|
|
836
1000
|
const inst = string
|
|
837
|
-
|
|
838
|
-
|
|
1001
|
+
? formElement.getModel().getInstance(string)
|
|
1002
|
+
: formElement.getModel().getDefaultInstance();
|
|
1003
|
+
*/
|
|
839
1004
|
|
|
840
1005
|
/*
|
|
841
1006
|
const inst = string
|
|
842
1007
|
? resolveId(string, formElement, 'fx-instance')
|
|
843
1008
|
: formElement.querySelector(`fx-instance`);
|
|
844
|
-
*/
|
|
845
1009
|
|
|
846
|
-
if (
|
|
847
|
-
const context =
|
|
1010
|
+
if (lookup) {
|
|
1011
|
+
const context = lookup.getDefaultContext();
|
|
848
1012
|
if (!context) {
|
|
849
1013
|
debugger;
|
|
850
1014
|
return null;
|
|
@@ -852,6 +1016,7 @@ const instance = (dynamicContext, string) => {
|
|
|
852
1016
|
return context;
|
|
853
1017
|
}
|
|
854
1018
|
return null;
|
|
1019
|
+
*/
|
|
855
1020
|
};
|
|
856
1021
|
|
|
857
1022
|
registerCustomXPathFunction(
|
|
@@ -980,3 +1145,89 @@ registerCustomXPathFunction(
|
|
|
980
1145
|
'xs:string?',
|
|
981
1146
|
(dynamicContext, string) => btoa(string),
|
|
982
1147
|
);
|
|
1148
|
+
|
|
1149
|
+
registerCustomXPathFunction(
|
|
1150
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'local-date'},
|
|
1151
|
+
[],
|
|
1152
|
+
'xs:string?',
|
|
1153
|
+
(dynamicContext, string) => new Date().toLocaleDateString(),
|
|
1154
|
+
);
|
|
1155
|
+
registerCustomXPathFunction(
|
|
1156
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'local-dateTime'},
|
|
1157
|
+
[],
|
|
1158
|
+
'xs:string?',
|
|
1159
|
+
(dynamicContext, string) => {
|
|
1160
|
+
return new Date().toLocaleString();
|
|
1161
|
+
},
|
|
1162
|
+
);
|
|
1163
|
+
registerCustomXPathFunction(
|
|
1164
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri'},
|
|
1165
|
+
[],
|
|
1166
|
+
'xs:string?',
|
|
1167
|
+
(dynamicContext, string) => window.location.href,
|
|
1168
|
+
);
|
|
1169
|
+
registerCustomXPathFunction(
|
|
1170
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-fragment'},
|
|
1171
|
+
[],
|
|
1172
|
+
'xs:string?',
|
|
1173
|
+
(dynamicContext, arg) => window.location.hash,
|
|
1174
|
+
);
|
|
1175
|
+
registerCustomXPathFunction(
|
|
1176
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-host'},
|
|
1177
|
+
[],
|
|
1178
|
+
'xs:string?',
|
|
1179
|
+
(dynamicContext, arg) => window.location.host,
|
|
1180
|
+
);
|
|
1181
|
+
registerCustomXPathFunction(
|
|
1182
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-query'},
|
|
1183
|
+
[],
|
|
1184
|
+
'xs:string?',
|
|
1185
|
+
(dynamicContext, arg) => window.location.search,
|
|
1186
|
+
);
|
|
1187
|
+
registerCustomXPathFunction(
|
|
1188
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-path'},
|
|
1189
|
+
[],
|
|
1190
|
+
'xs:string?',
|
|
1191
|
+
(dynamicContext, arg) => {
|
|
1192
|
+
return new URL(window.location.href).pathname;
|
|
1193
|
+
},
|
|
1194
|
+
);
|
|
1195
|
+
registerCustomXPathFunction(
|
|
1196
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-port'},
|
|
1197
|
+
[],
|
|
1198
|
+
'xs:string?',
|
|
1199
|
+
(dynamicContext, arg) => {
|
|
1200
|
+
return window.location.port;
|
|
1201
|
+
},
|
|
1202
|
+
);
|
|
1203
|
+
registerCustomXPathFunction(
|
|
1204
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-param'},
|
|
1205
|
+
['xs:string?'],
|
|
1206
|
+
'xs:string?',
|
|
1207
|
+
(dynamicContext, arg) => {
|
|
1208
|
+
if (!arg) return null;
|
|
1209
|
+
|
|
1210
|
+
const search = window.location.search;
|
|
1211
|
+
const urlparams = new URLSearchParams(search);
|
|
1212
|
+
const param = urlparams.get(arg);
|
|
1213
|
+
return param ? param : '';
|
|
1214
|
+
|
|
1215
|
+
},
|
|
1216
|
+
);
|
|
1217
|
+
registerCustomXPathFunction(
|
|
1218
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-scheme'},
|
|
1219
|
+
[],
|
|
1220
|
+
'xs:string?',
|
|
1221
|
+
(dynamicContext, arg) => {
|
|
1222
|
+
return new URL(window.location.href).protocol;
|
|
1223
|
+
},
|
|
1224
|
+
);
|
|
1225
|
+
registerCustomXPathFunction(
|
|
1226
|
+
{namespaceURI: XFORMS_NAMESPACE_URI, localName: 'uri-scheme-specific-part'},
|
|
1227
|
+
[],
|
|
1228
|
+
'xs:string?',
|
|
1229
|
+
(dynamicContext, arg) => {
|
|
1230
|
+
const uri = window.location.href;
|
|
1231
|
+
return uri.substring(uri.indexOf(':') + 1, uri.length);
|
|
1232
|
+
},
|
|
1233
|
+
);
|