XSLT Transformation Scenario - Configure Parameters - "Evaluate XPath' - namespace problem
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 84
- Joined: Wed Jul 19, 2017 6:04 pm
- Location: Austria
- Contact:
XSLT Transformation Scenario - Configure Parameters - "Evaluate XPath' - namespace problem
Context:
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:
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:
The namespace 'mei:' ist declared both in xml and xslt so where I should declare it additionaly?Cannot evaluate the XPath expression 'mei:note' for parameter 'Xpath'. Reason: Namespace prefix 'mei' has not been declared
Kind regards,
Oleksii Sapov-Erlinger
Oleksii Sapov-Erlinger
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XSLT Transformation Scenario - Configure Parameters - "Evaluate XPath' - namespace problem
Hi Alex,
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.
Regards,
Radu
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:
Code: Select all
${xpath_eval(//mei:note)}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service