The URI http://expath.org/ns/file does not identify an external Java class
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 12
- Joined: Mon Dec 16, 2019 6:51 pm
The URI http://expath.org/ns/file does not identify an external Java class
Hi,
we are using our own version of maketoc and chunktoc (xslt 1). When we execute chunktoc, we have a template that copy a file into another place. Exemple:
Chunktoc uses Saxon 6.5.5. But when we try to execute the chuntoc, it displays this message:
The URI http://expath.org/ns/file does not identify an external Java class
Is there a way to copy without having to switch from saxon (we're very dependant on it)?
we are using our own version of maketoc and chunktoc (xslt 1). When we execute chunktoc, we have a template that copy a file into another place. Exemple:
Code: Select all
xmlns:file="http://expath.org/ns/file"
exclude-result-prefixes="file" version="1.0"
<xsl:template match="imagedata[@fileref='babyyoda.jpg']">
<xsl:value-of select="file:copy('C:\Users\stran\Documents\testarticle\babyyoda.jpg', 'C:\Users\stran\Documents\testarticle\assoc\babyyoda.jpg')"/>
</xsl:template>
The URI http://expath.org/ns/file does not identify an external Java class
Is there a way to copy without having to switch from saxon (we're very dependant on it)?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: The URI http://expath.org/ns/file does not identify an external Java class
Hello,
You seem to be using an EXPath extension module (http://expath.org/ns/file), but AFAIK, there is no such an implementation of EXPath for Saxon 6.5.5. EXPath is available in Saxon 9. The EXPath file module is built into Saxon since 9.5 (available in Saxon-PE and Saxon-EE).
As an alternative you could copy the file by using reflexive extension functions in Java. Like this (using Apache Commons IO):
Note that this requires the class org.apache.commons.io.FileUtils from Apache Commons IO, so you also need the commons-io-*.jar in the classpath.
Regards,
Adrian
You seem to be using an EXPath extension module (http://expath.org/ns/file), but AFAIK, there is no such an implementation of EXPath for Saxon 6.5.5. EXPath is available in Saxon 9. The EXPath file module is built into Saxon since 9.5 (available in Saxon-PE and Saxon-EE).
As an alternative you could copy the file by using reflexive extension functions in Java. Like this (using Apache Commons IO):
Code: Select all
xmlns:file="java:java.io.File"
xmlns:fileutils="java:org.apache.commons.io.FileUtils"
exclude-result-prefixes="file fileutils"
version="1.0">
<xsl:template match="imagedata[@fileref='babyyoda.jpg']">
<xsl:value-of select="fileutils:copyFile(file:new('C:\Users\stran\Documents\testarticle\babyyoda.jpg'), file:new('C:\Users\stran\Documents\testarticle\assoc\babyyoda.jpg'))"/>
</xsl:template>
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
Return to “SDK-API, Frameworks - Document Types”
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