0

Illegal attribute 'xpath-default-namespace'. when we run the xsl code we get the error like xpath-default-namespace with version 2.0.

can anyone tell me what is the issue and how I can resolve the issue?

shashi sharma
  • 23
  • 1
  • 4
  • I would guess the issue is that you're trying to run an XSLT 2.0 stylesheet on an XSLT 1.0 processor. – michael.hor257k Oct 14 '21 at 06:48
  • As per my knowledge I think this xpath-namespace also work with version 1.0, I don't know I m right or wrong because I am very new with XSL. And if there is an issue as per you said how we resolve the version issue. – shashi sharma Oct 14 '21 at 06:57
  • No, `xpath-default-namespace` requires support for XSLT 2.0. As for resolving, you can either switch to an XSLT 2.0 processor or rewrite your stylesheet for XSLT 1.0 - see: https://stackoverflow.com/a/34762628/3016153 – michael.hor257k Oct 14 '21 at 07:01
  • sure Michael!! Thank you – shashi sharma Oct 14 '21 at 15:41

1 Answers1

0

The issue is that you are using an XSLT processor that does not support XSLT 2.0.

Also it seems it doesn't recognise XSLT 1.0 "forwards compatibility mode". If it did, then it would simply ignore this attribute, rather than reporting it as an error.

You have two ways forward: either stick to XSLT 1.0 constructs, or find yourself an XSLT 2.0 (or 3.0) processor that works in your chosen environment.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164