PHP function in XSLT transformation
Having trouble installing Oxygen? Got a bug to report? Post it all here.
PHP function in XSLT transformation
Hello
I use PHP function in my template with this syntax
This code work well on the server but when I use oXygenXm; editor a error is displayed
Thank for your help
I use PHP function in my template with this syntax
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:php="http://php.net/xsl"
xsl:extension-element-prefixes="php" exclude-result-prefixes="xhtml">
<xsl:template match="report">
<xsl:value-of select="php:functionString('my_function', 'parameter')"/>
</xsl:template>
</xsl:stylesheet>
What's wrongE [Saxon6.5.5] Attribute xsl:extension-element-prefixes is not allowed on this element
Thank for your help
Re: PHP function in XSLT transformation
Hello,
Saxon 6.5.5 does not accept xsl:extension-element-prefixes for some reason, but I see it works fine with extension-element-prefixes. Just remove the prefix and it will work.
Regards,
Adrian
Saxon 6.5.5 does not accept xsl:extension-element-prefixes for some reason, but I see it works fine with extension-element-prefixes. Just remove the prefix and it will work.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Re: PHP function in XSLT transformation
Hi,
According to the XSLT 1.0 specification:
http://www.w3.org/TR/xslt#stylesheet-element
the extension-element-prefixes must not be prefixed in any way (it needs to be from no namespace).
Regards,
Radu
According to the XSLT 1.0 specification:
http://www.w3.org/TR/xslt#stylesheet-element
the extension-element-prefixes must not be prefixed in any way (it needs to be from no namespace).
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: PHP function in XSLT transformation
Thank you for your answers
http://www.w3.org/TR/xslt#extension explain the used of the extension but both are listed and seem to work correctly
I can't change these rules by myself on my project
http://www.w3.org/TR/xslt#extension explain the used of the extension but both are listed and seem to work correctly
oXygeXMLn is more stringent and I can't use it without this change.A namespace is designated as an extension namespace by using an extension-element-prefixes attribute on an xsl:stylesheet element or an xsl:extension-element-prefixes attribute on a literal result element or extension element
I can't change these rules by myself on my project
Re: PHP function in XSLT transformation
Hi,
I agree to the specification you quote but it's meaning (I've split the quoted spec in two) is like this:
So you must use the "xsl:extension-element-prefixes" as an attribute of a literal result element (in this case the XHTML <head> element). In this case you must use the "xsl:" prefix.
And Saxon 6.5 used by Oxygen to validate XSLT 1.0 validates both cases.
Regards,
Radu
I agree to the specification you quote but it's meaning (I've split the quoted spec in two) is like this:
which means this is valid:A namespace is designated as an extension namespace by using an extension-element-prefixes attribute on an xsl:stylesheet element
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:php="http://php.net/xsl"
extension-element-prefixes="php" exclude-result-prefixes="xhtml">
......
which means that this is valid:or an xsl:extension-element-prefixes attribute on a literal result element or extension element
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:php="http://php.net/xsl"
exclude-result-prefixes="xhtml">
<xsl:template match="report">
<head xsl:extension-element-prefixes="php">
<xsl:value-of select="php:functionString('my_function', 'parameter')"/>
</head>
</xsl:template>
</xsl:stylesheet>
And Saxon 6.5 used by Oxygen to validate XSLT 1.0 validates both cases.
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