XSL include and schematron
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 6
- Joined: Thu May 24, 2012 12:34 pm
XSL include and schematron
Hi,
I have a schematron document which runs fine in Oxygen XML, but when I try to process the same schematron using commandline I'm having trouble with XSL functions included.
I'm including a bunch of functions to the schematron like this:
At first I had a problem with the "xsl:include"-tag:
From setting up oxygenXML I remembered I had to add "allow-foreign=true". This removed the warning, but I still get errors like:
My command line looks like this:
I'm using the reference implementation from schematron.com for XSLT2 and saxon HE 9.4.0.3. I'm also using Saxon HE in OxygenXML.
Knowing this is a little out of scope of OxygenXML, but maybe I'm missing something obvious in my conversion or the way I'm importing the functions?
Thanks in advance,
Bo
I have a schematron document which runs fine in Oxygen XML, but when I try to process the same schematron using commandline I'm having trouble with XSL functions included.
I'm including a bunch of functions to the schematron like this:
Code: Select all
<xsl:include href="custom_fct.xsl"/>
<ns prefix="fct" uri="http://custom"/>
Code: Select all
Warning: unrecognized element xsl:include
Code: Select all
Error at xsl:when on line 194 column 53 of out_1.xsl:
XPST0017 XPath syntax error at char 0 on line 194 in {fct:func_custom(.)}:
Cannot find a matching 1-argument function named {http://custom}func_custom()
Code: Select all
$SAXON -o:out_1.xsl -s:$SCHEMATRON_FILE \
$ISO_SCHEMATRON_DIR/iso_schematron_skeleton_for_saxon.xsl allow-foreign=true
$SAXON -o:out.results -s:$XML_FILE out_1.xsl allow-foreign=true
Knowing this is a little out of scope of OxygenXML, but maybe I'm missing something obvious in my conversion or the way I'm importing the functions?
Thanks in advance,
Bo
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XSL include and schematron
Hi,
I've tried your transformations with Saxon-HE 9 both in Oxygen and in the command line and they worked fine.
Make sure that the output of the first transformation (out_1.xsl) is located in the same directory as the included .XSL file (custom_fct.xsl). This is necessary because the references to the included stylesheets are relative.
Note that the last transformation does not require "allow-foreign=true".
Have you tried to open out_1.xsl in Oxygen and see if it validates?
How are you declaring and how are you using the function in the schematron file?
Can you show me code snippets for both?
Regards,
Adrian
I've tried your transformations with Saxon-HE 9 both in Oxygen and in the command line and they worked fine.
Make sure that the output of the first transformation (out_1.xsl) is located in the same directory as the included .XSL file (custom_fct.xsl). This is necessary because the references to the included stylesheets are relative.
Note that the last transformation does not require "allow-foreign=true".
Have you tried to open out_1.xsl in Oxygen and see if it validates?
How are you declaring and how are you using the function in the schematron file?
Can you show me code snippets for both?
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
-
- Posts: 6
- Joined: Thu May 24, 2012 12:34 pm
Re: XSL include and schematron
Hi,
Thanks for pointing out I can use oxygenXML to debug each step (I'm still new to xml...). It gives a better overview. It was only in the last step which failed in oxygenXML also. Looking more closely at the error messages reveals the embarrasing fact that the XSL-file with the custom functions was not in sync on my test machine having the commandline tools installed
.
It's working fine now, thanks again.
Best regards,
Bo
Thanks for pointing out I can use oxygenXML to debug each step (I'm still new to xml...). It gives a better overview. It was only in the last step which failed in oxygenXML also. Looking more closely at the error messages reveals the embarrasing fact that the XSL-file with the custom functions was not in sync on my test machine having the commandline tools installed

It's working fine now, thanks again.
Best regards,
Bo
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