Apply Stylesheet to XML Document

Is there a way to query relational data and apply a stylesheet to it using PLSQL code and then query the results using dbms_xmlgen.getxml?

What database version are you on?
Convert relational data to XML instances ( / XMLType datatype), for instance via functions, like XMLElement, XMLroot, etc or dbms package; and then use the XMLtransform function to apply your stylesheet. The moment you defined your select statement, you also could create a XMLType view. Anyway this could be handled via PL/SQL and queried by dbms_xmlgen.getxml via a collection (on stack/in memory) etc...
Pinpoint on xmltransform questions on this forum:
Re: Most effecient way to generate XML output
XML DB

Similar Messages

  • Embedding XSL in XML document

    Hi
    I am new to this particular forum. I had some query regarding embedding XSL .
    Can we embedd the XSL stylesheet in the XML document itself.
    I searched this forum and got some similar queries but the output isn't working. Can anyone put a working example.
    I have got the following XSL stylesheet:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <body>
    <table border="1" width="100%" cellpadding="1">
    <tr bgcolor="#FFFF99">
    <th style="font-family:arial unicode ms;font-size:100%" align="center">Serial number </th>
    <th style="font-family:arial unicode ms;font-size:100%" align="center">Site number </th>
    </tr>
    <xsl:for-each select="Master/RECORD">
    <xsl:if test="SR_NO &gt; 0">
    <tr>
    <td style="font-family:arial unicode ms;font-size:80%" align="right"><xsl:value-of select="SR_NO"/></td>
    <td style="font-family:arial unicode ms;font-size:80%" align="right"><xsl:value-of select="ACR_SNO"/></td>
    </tr>
    </xsl:if>
    </xsl:for-each>
    </table>
    </body>
    </xsl:template>
    </xsl:stylesheet>
    The XML document is as below:
    <?xml version="1.0" encoding="utf-8"?>
    <?xml-stylesheet type="text/xsl" href="archivingmaster.xsl"?>
    <Master>
    <RECORD>
    <SR_NO>1</SR_NO>
    <ACRSNO>1</ACR_SNO>
    </RECORD>
    <RECORD>
    <SR_NO>2</SR_NO>
    <ACRSNO>2</ACR_SNO>
    </RECORD>
    </Master>
    Thanks in advance
    Ameya.

    I have already gone through that link and searched for this on the net. But it doesn't seem to work on my Mozilla Firefox browser.
    Can anybody put a working example if possible.
    Thanks
    Ameya.

  • Error XSQL-017 Running XML Document Demo

    Environment: Oracle 8.1.6 (NT 4.0)
    XSQL 1.0.4.1
    JDK 1.1.8
    While running the XML Document Demo, I enter the Author, Title, Stylesheet and XML Document fields, and click the "Validate and Insert" button. Then I get the messages shown below. Any ideas? Thanks.
    ===== ===== Start Of Messages ===== =====
    XSQL-017: Unexpected Error Occurred
    java.lang.NoClassDefFoundError: java/sql/Clob
    at
    oracle.jdbc.driver.OracleStatement.get_clob_value(OracleStatement.java:4447)
    at
    oracle.jdbc.driver.OracleStatement.getCLOBValue(OracleStatement.java:3025)
    at
    oracle.jdbc.driver.OracleCallableStatement.getCLOB(OracleCallableStatement.java:439)
    at
    oracle.xml.sql.dml.OracleXMLSave.createTempCLOBFromString(Compiled
    Code)
    at
    oracle.xml.sql.dml.OracleXMLSave.getLobVal(OracleXMLSave.java:765)
    at
    oracle.xml.sql.dml.OracleXMLSave.getObjectVal(OracleXMLSave.java:690)
    at oracle.xml.sql.dml.OracleXMLSave.getStructVal(Compiled
    Code)
    at
    oracle.xml.sql.dml.OracleXMLSave.setBindValue(OracleXMLSave.java:1206)
    at oracle.xml.sql.dml.OracleXMLSave.saveNodeVal(Compiled
    Code)
    at
    oracle.xml.sql.dml.OracleXMLSave.saveNode(OracleXMLSave.java:2146)
    at oracle.xml.sql.dml.OracleXMLSave.saveNodes(Compiled
    Code)
    at
    oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:1954)
    at
    oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1060)
    at
    oracle.xml.xsql.actions.XSQLInsertRequestHandler.handleAction(XSQLInsertRequestHandler.java:126)
    at oracle.xml.xsql.XSQLDocHandler.getDocument(Compiled
    Code)
    at oracle.xml.xsql.XSQLPageProcessor.process(Compiled Code)
    at oracle.xml.xsql.XSQLServlet.doGet(XSQLServlet.java:60)
    at oracle.xml.xsql.XSQLServlet.doPost(XSQLServlet.java:81)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at oracle.lite.web.JupServlet.service(JupServlet.java:186)
    at oracle.lite.web.MimeServletHandler.handle(Compiled Code)
    at oracle.lite.web.JupApplication.service(Compiled Code)
    at oracle.lite.web.JupHandler.handle(Compiled Code)
    at oracle.lite.web.HTTPServer.process(Compiled Code)
    at oracle.lite.web.HTTPServer.handleRequest(Compiled Code)
    at oracle.lite.web.JupServer.handle(Compiled Code)
    at oracle.lite.web.SocketListener.process(Compiled Code)
    at oracle.lite.web.SocketListener$ReqHandler.run(Compiled
    Code)
    ===== ===== End Of Messages ===== =====
    null

    Using JDK 1.1.8 you must use the JDBC 1.x driver in classes111.zip and the companion version of the XML SQL Utility xsu111.jar.
    You'll need to download these from OTN from http://otn.oracle.com/tech/xml and then replace them in your classpath for the classes12.zip and xsu12.jar that you're using.

  • XML document TO stylesheet

    Hi,
    Here is my question. I have a XML document. I just want to
    convert it into Excel. Do you have any tools for that. If not is
    there any method to convert that.
    Thanks in advance.
    Chan...
    null

    Jimson K John (guest) wrote:
    : Hello,
    : : An XSL processor is packaged with the oracle xml parser v2
    : : (see oraxsl). You can run this as a command line utility ...
    : ^^^^^^
    : Can you pls provide the URI for oraxsl. I could not locate
    it
    : in the documentation set.
    : Thanks & Regards,
    : Jimson
    : Oracle XML Team wrote:
    : : I don't know of any such tools, but then I am not much of
    : an
    : : Excel user. If you fail finding the tool you are looking
    for,
    : : consider writing a XSL stylesheet to basically flaten the
    XML
    : : document into space, or tab delimited data columns, e.g.:
    : : xml doc:
    : : <spreadsheet>
    : : <row>
    : : <col1>john</col1>
    : : <col2>smith</col2>
    : : </row>
    : : <row>
    : : <col1>jim</col1>
    : : <col2>hawk</col2>
    : : </row>
    : : </spreadsheet>
    : : resulting text document:
    : : john smith
    : : jim hawk
    : : This I am pretty sure you can import into Excel.
    : : ps.: An XSL processor is packaged with the oracle xml
    parser
    : v2
    : : (see oraxsl). You can run this as a command line utility
    : which
    : : takes as arguments an XSL stylesheet and your XML doc. For
    : more
    : : info on XSL look at www.w3c.org.
    : : Chan (guest) wrote:
    : : : Hi,
    : : : Here is my question. I have a XML document. I just want
    to
    : : : convert it into Excel. Do you have any tools for that. If
    : not
    : : is
    : : : there any method to convert that.
    : : : Thanks in advance.
    : : : Chan...
    : : Oracle Technology Network
    : : http://technet.oracle.com
    There is not a URI to its docs. You can find it and the
    associated readme.html in the /bin directory after installing
    2.0.2.4.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Error applying XSL stylesheet to XML

    Hi,
    after installed SPS 21 into portal we are facing an issue:
    A contentadministrator wants to publish a new newsfact in portal, but get the following error message:
    Error applying XSL stylesheet to XML:
    com.sapportals.wcm.WcmException: com.sap.engine.lib.xml.util.NestedException: Variable '$system_config_activateClipboard' has not been bound to a value
         at com.sapportals.wcm.service.pipeline.Pipeline.handle(Pipeline.java:284)
    Hope that somebody can give me some help.
    thanks a lot in advance.
    Regards,
    Edwin

    Hi Lorcan,
    You help solved our issue, thanks a lot.
    After generate the existing xml project with the Forms builder in the Content Management,
    the contentadministratoris able to produce a new newsfact without errors
    Regards, edwin
    Posts: 123
    Registered: 11/29/04
    Forum Points: 346 
    Solved problem (10)
    Very helpful answer (6)
    Helpful answer (2)
       Re: Error applying XSL stylesheet to XML  
    Posted: Apr 19, 2010 11:13 AM    in response to: Edwin Theuns           Reply 
    Hi Edwin,
    You need to recompile the xml forms project and that should resolve the issue. Unfortunately there is no alternative solution in such a scenario.
    Regards,
    Lorcan.

  • Use 1 stylesheet to translate 2 xml documents(raw data)into one  result xml

    I have one java application which can generate two xml documents (raw data), now i want to have one result xml which contains contents of these two xml documents(raw data) by using one stylesheet. is it possible?
    how to match template in the stylesheet?
    how to let the stylesheet know that it should read second raw xml?

    Yes it is possible.
    You didn't say whether you want to do this by invoking the transformation from a Java program, or with a stand-alone transformer, and which one.
    I've done an application where I had a main XML file and a secondary XML file. I invoked the transformation from Java, and passed a parameter to the stylesteet. It winds up looking like a variable ($parm for example).
    Here is the declaration of the param in the stylesheet.
    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="list" />Next, I use the document function to read the file and produce a result tree (like a DOM object, in a sense).
    <xsl:variable name="phonemes"
                  select="document($list)" />Then, you can use code like the following to look for content in the secondary file:
    <xsl:if test="$phonemes/phonemes/allsounds[phoneme=$sound]" >This was complex, but it works.
    Another approach would be to have a small XML file with the names of the
    two XML files you want to process. You could do a for-each to process each of the tags in this little file, use the document function to read in the file and copy th eoutput to where you need it.
    So, in that case, you would be processsing 3 files rather than 2. If you are invoking from Java, the third file could be coded in a String rather than having to physically write it out.
    You've got a few ideas to consider.
    Dave Patterson

  • XML forms error: Error applying XSL stylesheet to XML

    hi,
    I created XML forms for news and 2 weeks ago everything was working right, but today when i try to see a preview of the project i get this error:
    XML - Forms 
    <b>Error applying XSL stylesheet to XML</b>
    com.sapportals.wcm.WcmException: com.sap.engine.lib.xml.util.NestedException: Variable '$Sap' has not been bound to a value
    at com.sapportals.wcm.service.pipeline.Pipeline.handle(Pipeline.java:284)
    at com.sapportals.wcm.service.pipeline.XSLTPipeline.handle(XSLTPipeline.java:118)
    at com.sapportals.wcm.service.xmlforms.transformation.Transformer.pipeIt(Transformer.java:133)
    at com.sapportals.wcm.service.xmlforms.transformation.Transformer.transform(Transformer.java:105)
    at com.sapportals.wcm.service.xmlforms.transformation.Transformer.transform(Transformer.java:77)
    at com.sapportals.wcm.service.xmlforms.transformation.HtmlGenerator.getHtmlStream(HtmlGenerator.java:122)
    at com.sapportals.wcm.service.xmlforms.transformation.Transformation.render(Transformation.java:391)
    I really don't know where this come from is there somebody that can help me?
    i tried to change the paths of the project cause i also got this:
    <b>java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key xmsg_project_not_exist</b>
    at java.util.ResourceBundle.getObject(ResourceBundle.java:326)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:323)
    at java.util.ResourceBundle.getString...
    Hope that somebody can give me some help. Please it is urgent we have to deploy the site this week.
    thanks a lot in advance.
    Regards,
    MJ

    Hi All,
    Anybody could find the cause for this?
    I'm also facing the same problem now when I try to see the preview for Edit Form. It's working fine with RederList Form. Earlier everything was fine. If somebody has got the solution for this, pls help me out. This is very urgent. Thankyou very much in advance.
    Thanks & BR,
    Ram Marni.
    [email protected]

  • Parse and output XML document while preserving attribute order

    QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
    The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
    Example: The following element
    <work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
    </work_item_type>is output as:
    <work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
    </work_item_type>As you may notice, there is no difference in these besides order of the attributes!
    I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
    Please, someone help me out with this! I have a feeling the solution is simple
    The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
    Code:
    private void OutputFile(String DEST_filename, String style_filename){
         //StreamSource stylesheet = new StreamSource(style_filename);
         try{
              File dest_file = new File(DEST_filename);
              if(!dest_file.exists())
                  dest_file.createNewFile();
              TransformerFactory tranFactory = TransformerFactory.newInstance();
              Transformer aTransformer = tranFactory.newTransformer();
              aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
              Source src = new DOMSource("source.xml");
              Result dest = new StreamResult(dest_file);
              aTransformer.transform(src, dest);
              System.out.println("Finished");
         catch(Exception e){
              System.err.print(e);
              System.exit(-1);
        }

    You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
    If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
    Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf.

  • Is there a way to modify the style sheet so that it transforms an XML document with empty tags as tag / ?

    I have extracted some code from codeproject to
    reindent an XML document. Does anyone know how I can modify the stylesheet to make it so that the transform of an XML file will result in empty tags showing up as <tag /> instead of <tag></tag>?
    // http://www.codeproject.com/Articles/43309/How-to-create-a-simple-XML-file-using-MSXML-in-C
    MSXML2::IXMLDOMDocumentPtr FormatDOMDocument(MSXML2::IXMLDOMDocumentPtr pDoc)
    LPCSTR const static szStyleSheet =
    R"!(<?xml version="1.0" encoding="utf-8"?>)!"
    R"!(<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">)!"
    R"!( <xsl:output method="xml" indent="yes"/>)!"
    R"!( <xsl:template match="@* | node()">)!"
    R"!( <xsl:copy>)!"
    R"!( <xsl:apply-templates select="@* | node()"/>)!"
    R"!( </xsl:copy>)!"
    R"!( </xsl:template>)!"
    R"!(</xsl:stylesheet>)!";
    MSXML2::IXMLDOMDocumentPtr pXmlStyleSheet;
    pXmlStyleSheet.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    pXmlStyleSheet->loadXML(szStyleSheet);
    MSXML2::IXMLDOMDocumentPtr pXmlFormattedDoc;
    pXmlFormattedDoc.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    CComPtr<IDispatch> pDispatch;
    HRESULT hr = pXmlFormattedDoc->QueryInterface(IID_IDispatch, (void**)&pDispatch);
    if (SUCCEEDED(hr))
    _variant_t vtOutObject;
    vtOutObject.vt = VT_DISPATCH;
    vtOutObject.pdispVal = pDispatch;
    vtOutObject.pdispVal->AddRef();
    hr = pDoc->transformNodeToObject(pXmlStyleSheet, vtOutObject);
    //By default it is writing the encoding = UTF-16. Let us change the encoding to UTF-8
    // <?xml version="1.0" encoding="UTF-8"?>
    MSXML2::IXMLDOMNodePtr pXMLFirstChild = pXmlFormattedDoc->GetfirstChild();
    // A map of the a attributes (vesrsion, encoding) values (1.0, UTF-8) pair
    MSXML2::IXMLDOMNamedNodeMapPtr pXMLAttributeMap = pXMLFirstChild->Getattributes();
    MSXML2::IXMLDOMNodePtr pXMLEncodNode = pXMLAttributeMap->getNamedItem(_T("encoding"));
    pXMLEncodNode->PutnodeValue(_T("UTF-8")); //encoding = UTF-8
    return pXmlFormattedDoc;
    Or, if there is some other method for reindenting a MSXML2::IXMLDOMDocumentPtr object where I can specify how I want empty tags to be stored, that would be great too.  However, I don't want it to lose its status of an MSXML2::IXMLDOMDocumentPtr object.
     I.e. I would like to still perform operations on the result as if it was still an MSXML2::IXMLDOMDocumentPtr object.
    Thanks,
    A
    Adrian

    If anyone is interested, I got an answer on StackOverflow
    here.
    Adrian

  • Xml document converting to pdf

    Hi,
    I have a question regarding the convertion of xml document to pdf document.
    Below is the scenario.
    I have an xml document stored in the table in a CLOB format. I would like to convert the xml document stored in a table to pdf document and display in a Web browser.
    I have written the stylesheet to convert the xml document to the xsl fo(XSL Formatting object xml) type document. I need to apply FOP Processor to convert into pdf document.
    How do i do that in PL/ SQL ?
    Any thoughts ??

    1. Generate a XSL-FO document by applying an XSLT to the XML document in the database.
    2. Convert the XSL-FO document to a PDF document.

  • Multiple namespaces in an XML document

    I have an XML document that I am trying to use within a data flow (XML Source)--the problem is that I keep getting an error message stating that the XML document has multiple namespaces and therefore, SSIS will not create the XSD for me.  If I take out the second namespace, I am able to successfully get the task to execute, but this XML is created with 2 namespaces and there is no way to get around this (I cannot get the report server to change these parameters)--my question is: does anyone know of a way to get SSIS to handle multiple namespaces so that I can process this XML document and extract the necessary data elements from it.
    Any assistance would be greatly appreciated.
    Thank you!!!!

    I am replying too much late..........thinking might be useful for someone !!!!
    SSIS does not handle multiple namespaces in the XML source file. You can find examples where you see the format
    <Namespace:Element>.
    The first step to avoid multiple namespaces is to transform your source file to a format that doesn’t refer to the namespaces.
    SSIS has an XML task that can do the transformation. Add the XML task to an SSIS Control Flow and edit it.
    Change the OperationType property value to XSLT, the SourceType to File connection and the Source to your source file that has the problem.
    Set the SaveOperationResult property to True.
    Expand the OperationResult branch and Set DestinationType to File Connection and the Destination to a new XML file.
    Add the following to a new file and save it with an xslt file extension.
    <?xml version="1.0" encoding="utf-8" ?> 
    <xsl:stylesheet version="1.0"         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
      <xsl:output method="xml" indent="no" /> 
      <xsl:template match="/|comment()|processing-instruction()"> 
        <xsl:copy> 
          <xsl:apply-templates /> 
        </xsl:copy> 
      </xsl:template> 
      <xsl:template match="*"> 
        <xsl:element name="{local-name()}"> 
          <xsl:apply-templates select="@*|node()" /> 
        </xsl:element> 
      </xsl:template> 
      <xsl:template match="@*"> 
        <xsl:attribute name="{local-name()}"> 
          <xsl:value-of select="." /> 
        </xsl:attribute> 
      </xsl:template> 
    </xsl:stylesheet> 
    Back in the XML task, set the SecondOperandType to File connection and the Second Operand to your new XSLT file.
    When you run the XML task, it will take your original file and apply the transformation rules defined in the XSLT file. The results will be saved in your new XML file.
    This task only needs to be run once for the original XML file. When you look at the new file, you’ll see the same data as in the original, but without namespace references.
    Now you can return to your data flow and alter the XML Source to reference the new XML file.
    Click on the Generate XSD and you should be able to avoid your error.
    When you click on the Columns tab in your XML Source, you will probably see a warning. This is because the data types may not be fully defined (for example there’s no mention of string lengths). This shouldn’t be a problem as long as the default data type
    (255-character Unicode string) meets your needs.
    =================life is beatiful..so !!===========
           Rahul Vairagi
    =================================== Rahul Vairagi =================================== My Blogs: www.sqlserver2005forum.blogspot.com www.knwhub.blogspot.com

  • XSQL: How to embed the XML document(s) instead of posting?

    Dear all.
    I'm trying to use XSQL for a self-contained database schema setup. This setup should be able to handle DML (INSERT/UPDATE/DELETE), PL/SQL calls etc and I thought XSQL looks perfect for the job. As such, I wouldn't be using XSQL as a publishing framework but as kind of an ETL tool. The only output I would be interested in would be the xsql-status in order to check that the number of rows processed matches my expectations. I would prefer XSQL to run entirely within the database and not depend on any servlet container.
    However, it seems that XSQL's only way of obtaining the canonical XML (ROWSET/ROW) that is used by xsql:insert-request/xsql:update-request/xsql:delete-request is through HTTP POST/GET. It doesn't seem that it's possible to embed the XML directly in the page, nor does it seem possible to handle more than one XML.
    I'm trying to achieve something like this:
    <?xml version="1.0"?>
    <page connection="scott" xmlns:xsql="urn:oracle-xsq">
    <xsql:insert-request table="DEPT">
    <ROWSET>
    <ROW>
    <DEPTNO>-10</DEPTNO>
    <DNAME>NEW DEPT 1</DNAME>
    <LOC>COPENHAGEN</LOC>
    </ROW>
    <ROW>
    <DEPTNO>-20</DEPTNO>
    <DNAME>NEW DEPT 2</DNAME>
    <LOC>LONDON</LOC>
    </ROW>
    </ROWSET>
    </xsql:insert-request>
    <xsql:insert-request table="EMP">
    <ROWSET>
    <ROW>
    <EMPNO>-10</EMPNO>
    <ENAME>NEW EMP 1</ENAME>
    </ROW>
    <ROW>
    <EMPNO>-20</EMPNO>
    <ENAME>NEW EMP 2</ENAME>
    </ROW>
    </ROWSET>
    </xsql:insert-request>
    </page>
    or perhaps
    <?xml version="1.0"?>
    <page connection="scott" xmlns:xsql="urn:oracle-xsq">
    <request>
    <parameters>
    <dept>
    <ROWSET>
    <ROW>
    <DEPTNO>-10</DEPTNO>
    <DNAME>NEW DEPT 1</DNAME>
    <LOC>COPENHAGEN</LOC>
    </ROW>
    <ROW>
    <DEPTNO>-20</DEPTNO>
    <DNAME>NEW DEPT 2</DNAME>
    <LOC>LONDON</LOC>
    </ROW>
    </ROWSET>
    </dept>
    </parameters>
    </request>
    <xsql:insert-request table="DEPT" param="dept"/>
    <xsql:insert-request table="EMP" param="emp"/>
    </page>
    I need both INSERT/UPDATE/DELETE so xsql:insert-param isn't enough, would also need an xsql:update-param and xsql:delete-param.
    A way of referring to the canonical XML through an URI or XPath expression (referring to a registered XML document in the database) would also be cool.
    Perhaps implementing custom action handlers would work but not sure whether they'll be able to refer to any child XML elements within them? Furthermore, the syntax for these would also be slightly inconvenient:
    <xsql:action handler=com.ellebaek-consulting.xsql.InsertActionHandler" table="DEPT">
    My alternative would be to re-implement an extended version of XSQL (XSQLX :-)?) but I'm trying to avoid that.
    Any pointers and ideas are very much appreciated.
    Thanks in advance.
    Best regards
    Finn Ellebaek Nielsen

    Hi.
    Thanks for your reply but the article only talks about how to query data with XSQL and I need to INSERT/UPDATE/DELETE data embedded in XSQL pages into the database so I'm afraid that the article doesn't apply.
    Cheers
    Finn

  • Problem displaying arabic text in xml document

    Hi ..
    I have an xml type coloum where i store an xml document that contains some arabic texts with UTF-8 encoding, m using an xsl file to transform the xml and display it in an html page.
    At the database level when i select the xml col to dispaly the document, arabic texts are displayed correctly (DB is set to 1256), however when trying to display the text on html it gives me junk values. XSL sheet's encoding is set to windows-1256. M using Jdeveloper 1012 and BC4J frame work in my application.
    How do i solve this problem.?
    P.S.it wud b great if u support ur answer with examples .
    Regards

    You have to do it yourself -  I don't have a ready solution. Just look into documentation how StyleSheets are used and see what properties work best for you:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/StyleSheet.html
    Also, with embedded fonts you need to play with TextFormat settings and AntiAliasType
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/AntiAliasType.html
    In addition, on my machine even if I don't emebed fonts - Arabic works in Arial, TImes and others.

  • Updating a XML document with a processing instruction

    Greetings Guru's
    I have a fully functional XML database solution for our new system. The only thing left is for me to update a xml document in the database with a processing instruction to find the style sheet (JAXB strips it out when the XML must go back into the database).
    I can update complete nodes and node elements in the xml document using updateXML in a regular update statement, but I do not know how to add the following processing instruction to my documents.
    <?xml-stylesheet type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"?>
    [pre]
    Thanks in advance
    Derrick                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    SQL> var xmltext varchar2(4000)
    SQL> --
    SQL> begin
      2    :xmlText := '<Hello>World</Hello>';
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> drop table t
      2  /
    drop table t
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> create table t of xmltype
      2  /
    Table created.
    SQL> set long 10000
    SQL> --
    SQL> insert into t values (xmltype(:xmltext))
      2  /
    1 row created.
    SQL> select *
      2    from t
      3  /
    SYS_NC_ROWINFO$
    <Hello>World</Hello>
    SQL> update t set object_value = updateXML
      2                              (
      3                                object_value,
      4                                '/',
      5                                xmlconcat
      6                                (
      7                                  xmlpi("xml-stylesheet",'type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"'),
      8                                  object_value
      9                                )
    10                              )
    11  /
    1 row updated.
    SQL> select * from t
      2  /
    SYS_NC_ROWINFO$
    <?xml-stylesheet type="text/xsl" href="/RASWEB/JIT_REPORT.xslt"?>
    <Hello>World</Hello>
    SQL>

  • Loading a XML-document into tables

    Hi,
    I have created a view for the tables below.
    Table Book with columns:
    - Book_ID
    - Book_Name
    - Ref_To_Price ( -> is a reference to Table Price (Price_ID))
    Table Price with columns:
    - Price_ID
    - Price_DM
    SQL-Syntax:
    "create view Bookprice as select Book_ID, Book_Name, Ref_To_Price, Price_ID, Price_DM from Book, Price where Ref_To_Price = Price_ID; "
    XML-Document:
    <?xml version="1.0" encoding="UTF-16"?>
    <!DOCTYPE ANWENDUNGEN SYSTEM "file:/E:/book.dtd">
    <!-- ?xml-stylesheet href="book.xsl" type="text/xsl"? -->
    <ROOTDOC>
    <ROW>
    <BOOK_ID>66-77</BOOK_ID>
    <BOOK_NAME>JavaScript</BOOK_NAME>
    <REF_TO_PRICE>12</REF_TO_PRICE>
    <PRICE_ID>12</PRICE_ID>
    <PRICE_DM>25.50DM</PPRICE_DM>
    </ROW>
    </ROOTDOC>
    If I use the XML SQL Utility to insert the XML-Document, the following error message came up:
    " Exception in thread "main" oracle.xml.sql.OracleXMLSQLException: java.sql.SQLException: ORA-01776: cannot modify more than one base table through a join view "
    Can anyone help me, please ?
    null

    Hi,
    This is a classic join view problem, where u cannot update two tables in one shot. The main problem is that ur two tables are not normalized correctly. Why can't they be in just one table?
    OK, if that is not possible, then the best way out is to create a simple INSTEAD OF trigger on the view which will insert correclty,
    e.g.
    CREATE TRIGGER bookprice_tr INSTEAD OF INSERT ON Bookprice FOR EACH ROW
    BEGIN
    insert into Book values (:NEW.Book_id,
    :NEW.Book_name, :NEW.Ref_to_Price);
    insert into Price
    values(:NEW.Price_ID, :NEW.Price_DM);
    END;
    Hope this helps,
    Murali

Maybe you are looking for