Saxon sql: Unknown extension instruction
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Saxon sql: Unknown extension instruction
Hi,
i need to import data extracted from my xml documents into an oracle database. Since it is only for internal use the saxon-sql-extension sounds suitble. However, all attempts to get it to work failed so far (using oxygen 16.0)...
my script:
This results in the output "[Saxon-EE] ERROR: Unknown extension instruction".
Using xsl:fallback within sql:connect (as int the example provided by saxon) results to a null pointer exception so I uses xsl:try/catch.
saxon9-sql.jar is present in oxygen-lib folder. I also added saxon9-sql.jar explicitly to the transformation scenario but it had no effect.
I uses a configuration file to map the sql namespace to the factory but it had no effect.
Removing the content of the connect-attributes had no effect either so it can't have to do with the oracle driver.
Now I'm runing out of options.
Any ideas what might go wrong? Or is there an alternative to import data from xml (generated with xslt) into an oracle database?
Thanks and regards,
Patrik
i need to import data extracted from my xml documents into an oracle database. Since it is only for internal use the saxon-sql-extension sounds suitble. However, all attempts to get it to work failed so far (using oxygen 16.0)...
my script:
Code: Select all
<xsl:transform version="3.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
xmlns:xs = "http://www.w3.org/2001/XMLSchema"
xmlns:err = "http://www.w3.org/2005/xqt-errors"
xmlns:saxon = "http://saxon.sf.net/"
xmlns:sql = "http://saxon.sf.net/sql"
extension-element-prefixes="saxon sql"
exclude-result-prefixes="#all">
<xsl:template match="/">
<xsl:variable name="driver" select="'oracle.jdbc.OracleDriver'"/>
<xsl:variable name="database" select="'jdbc:oracle:thin:@xxx'"/>
<xsl:variable name="user" select="'xxx'"/>
<xsl:variable name="password" select="'xxx'"/>
<xsl:try>
<sql:connect driver="{$driver}" database="{$database}" user="{$user}" password="{$password}"/>
<xsl:message>
<sql:query table="table" column="*"/>
</xsl:message>
<sql:close/>
<xsl:catch>
<xsl:message>ERROR: <xsl:value-of select="$err:description"/></xsl:message>
</xsl:catch>
</xsl:try>
</xsl:template>
</xsl:transform>
Using xsl:fallback within sql:connect (as int the example provided by saxon) results to a null pointer exception so I uses xsl:try/catch.
saxon9-sql.jar is present in oxygen-lib folder. I also added saxon9-sql.jar explicitly to the transformation scenario but it had no effect.
I uses a configuration file to map the sql namespace to the factory but it had no effect.
Code: Select all
<configuration xmlns="http://saxon.sf.net/ns/configuration" edition="EE">
<global allowExternalFunctions="true" versionOfXml="1.0"/>
<xslt>
<extensionElement namespace="http://net.sf.saxon/sql"
factory="net.sf.saxon.option.sql.SQLElementFactory"/>
</xslt>
</configuration>
Now I'm runing out of options.
Any ideas what might go wrong? Or is there an alternative to import data from xml (generated with xslt) into an oracle database?
Thanks and regards,
Patrik
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Saxon sql: Unknown extension instruction
Hi,
Your Saxon configuration file uses the wrong namespace for the SQL extension. It should be the same as the one from your XSL, "http://saxon.sf.net/sql". Here's the correct Saxon config file:
Regards,
Adrian
Your Saxon configuration file uses the wrong namespace for the SQL extension. It should be the same as the one from your XSL, "http://saxon.sf.net/sql". Here's the correct Saxon config file:
Code: Select all
<configuration xmlns="http://saxon.sf.net/ns/configuration" edition="EE">
<global allowExternalFunctions="true" versionOfXml="1.0"/>
<xslt>
<extensionElement namespace="http://saxon.sf.net/sql"
factory="net.sf.saxon.option.sql.SQLElementFactory"/>
</xslt>
</configuration>
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: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Re: Saxon sql: Unknown extension instruction
Hi Adrian,
Thanks for the hint. Even after you told be I had to use WinMerge to finde the difference...
However, i finally could get sql to work.
Regards,
Patrik
Thanks for the hint. Even after you told be I had to use WinMerge to finde the difference...
However, i finally could get sql to work.
Regards,
Patrik
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