Oracle extensions in xslt
Can anyone give me an example of the use of the extension function ora:node-set() and the extension element ora:output in the latest xmlparser_v2? Is ora:output equivalent with xt:document in xt?
Thanx,
Marko.
See the example I posted here on OTN in this thread:
http://technet.oracle.com:89/ubb/Forum11/HTML/004618.html
Similar Messages
-
Oracle SB and XSLT 1.0 or 2.0
Does Oracle SB use XSLT 1.0 or 2.0
If it only users 1.0 at this time, what time frame is planned for phasing in XSLT 2.0 ?XSLT 1.0 is fully supported. You may contact your local Oracle Sales representative to understand future plans for supporting XSLT 2.0
If you have any specific request, please raise a SR/ER with support and they should provide the appropriate solution/workaround
Regards,
Anuj -
Hi,
I am working on SQL extensions on XSLT using xalan SQL Library. My requirement is to insert some data which comes in the form of XML to one of our tables. I tried to write a sample XSLT to retrieve the data from the database (thought I can change it to insert once I succeed retrieving data). The XSLT is not working. I think I am able to connect to database successfully but not able to retrieve any results. Any help would be greatly appreciated.
Thanks in advance,
Latha
Here is my sample XSLT.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:sql="org.apache.xalan.lib.sql.XConnection"
extension-element-prefixes="sql"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xalan"
>
<xsl:param name="queryString" select="'SELECT * FROM FASTATUS'"></xsl:param>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<xsl:variable name="dbObj" select="sql:new()"></xsl:variable>
<!-- Connect to the database with minimal error detection -->
<xsl:if test="not(sql:connect($dbObj, 'extpool'))" >
<xsl:message>Error Connecting to the Database</xsl:message>
<xsl:copy-of select="sql:getError($dbObj)/ext-error" />
</xsl:if>
<xsl:message>Database Coneection successful</xsl:message>
<HTML>
<HEAD>
<TITLE>List of Values</TITLE>
</HEAD>
<BODY>
<!--
Let's include Error Checking, the error is actually stored
in the connection since $table will be either data or null
-->
<xsl:variable name="table">
<xsl:copy-of select="sql:query($dbObj, $queryString)"/>
</xsl:variable>
<xsl:if test="not($table)" >
<xsl:message>Error in Query</xsl:message>
<xsl:copy-of select="sql:getError($dbObj)/ext-error" />
</xsl:if>
<xsl:message>Query execution successful</xsl:message>
<TR>
<!-- Get column-label attribute from each column-header-->
<xsl:for-each select="$table/sql/metadata/column-header">
<TH>
<xsl:value-of select="@column-label"/>
</TH>
</xsl:for-each>
</TR>
<xsl:apply-templates select="$table/sql/row-set/row"/>
<xsl:text> </xsl:text>
</BODY>
</HTML>
<xsl:value-of select="sql:close($dbObj)"/>
</xsl:template>
<xsl:template match="row">
<TR><xsl:apply-templates select="col"/></TR>
</xsl:template>
<xsl:template match="col">
<TD><xsl:value-of select="text()"/></TD>
</xsl:template>
</xsl:stylesheet>No idea. You didn't mention pquery in your original post, and I don't even know what that is (even after googling it).
Anyway, your problem is the same as in your first post. You haven't done your research. All you know is it's "not working". Find out in what way it is not working and then post a detailed question. -
Oracle Extensions Examples & WebLogic Server
I've run the oracle extensions examples with weblogic server and cannot get the
string representation for the addresses, as indicated in the examples documentation.
I get a hexadecimal representation. I'm running structs, refs and arrays business
object examples. My output is, for example:
[java] Employee#: 103
[java] Name: Fred Couples
[java] Address: 0x39323031205061726B205374
[java] 0x416C6578616E64726961, 0x5641
[java]
[java] Employee#: 105
[java] Name: David Toms
[java] Address: 0x343433312043616E616C20537472656574
[java] 0x4E6577204F726C65616E73, 0x4C41
[java]
So my questions is how do I get a string representation? Is there a hextostring
conversion java method? Why do I get hex in the first place?. The source file
is using system.out.println.
The output should be, for example:
Address: 4431 Canal Street
New Orleans, LA
Look at the AddressBO.java file in the C:\bea\weblogic700\samples\server\src\examples\jdbc\oracle\extensions
directory.
I use BEA 7.0 and Oracle 9.0.1.1.1.
Steve.The datatype for address may clob.Clob values cannot be retrieved directly .please try the following code.
Clob clob = rs.getClob(3);
Reader reader = clob.getCharacterStream();
int l=1;
StringBuffer str = new StringBuffer();
if(reader!=null)
while((l=reader.read()) != -1)
str.append(new Character((char)l).toString());
reader.close(); -
Error while installing SSMA for Oracle Extension Pack 5.3
When installing the database utilities portion of the SSMA for Oracle Extension Pack 5.3 setup, the error below occurs.
Invalid connection (CREATE ASSEMBLY failed because it could not open the physical file "C:\Microsoft SQL Server Migration Assistant for Oracle Extension Pack\bin\ext\SSMA4OracleSQLServerCollections.NET.dll": 3(The system cannot find the path specified.).)
It appears that the installer is using the path: "C:\Program Files\Microsoft SQL Server Migration Assistant for Oracle Extension Pack"Hi,
According to your description, this error might be caused by the account you used to install SQL Server Migration Assistant for Oracle Extension Pack. We can troubleshoot this issue as follows:
Verify the installation file is complete before installing this Extension Pack.
When you install SSMA for Oracle Extension Pack, we need to make sure you right click the pack and select ‘Run as administrator ’. Also we ensure that your account has Read/Write permission on the bin folder.
Additionally, before installing SSMA for Oracle Extension Pack, we need to
make sure that the system meets the following requirements:
SQL Server 2005 or higher is installed.
Microsoft Windows Installer 3.1 or a later version.
SQL Server Browser service is running.
For more details, you can review the related links.
http://www.microsoft.com/en-us/download/details.aspx?id=42655
http://msdn.microsoft.com/en-us/library/hh313165(v=sql.110).aspx
http://blogs.msdn.com/b/ssma/archive/2011/05/12/ssma-5-0-extension-pack-installation-error.aspx
Thanks
Lydia Zhang
&lt;p style=&quot;margin:0cm 0cm 0pt&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color:#0070c0; font-family:&#39;Segoe UI &#39;,&#39;sans-serif &#39;;
font-size:10pt&quot;&gt;Lydia Zhang&lt;br/&gt; TechNet Community Support&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;margin:0cm 0cm 0pt&quot;&gt;&lt;a href=&quot;http://blogs.technet.com/b/onescript&quot;
rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;https://xnoegg.bay.livefilestore.com/y1plmwd9pFqoTZWcmr6-bsBuS7hTcNbr8YdT4WL3RRAuhDPVyUUOVchQt3EexNEBj4xYyornsD1kyLmtVqqsDfKv3PEEg9ejQzT/signature.jpg?psid=1&quot;
alt=&quot;&quot; width=&quot;430&quot; height=&quot;30.2&quot;&gt;&lt;/a&gt;&lt;/p&gt; -
Hi,
The "Official Oracle Extensions" link on the extension page:
http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/index.html
doesn't appear to be working. Is there another URL I can download the extensions from?
Thanks,
Barry.For those with no patience (like myself), you can find the URL to the plugin zipfile in the following google cache page:
http://tinyurl.com/jdevupdate-googlecache
'Help' -> 'Check for Updates' -> 'Next' -> Choose 'Install From Local File' -> browse to the downloaded zip. -
Error while loading data oracle table using xslt
Hi
I have an following xml:
<TRAN TRAN_ID = "12" RCODE = "W"> <STATION>1234567</STATION> </TRAN>
I have created the following xslt for the above xml:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="TRAN"><xsl:value-of select="@TRAN_ID" /> <xsl:value-of select="@RCODE" /> </xsl:template> </xsl:stylesheet>
I am trying to insert data into the table Tran having columns tran_id and rcode in oracle database 11g.
I am getting the following error:
ERROR at line 1:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '1'
ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
ORA-06512: at "SYS.DBMS_XMLSTORE", line 88
Can anybody tell me if i am making a mistake in writing the xlst?
Thanks in advance.Thank you for your reply. Currently i am using the insert using xmltable and it works fine. But i would like to use xsl if the dynamic passing of values is possible. Actually i want to store the xsl in a table and call it when needed to insert data to the database table (MSGS). Could you please give me an example of it?
Here is the table structure i have in database:
Table Name: Tran_data
columns: SEQ NUMBER NOT NULL ,
TRAN_ID VARCHAR2(6) NOT NULL ,
RCODE VARCHAR2(30) NOT NULL ,
TRAN_DT DATE NOT NULL ,
xml_data xmltype
Table Name : Msgs
SEQ NUMBER NOT NULL,
RULE_ID VARCHAR2(200) not null,
MSG_TXT VARCHAR2(2000) NOT NULL,
TRAN_DATA_SEQ NUMBER NOT NULL ,
CREATE_USER VARCHAR2(30) NOT NULL ,
CREATE_DATE DATE NOT NULL ,
COMMENTS VARCHAR2(2000)
In this TRAN_DATA_SEQ is a foreign key and is a mandatory column. I can get the Tran_id and the rcode from xml. but the remaining mandatory columns i need to pass them to the xsl. Below is the xsl. Can you please let me know how to pass value to this the xsl.
[P]
xml:
<RES>
<Status>'PASS'</Status>
<Tran_id>1A</Tran_id>
<Rcode>1BR</Rcode>
<Msg>
<Rule_Id>A<Rule_Id>
<Msg_Text>'CRDT Failed'<Msg_Text>
</Msg>
<Msg>
<Rule_Id>B<Rule_Id>
<Msg_Text>'MAN Failed'<Msg_Text>
</Msg>
</RES>
[P]
I need an xsl for this xml to insert tran_id and rcode in tran_data table along with the xml as xml_data and the msg information in msgs table. The seq of tran_data needs to be inserted into the msgs table. Please let me know how this can be achieved using xsl?
Thanks in advance. -
ABAP XSLT Extensions or XSLT (XI imported archive)?
Hi all,
I would like to know which is having better performance in a scenario with a significant number of messages.
I know that ABAP XSLT Extensions is based in XSLT 1.0 and have some features of XSLT 2.0. So, for me it means some limitations and a disadvantage compared with all of XSLT 2.0 standard can offer.
But, my question is related with performance and I just want to know which is faster.
Thanks in advance,
Cheers,
Ricardo.Hi Ricardo,
abap xslt has one great advantage
abap stack does not have to communicate with
java stack to perform the - so no RFC calls for mapping
with many messages that might influence their flows
but it wuold be best if you could just test it
in YOUR environment (there are many test tools -
like Loadrunner from Mercury) or you can write your own scripts
and just test in your particular examle which one is better
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
I think xslt has some bugs. The "value-of" statement in stylesheet does'nt seem to work properly. I tried to execute the same things(with same stylesheet and xml document) outside oracle, and it is working perfectly fine. So I've created a simple-to-do experiment and put the relevant files on my homepage, and also attached a readme.txt
http://www.db.uwaterloo.ca/~nkhandel
and read readme.txt
regards
-nitin
======Here is a temporary workaround for the problem...
SQL> SELECT value(p).transform
2 (
3 dburiType('/SCOTT/STYLESHEET_TAB/ROW[ID = "1"]/SHEET/text()').getXML()
4 ).getClobVal() AS result
5 FROM nations p
6 /
RESULT
3333 -
Hi,
I'm just starting with the new features in the XML/XSLT parser.
I would like to use the Java extensions to do something like
this: I want to be able to insert an XML document at a certain
position based on user input. I have tried something like
<xsl:template match="page">
<xsl:variable name="myparser" select="parser:new()"/>
<xsl:value-of select="parser:parse
($myparser, 'file:/D:/Razvan/OracleXMLParser/sample/prefs.xml')"/
>
<xsl:variable name="mydocument" select="parser:getDocument
($myparser)"/>
This is the line ------V
<xsl:value-of select="$mydocument"/>
<xsl:apply-templates/>
</xsl:template>
and it doesn't work.
Any ideas?
Thanks,
Razvan
nullDear Sateesh,
Declare xlst variables at start of xsl program like below
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="today_formatted" select="java:java.text.SimpleDateFormat.new('yyyyMMdd')"/>
<xsl:variable name="time_formatted" select="java:java.text.SimpleDateFormat.new('HHmmss')"/>
and use them in xsl mapping
<xsl:value-of select="substring(concat(java:format($today_formatted, $date),$blanks),1,8)"/>
<xsl:value-of select="substring(concat(java:format($time_formatted, $date),$blanks),1,6)"/>
thanks,
madhu -
Recompiling PHP to add Oracle extensions
Windows 2000 SP2|Oracle 9.2|PHP 5.2.4
I have tried to install php_oci8.dll and php_oracle.dll.
I added these lines to the php.ini file
extension=php_oci8.dll;
extensoin=php_oracle.dll
I downloaded the dll files from PECL
When I run the php file it displays everything up until it gets to the ociconnect then displays nothing after that. no errors.
I read somewhere to run php -v in my command prompt and this is what I got.
Unable to load dynamic library './php_oci8.dll'
The specified module could not be fonud. I made sure that the dlls are in the c:\php folder. I tried putting the oci8.dll after the oracle.dll extension and that did not work. So Im installing more oracle client things to see if that works.okay I have 5.2.4 running again and I have
a if statement and it basically says if connection is good say good and not good say no good and I get a no good from it
Under phpfinfo() I have a oci8 sectin that I did not have before here's the setting is has.
OCI8 Support enabled
Version 1.2.4
Revision $Revision: 1.269.2.16.2.38 $
Active Persistent Connections 0
Active Connections 0
Temporary Lob support enabled
Collections support enabled
Directive Local Value Master Value
oci8.default_prefetch 10 10
oci8.max_persistent -1 -1
oci8.old_oci_close_semantics 0 0
oci8.persistent_timeout -1 -1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20
and the ODBC has these
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library Win32
Directive Local Value Master Value
odbc.allow_persistent On On
odbc.check_persistent On On
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited
I am working on trying and install a Oracle ODBC Driver since there does not seem to be one installed. -
Oci8 and oracle extensions mutually exclusive?
Does anybody know if the following extensions are mutually exclusive.
php_oci8.dll
php_oracle.dll
I can't getting both to load.
They can be uncommented in the php.ini and loaded individually but if both are used this causes a fatal error and apache fails to start and doesn't leave anything in the log file.
I am currently using php4.3.6 / NT / Apache 1.3.12 (Win32)
I am fairly new to php and don't seem to be getting anywhere fast, any help would be appreciated.
thanks
Neil W.I have them both uncommented and usable. I'm using Apache 1.3.28.
Maybe your four-year old Apache version is the problem?
-- CJ -
Where can I find any documentation about this??
I'm using JDeveloper 2.0 and there isn't any documentation about
this.
Thanx
nullEls (guest) wrote:
: Where can I find any documentation about this??
: I'm using JDeveloper 2.0 and there isn't any documentation
about
: this.
: Thanx
online doc at :
http://technet.oracle.com/doc/java.815/a64685/overvw4.htm#1001574
SEE the following FAQ link for additional details :
http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
i hope this helps ...
null -
What Are the Oracle Extensions Beyond Basic SQL?
I think I write some pretty mean queries. I've written some very tight queries with nested selects and in-line selects that take up four or five printed pages. However, all of my queries are limited to the basic clauses; select, from, where, group by, having, and order by, with a bunch of case statements and a handful of custom functions thrown in.
I recently saw a post on the ApEx forum that made me realize there is much more you can do with a SQL statement besides select...from...where. The post included a 'with' clause and a 'level' clause.
Where can I find a compilation of other SQL clauses/statements? I would really like to get my hands on a book as opposed to web links, but anything will be appreciated.
Thanks very much,
GregoryThe best place is still SQL Reference
Nicolas. -
Need to use Xalan in place of Oracle XSLT processor
We are working with Oracle BPEL 10.1.3.3. We have a requirement to use Xalan as the XSLT processor to preserve existing investment into transformation maps built using Contivo (which is certified to work with Xalan).
That said, we are having some trouble getting the Xalan processor to kick in going the java:exec route. For some reason, we end up with Oracle's XSLT processor in spite of asking for the Xalan implementation.
TransformerFactory tFactory = new org.apache.xalan.processor.TransformerFactoryImpl();
Transformer transformer = tFactory.newTransformer(new StreamSource(xslInURI));
System.out.println(tFactory.toString()+transformer.toString());
Strangely enough, the above snippet prints:
[email protected]Transformer@e39f6b
Wondering if anybody else has used Xalan successfully in conjunction with 10.1.3.3 bits. Appreciate your help.please copy and paste the following in your xpath-functions.xml file
<function id="processXSLT" arity="2">
<classname>com.collaxa.cube.xml.xpath.functions.xml.GetElementFromXSLTFunction</classname>
<property id="namespace-uri">
<value>http://schemas.oracle.com/xpath/extension/xalan/xslt</value>
</property>
<property id="namespace-prefix">
<value>xalan</value>
</property>
</function>
This function would try to find the default transformer factory using
TransformerFactory.newInstance()
so you might need to place the xalan transformer factory properties file in the beginning of your classpath (server.xml ) or pass it as jvm system property like below:
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
Maybe you are looking for
-
I have a macbook, an ipad, and an iphone with the Mail app on all three synced through icloud, but when I read and delete emails on my phone, the inbox on my ipad is not update, so I have to go through and mark as read or delete messages again. How
-
Stock transport order (STO) financial documents
Hi Can any one post the financial documents of a stock transport order process between two different company codes( Both one step and two step process with delivery and billing document).
-
I have a problem with the icon in the menu bar MacBooster Beta 3 I can not delete
I have a problem with the icon in the menu bar MacBooster Beta 3 I can not delete www.advancedmaccare.com and installed and uninstalled the program and past cleanApp or ccleaner programs and nothing works <Link Edited By Host>
-
Seagate Portable Hard Drive - Documents Not Opening?
Hi guys! I am using a new Seagate GoFlex Portable HD (500GB) and up until 5 minutes ago, no problems were to be had! NOW whenever I try to open ANY old Office For Mac 2010 file, I'm told I can't (for a variety of reasons)! The funny thing is that whe
-
Presales Asset of the Week: Predictive Analytics with SAP HANA
To our SAP Partners: watch this demo http://bit.ly/UhJOok showcasing how business analysts and data scientists can take advantage of predictive analytics in big data scenarios. It also highlights how developers can embed the predictive analytics capa