Xslt:include within CLOB
Hello community,
There is a table with CLOB-fields containing XSLT documents. I read this table from java and do XSL-Transformation in Java, too.
Now I need to split this documents in separate modules and save each modul in an own table entry. I want to compose this documents by the <xsl:include> tag. The dirty way is to load the main document from java, parse it and load missing parts from darabase when the document contains <xsl:include>.
I would be more happy, if Oracle supports <xsl:include> build in. For example, I would write <xsl:include href="key=3"> or something like this and hope that Oracle parses this and gives me the composed XSLT document or even the parsed XSLT result. If necessary, I can use PL/SQL, too.
What is the best way to do this? Can you give me a hint or key word for the Oracle technology I should look for?
Thanks!
Alex
The XML forums would have been better though.
Given what is currently supported by the Oracle XSLT processor, here's the basic approach you can follow :
SQL> create table stylesheet_table (
2 doc_id integer
3 , doc_name varchar2(30)
4 , doc clob
5 );
Table created
SQL>
SQL> insert into stylesheet_table values (1, 'main',
2 '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:template match="/">
4 <xsl:text>The document has </xsl:text>
5 <xsl:call-template name="nodeCount"/>
6 <xsl:text> node(s)</xsl:text>
7 </xsl:template>
8 <xsl:include href="/oradb/DEV/STYLESHEET_TABLE/ROW[DOC_ID=2]/DOC/text()"/>
9 </xsl:stylesheet>'
10 );
1 row inserted
SQL>
SQL> insert into stylesheet_table values (2, 'nodeCount',
2 '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:template name="nodeCount">
4 <xsl:value-of select="count(descendant::node())"/>
5 </xsl:template>
6 </xsl:stylesheet>'
7 );
1 row inserted
SQL>
SQL> select xmltransform(
2 xmltype('<root><item>ABC</item></root>')
3 , dburitype('/oradb/DEV/STYLESHEET_TABLE/ROW[DOC_ID=1]/DOC/text()').getxml()
4 )
5 from dual;
XMLTRANSFORM(XMLTYPE('<ROOT><I
The document has 3 node(s)
The key is the ability to reference an external document via the oradb scheme (for documents stored in custom tables) or in the XMLDB repository.
Please also note that "DEV" is my schema here :
/oradb/DEV/STYLESHEET_TABLE/ROW[DOC_ID=1]/DOC/text()so if you want to test, of course replace it with your own.
Similar Messages
-
I have an XSLT file that an xml file is referring to.
The XML file calls the XSLT with this line:
<?xml-stylesheet href="page.xslt" type="text/xsl"?>
The "page.xslt" then includes another xslt file called "widgets.xslt"
"widgets.xslt" has about 10 other xslt files included within it. From what I have found, it seems that Safari will not include any other files after the third level (within the widgets.xslt file)
If I put the includes that I have within the "widgets.xslt" file directly into "page.xslt" everything works. If I don't than the page is blank.
Also, I though maybe something was wrong with the "widgets.xslt" file, so I tried to just put plain XSLT (no includes) in it to see if it still transforms. When I do this the page works.
So my conclusion is that Safari only supports 3 levels of included xslt files. Is this true? is there something I can do to fix this. Does anyone have an answer?
P.S. This works in Firefox 2.0/OS X, Firefox 2.0/Windows, IE6 and IE7 (I am using Safari 2.0)You might want to have a look at this site:
http://webkit.org/ -
Include within an Include not loading?
On a page I have an Include, within that include is another include. However, the include that is already in an include doesn't appear to load or render. I double checked the file paths and those are correct.
Can I have an include within an include?I just realized I missed something, oops!. I have an include within an include working but the include within an include within an include isn't. So it is three deep: Include > Include > Include. I know content holders work that deep but includes?
Didn't realize I was nesting them three deep until I followed the path.
{%include "/_System/includes/sign-in-form.tpl"-%} <!-- First include on a page. -->
<!-- HTML within include then next include. -->
{%include "/_System/includes/signup-form.tpl"-%} <!-- This include works. -->
<!-- HTML within include mentioned above then final include. -->
{%include "/_System/includes/recaptcha-fix.tpl"-%} <!-- Final Include. --> -
Consider the following html code where I open a textarea and include a comment tag within the textarea. Within the comment tag (which Firefox 4 should ignore) I've included a close textarea tag. Firefox 4 (unlike FF3 and IE) closes the textarea.
The following code is also available at
http://www.cems.uwe.ac.uk/caa/ffbug/index.html
We are about to start a textarea....<p>
<pre><nowiki><textarea rows='20' cols='40'>
Here is the textarea.
Inside these comment blocks I'll put a close textarea tag which Firefox should ignore but does not.
<p>
<!--
We are now inside comment blocks...
<br>
This code should be inside the text area.<br>
</textarea>
<br>
and so should this code be <b>inside</b> the text area (but is not in Firefox 4).
-->
</textarea>
<p></nowiki></pre>
This code should be outside the textbox.Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
http://forums.mozillazine.org/viewforum.php?f=25 <br />
You'll need to register and login to be able to post in that forum. -
How to find out the maximum length of the characters specified within CLOB
I have given a table which has a column with datatype CLOB . I want to find out the maximum legth of the string within this variable and also want to print that variable.
Thanks for your help.SELECT
MAX(DBMS_LOB.GETLENGTH(clob_column))
FROM
your_table -
Hi,
I am in the process of building an application in which the data tier serves XML and the presentation layer uses XSLT to render the desired format. I need to produce an html table with data that is stored in a database(easy). The issue is that in cell 3 for example, I need to select data from my data objects (that return xml)for an html select list. What would be an effective way to merge the two seperate xml docs? Any help would be greatly appreciated.
Thanks...Lets say you want to "include" the file foo.xml in a file called bar.xml. One way way to go about it is to use something similar to:
<!ENTITY Foo SYSTEM "foo.xml">
before the top level element your bar.xml and
&Foo;
somewhere inside the bar.xml.
Also sometimes it's easier to just use the document() XSLT function to include whatever node you wish from an external resourse. This function should be used somewhere inside the XSL file which provides you with the desired formarting.
null -
I have two tables
client_captions (which contains a varchar2 column called captions)
clients (which contains a clob column called client)
I'd like to know how many clients have any of the client captions within their clients data (which is a clob column).
Could you provide the code to figure this out.
E.g,
select * from clients where instr(client,:caption) > 0
where :caption would come from
select caption from client_captions
Could you help me by providing me with the code?
ThanksSince 9i LIKE works too:
SQL> create table t1 (clob_data clob);
Table created.
SQL> insert into t1 values('shdgshdgsjadgsahdkjahsdjkhjksadhjksadhakjhSMITHhagjhsgajs');
1 row created.
SQL> insert into t1 values('843984365984365437896543789564389756439875643985ALLAN8798435 45439857439
8574');
1 row created.
SQL> insert into t1 values('84398436598436543789654378956438975643987564398WARD475984375');
1 row created.
SQL> select substr(clob_data,1,10) from
2 t1 where exists (select 1 from emp where t1.clob_data like '%'||emp.ename||'%');
SUBSTR(CLOB_DATA,1,10)
shdgshdgsj
8439843659Rgds. -
Hi Folks,
Could anyone tell me what binaries ( swf, flash, xml, etc..) are needed if I want to run Xcelsius from within another application? Do they need to be in the same folder?
Also, how are licenses used, stored, retrieved for Xcelsius when included in another application?
Thanks,
KarunAre you wanting to run the Xcelsius-created .Flash file (.swf) from within another application - or are you asking about running Xcelsius itself from within another app?
-
i have a CLOB datatype column how i will insert record inthis column like picture etc.
For pictures you may need the BLOB datatype. As for examples, why not look up the user guide, it comes with a search function, you know. Here's a link for an CLOB example:
http://download-uk.oracle.com/docs/cd/B19306_01/text.102/b14218/cdatadic.htm#sthref319
C. -
Challenge: Controlling the output stream of includes within iterative tags
Problem:
How can you control the output stream of an iterative tag that is making an include on each iteration (either by using the jsp include tag or by a custom tag that does an pageContext.include(). Example of the first of such a case could be:
<wf:iterator name="...">
<div>
<jsp:include page="test.jsp" flush="true"/>
</div>
<wf:iterator>
I now want to see the following output:
<div>
..content of jsp file 1
</div>
<div>
...content of jsp file 2
</div>
etc....
However what I AM seeing is that the jsp content is flushed to the output stream before the divs like this:
...content of jsp file 1
...content of jsp file 2
<div>
</div>
<div>
</div>
See!? How is that and what can I do to control the output stream??
Thanks
Alf Johannessen
AriolThis is a stab in the dark, but have you tried writing your div tags out using the JSP directive:
out.println("<div>");
or
<%="<div>"%>
It looks like a bug in the iterator. I'd suggest you try setting flush to be false, but I know that's not supported yet (unless you've updated your libraries) ... -
Include within Default.lgf Script Logic does not run
Dear Gurus,
I wrote a WHEN function in Script Logic which is supposed to multiply a input % (INP01) value (growth) with the absolute figure of the previous year. I works fine in the Backend Debugger. Then I put it in the default logic because I want it to run everytime somebody sends data. However it doesn't run? Has anybody had a problem like this?
When running the default formulas out of the data manager it works just fine.
default:
*INCLUDE CALCULATE_KPI.LGF
Calculate KPI:
*XDIM_MEMBERSET ULOB=D00000
*XDIM_MEMBERSET UCHANNEL=VD0001
*XDIM_MEMBERSET RPTCURRENCY=EUR
*WHEN TIME
*IS "2008.SUM"
*WHEN CATEGORY
*IS "ACTUAL"
*WHEN P_ACCT
*IS "I001"
REC(EXPRESSION=%VALUE%(1+([P_ACCT].[INP01],[ TIME].[2010.INP],[CATEGORY].[PLAN])),CATEGORY=V302,TIME=2010.INP,P_ACCT=I0000001)
*ENDWHEN
*ENDWHEN
*ENDWHEN
Thank you so much in Advance
Edited by: Cora Boettger on Oct 19, 2009 3:59 PMHi Cora,
Are you sure that your default logic isn't running and that the *WHEN just isn't being triggered? This has happened to me when members used in *XDIM_MEMBERSET or *WHEN are not base-level. I'm a bit suspicious about 2008.SUM with regards to this.
You can test by replacing what you have with something like
*WHEN CATEGORY
*IS *
*REC(FACTOR=1.1)
*ENDWHEN
If this results in your written back values being multiplied by 1.1 into the TEST category, then your default logic is running and your issue is that the *WHEN is not getting triggered. At that point your should be able to head into the script logic tester and keep trying different scripts until you find one that works.
Good luck!
Ethan -
Aftr update to 10.8.5 12F45, I just noticed that all my files - photos, emails, you name it, EVERYTHING, is dated with 05.01.13. Files that I have not touched for months, expiration dates of credits cards, everywhere there is a date field - there is only one date and that is 05.01.13. What is going on?
Incorrect date or time displayed in various applications
-
XSU XSLT and using xsl:include href=""
I'm runing XDK 9.2 on an 8.1.7.4 database. I'm trying to transform the output of the XSU into a flat text file using a set of XSLT files. The main xslt includes the other xslt template files and then calls their templates by name as needed for different types of data in the XSU output.
I have the main xslt in a table of BFILEs that I read from and pass to the DBMS_XMLQUERY.SETXSLT procedure as a CLOB. I get the following errors when I run the main procedure to generate the flat text file:
oracle.xml.sql.OracleXMLSQLException: <Line 41, Column 35>: XSL-1002: (Error) Error while processing include XSL file (header.xslt).
at oracle.xml.sql.query.OracleXMLQuery.setXSLT(OracleXMLQuery.java:818)
at oracle.xml.sql.query.OracleXMLStaticQuery.setXSLT(OracleXMLStaticQuery.java:481)
"header.xslt" is one of the included xslts. Is there some way to specify the other xslts? I have tried loading them into the BFILE table, but it still doesn't work.Hi I have tried out the code i.e. transforming a node and getting out a string representation. Following is code that works using JAXP apis.
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.*;
import javax.xml.transform.dom.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import java.io.*;
public class XMLString {
public void xmlInString(Document document) throws Exception{
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer =
tf.newTransformer();
StringWriter stWriter = new StringWriter();
transformer.transform(new DOMSource(document), new StreamResult(stWriter));
String strDOM = stWriter.toString();
System.out.println("String dom");
StringReader strIn = new StringReader(strDOM);
BufferedReader buffIn = new BufferedReader(strIn);
BufferedWriter bufOut = new BufferedWriter(new FileWriter("out.txt"));
String out = null;
while((out=buffIn.readLine()) != null){
bufOut.write(out, 0, out.length());
bufOut.flush();
bufOut.close();
public static void main(String args[]){
try{
XMLString strXML = new XMLString();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource inputSource = new InputSource("input.xml");
Document doc = db.parse(inputSource);
strXML.xmlInString(doc);
}catch(Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
I am using the xalan and xerces versions that come with the Java XML Winter pack from sun's website. The problem could lie with the underlying transformation processor you are using. It may not support transforming to a string or it could have a bug. So my advice is to find out what version transformation processor you are using. And look at the vendor's documentation to find any reference to this feature. Otherwise try using the Java XML Winter pack. -
Include jsp page within servlet
Hi,
How an external jsp or html page can be included within a servlet.
like, One servlet is including different pages within it's body based
different condition and arggument passed to it.
Hope for your help.
Thank you.Thank You for your help.
I have sucessfully slove the problem. I am awarding you full 10 duke
dollors for it. I have anthoer problem about applets is listed in
Applet devlopment under 'Applet to access html controll' title.Please
visit that if you like to participate.
For ee8prt, i had same problem as i was using jsdk2.0 which dont have the despatcher class. user higher jsdk.
Happy coding. -
Attachements not included in search within Apple Mail
Hi
I have a problem with the search within Mail: my attachments seem not to be included within searches. When I search for terms within an attachment, I get no results. I tried with PDFs, DOCs, RTFs and ZIPped documents.
By the way: if there happens to be some expert out there: what kinds of attachments are searched within mail (e.g. a DOC in a ZIP archive)?
My system is quite new and setup still standard (at least the spotlight preferences).
Any help would be greatly appreciated.
Thanks,
PhilHi,
It is caused by the deprecated features and components in Outlook 2013:
Outlook search via the Windows Shell
Outlook 2013 will no longer surface search results for mail and calendar items in Windows Explorer (or via the start menu). Users can still utilize all of Outlook's search functionality from within the app itself.
http://blogs.office.com/b/microsoft-outlook/archive/2012/12/19/outlook-2013-deprecated-features-and-components.aspx
Best regards,
Rex Zhang
TechNet Community Support
Maybe you are looking for
-
Is it possible to stop depreciation for a certain period?
Hi all, I am wondering if it is possible, and how it is done if yes, to stop the depreciation. For example in the 2nd year of an asset the user wants no depreciation on that asset for 5 months, after which the asset starts depreciating again. Also li
-
Urgent!!!! how to get socket
Hello! I'm working with JDeveloper 11. I made a proxy web service using Wizard. I need get the socket connection to close it after I'll receive the message. I'm using SOAP and jax-rpc. If you need more information I'm going to write. Please is urgent
-
How to find if cursor returned rows
If i have a procedure like create procedure test as cursor cur_test is select col from table; begin delete from tab1 a; for var_cur_test in cur_test loop insert into temp values(var_cur_test.col); end loop;
-
Problem in displaying message in screen
Hi All, I am trying to put a comma between each variable that is getting displayed in screen. I am displaying a sucess message in my screen as follows. DATA: lv_message type symsgv. concatenate var_one ',' var_two ',' var_three ',' va
-
Error in Executing Web Service
Hello All, I am trying to execute a webservice from R/3 transaction wsadmin. I selected my webservice and clicked on execute. I selected Document style in WSDL style. It opens a new browser window. But upon opening it, it gives following error: Canno