Here should go questions about transforming XML with XSLT and FOP.
- Posts: 51
- Joined: Wed Jul 19, 2017 6:04 pm
- Location: Austria
XSLT Transformation Scenario, Configure Parameters Box
Problem: While trying to pass a value (//mei:note) and evaluate it is as an XPath I get the following error:
Cannot evaluate the XPath expression 'mei:note' for parameter 'Xpath'. Reason: Namespace prefix 'mei' has not been declared
The namespace 'mei:' ist declared both in xml and xslt so where I should declare it additionaly?
- Posts: 6654
- Joined: Fri Jul 09, 2004 5:18 pm
From what I've looked at how we implement the "Evaluate as XPath" checkbox Oxygen tries to evaluate the XPath before the transformation but does not seem to evaluate it in the context of the XML document so it can only evaluate static XPaths (like for example '1+1') which do not depend on the XML nodes. I'll add an issue on our side to figure out how to make this work better.
As a possible workaround, uncheck the "Evaluate as XPath" checkbox and as value of the parameter use:
Or pass the value as a plain string and then evaluate it inside the XSLT stylesheet using the saxon:evaluate extension function or if you are using XSLT 3.0 the xsl:evaluate element.
<oXygen/> XML Editor