XSLProcessor

I'm calling the processXSL method with XSLStylesheet and XMLDocument as args in order to transform a master XML doc into several XML docs that match the db structure of target views. I've done this successfully in pl/sql and using Steve Meunchs' JScript Microsoft.XMLDOM file. This time around its a Java Solution. The problem is, I'm not getting the transformation I expected. the out.print(System.out) DocumentFragment is my parsed XSL String.
i.e.
XML in Reader is :
<?xml version......
<EMPLIST>
<EMP>
<name>Patrick</name>
<age>27</age>
<address>1 First St</address>
<EMP>
</EMPLIST>
XSL in Reader is :
<xsl:stylesheet.....
<xsl:template match="//">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="EMPLIST">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="EMP">
<ROW>
<name><xsl:value-of select="name"/></name>
<age><xsl:value-of select="age"/></age>
</ROW>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()">
</xsl:template>
</xsl:stylesheet>
What I think I should get is:
out DocumentFragment :
<ROW>
<name>Patrick</name>
<age>27</age>
</ROW>
What I am getting is:
<xsl:stylesheet.....
<xsl:template match="//">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="EMPLIST">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="EMP">
<ROW>
<name><xsl:value-of select="name"/></name>
<age><xsl:value-of select="age"/></age>
</ROW>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()">
</xsl:template>
</xsl:stylesheet>
Am I incorrect in initial excpectation.
null

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by pbujold():
I'm calling the processXSL method with XSLStylesheet and XMLDocument as args in order to transform a master XML doc into several XML docs that match the db structure of target views. What I think I should get is:
out DocumentFragment :
<ROW>
<name>Patrick</name>
<age>27</age>
</ROW>
What I am getting is:
Am I incorrect in initial excpectation.
<HR></BLOCKQUOTE>
I think your expectation is correct but I am confused about what you are getting. Seems you should get an document fragment identical to the original xml not the xsl. At least this is the behaviour I am seeing. It works correctly if I send the output to the printwriter but not if I try to return a xmldoc fragment. Am I going to have to pipe the output to a reader and reparse to get the functionality I need or is there a bug fix for this?
null

Similar Messages

  • Memory leak using xslprocessor.valueof in 11.1.0.6.0 - 64bit ??

    My company has made the decision to do all of our internal inter-system communication using XML. Often we may need to transfer thousands of records from one system to another and due to this (and the 32K limit in prior versions) we're implementing it in 11g. Currently we have Oracle 11g Enterprise Edition Release 11.1.0.6.0 on 64 bit Linux.
    This is a completely network/memory setup - the XML data comes in using UTL_HTTP and is stored in a CLOB in memory and then converted to a DOMDocument variable and finally the relevant data is extracted using xslprocessor.valueof calls.
    While this is working fine for smaller datasets, I've discovered that repeated calls with very large documents cause the xslprocessor to run out of memory with the following message:
    ERROR at line 1:
    ORA-04030: out of process memory when trying to allocate 21256 bytes
    (qmxdContextEnc,)
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1010
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1036
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1044
    ORA-06512: at "SCOTT.UTL_INTERFACE_PKG", line 206
    ORA-06512: at line 28
    Elapsed: 00:03:32.45
    SQL>
    From further testing, it appears that the failure occurs after approximately 161,500 calls to xslprocessor.valueof however I'm sure this is dependent on the amount of server memory available (6 GB in my case).
    I expect that we will try and log a TAR on this, but my DBA is on vacation right now. Has anyone else tried calling the xslprocessor 200,000 times in a single session?
    I've tried to make my test code as simple as possible in order to track down the problem. This first block simply iterates through all of our offices asking for all of the employees at that office (there are 140 offices in the table).
    DECLARE
    CURSOR c_offices IS
    SELECT office_id
    FROM offices
    ORDER BY office_id;
    r_offices C_OFFICES%ROWTYPE;
    BEGIN
    OPEN c_offices;
    LOOP
    FETCH c_offices INTO r_offices;
    EXIT WHEN c_offices%NOTFOUND;
    utl_interface_pkg.get_employees(r_offices.office_id);
    END LOOP;
    CLOSE c_offices;
    END;
    Normally I'd be returning a collection of result data from this procedure, however I'm trying to make things as simple as possible and make sure I'm not causing the memory leak myself.
    Below is what makes the SOAP calls (using the widely circulated UTL_SOAP_API) to get our data and then extracts the relevant parts. Each office (call) should return between 200 and 1200 employee records.
    PROCEDURE get_employees (p_office_id IN VARCHAR2)
    l_request utl_soap_api.t_request;
    l_response utl_soap_api.t_response;
    l_data_clob CLOB;
    l_xml_namespace VARCHAR2(100) := 'xmlns="' || G_XMLNS_PREFIX || 'EMP.wsGetEmployees"';
    l_xml_doc xmldom.DOMDocument;
    l_node_list xmldom.DOMNodeList;
    l_node xmldom.DOMNode;
    parser xmlparser.Parser;
    l_emp_id NUMBER;
    l_emp_first_name VARCHAR2(100);
    l_emp_last_name VARCHAR2(100);
    BEGIN
    --Set our authentication information.
    utl_soap_api.set_proxy_authentication(p_username => G_AUTH_USER, p_password => G_AUTH_PASS);
    l_request := utl_soap_api.new_request(p_method => 'wsGetEmployees',
    p_namespace => l_xml_namespace);
    utl_soap_api.add_parameter(p_request => l_request,
    p_name => 'officeId',
    p_type => 'xsd:string',
    p_value => p_office_id);
    l_response := utl_soap_api.invoke(p_request => l_request,
    p_url => G_SOAP_URL,
    p_action => 'wsGetEmployees');
    dbms_lob.createtemporary(l_data_clob, cache=>FALSE);
    l_data_clob := utl_soap_api.get_return_clob_value(p_response => l_response,
    p_name => '*',
    p_namespace => l_xml_namespace);
    l_data_clob := DBMS_XMLGEN.CONVERT(l_data_clob, 1); --Storing in CLOB converted symbols (<">) into escaped values (&lt;, &qt;, &gt;).  We need to CONVERT them back.
    parser := xmlparser.newParser;
    xmlparser.parseClob(parser, l_data_clob);
    dbms_lob.freetemporary(l_data_clob);
    l_xml_doc := xmlparser.getDocument(parser);
    xmlparser.freeparser(parser);
    l_node_list := xslprocessor.selectNodes(xmldom.makeNode(l_xml_doc),'/employees/employee');
    FOR i_emp IN 0 .. (xmldom.getLength(l_node_list) - 1)
    LOOP
    l_node := xmldom.item(l_node_list, i_emp);
    l_emp_id := dbms_xslprocessor.valueOf(l_node, 'EMPLOYEEID');
    l_emp_first_name := dbms_xslprocessor.valueOf(l_node, 'FIRSTNAME');
    l_emp_last_name := dbms_xslprocessor.valueOf(l_node, 'LASTNAME');
    END LOOP;
    xmldom.freeDocument(l_xml_doc);
    END get_employees;
    All of this works just fine for smaller result sets, or fewer iterations (only the first two or three offices). Even up to the point of failure the data is being extracted correctly - it just eventually runs out of memory. Is there any way to free up the xslprocessor? I've even tried issuing DBMS_SESSION.FREE_UNUSED_USER_MEMORY but it makes no difference.

    Replying to both of you -
    Line 206 is the first call to xslprocessor.valueof:
    LINE TEXT
    206 l_emp_id := dbms_xslprocessor.valueOf(l_node, 'EMPLOYEEID');
    This is one function inside of a larger package (the UTL_INTERFACE_PKG). The package is just a grouping of these functions - one for each type of SOAP interface we're using. None of the others exhibited this problem, but then none of them return anywhere near this much data either.
    Here is the contents of V$TEMPORARY_LOBS immediately after the crash:
    SID CACHE_LOBS NOCACHE_LOBS ABSTRACT_LOBS
    132 0 0 0
    148 19 1 0
    SID 132 is a SYS session and SID 148 is mine.
    I've discovered with further testing that if I comment out all of the xslprocessor.valueof calls except for the first one the code will complete successfully. It executes the valueof call 99,463 times. If I then uncomment one of those additional calls, we double the number of executions to a theoretical 198,926 (which is greater than the 161,500 point where it usually crashes) and it runs out of memory again.

  • Using XSLProcessor in $ORACLE_HOME/lib/xmlparserv2.jar giving error in 10g

    Being absolutely frustrated with the generic FOTY 001 fault for any mapping failure I tried looking for different solution in web.I did actually find out some interesting soutions which is to use XSLProcessor class $ORACLE_HOME/lib/xmlparserv2.jar for parsing XML to a partcular XSLT file.It is giving me the actual error with the proper line number for simple XSLT files.But when I try to use one of the PIP transformations it is still throwing errors for aia and xpath functions.For aia:getServiceProperty it can find out the proper attribute from AIAConfigurationProperties.xml and for xref:lookupXREF it is giving class initializer error.I have added both the jar aia.jar and bpm-services.jar to do that.I have also tried to use oraxsl command line utility which comes with oracle xdk but no luck there also.
    In case anyone have been able to use them succesfully please help me out.
    Thanks
    Animesh Roy
    [email protected]

    you have to do the migration one time. Better now than in the future. One day a forms patch will say: Graphics is now obsolete, please migrate.
    To run a 6i graphics service on a 10g platform is (please believe me) the badest way to run your old graphics in the new world.
    its like toothache. you can eliminate them through eating 10 aspirins each day. But you know, that you have to go one day to the dentist...

  • XSQLRequest ,XSLProcessor , XSLStylesheet  Memory Problem

    Solaris & NT.
    Using the following processor combination to generate xmldocuments for an output stream, We are experiencing what appears to be a over caching of xml objects or objects not being garbage collected after use. (JProb on OC4J analysis)
    The processing works repeatedly - using a JVM with -mx=98MB after a processing some XML Objects accumulate until whatever memory resources you have allocated are exhausted. Currently processing 1200 documents will generate enough left over objects to bring the system to a halt and OutOfMemory Error.
    XSLStylesheet sheet = null;
    XSLProcessor xslt = new XSLProcessor();
    XSQLRequest req = new XSQLRequest(new URL(resMasterGetUrl));
    Hashtable params = new Hashtable(1);
    params.put("pageName",urlFilename.toString().toLowerCase());
    OutputStream out
    xslt.processXSL(new XSLStylesheet((XMLDocument)req.processToXML(params),new URL(resMasterGetBaseStyleUrl)),xmlParameters,out);
    out.close();
    req = null;
    xslt = null;
    sheet = null;
    params = null;
    COUNT MEMORY
    oracle.xml.parser.v2     DOMParser     1 ( 0.0%)     20 ( 0.0%)     
    oracle.xml.parser.v2     DTD     1 ( 0.0%)     68 ( 0.0%)     
    oracle.xml.parser.v2     DocumentBuilder     1 ( 0.0%)     92 ( 0.0%)     
    oracle.xml.parser.v2     Entry     910 ( 2.2%)     18,200 ( 0.2%)     
    oracle.xml.parser.v2     EqualExpr     5 ( 0.0%)     180 ( 0.0%)     
    oracle.xml.parser.v2     FastVector     57 ( 0.1%)     684 ( 0.0%)     
    oracle.xml.parser.v2     FilterExpr     53 ( 0.1%)     5,300 ( 0.1%)     
    oracle.xml.parser.v2     FromAttributes     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     FromChildren     20 ( 0.0%)     80 ( 0.0%)     
    oracle.xml.parser.v2     FromDescendantAttributes     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     FromDescendants     25 ( 0.1%)     300 ( 0.0%)     
    oracle.xml.parser.v2     FromSelf     5 ( 0.0%)     60 ( 0.0%)     
    oracle.xml.parser.v2     NSNameImpl     38 ( 0.1%)     760 ( 0.0%)     
    oracle.xml.parser.v2     NodeFactory     5 ( 0.0%)     20 ( 0.0%)     
    oracle.xml.parser.v2     NonValidatingParser     1 ( 0.0%)     116 ( 0.0%)     
    oracle.xml.parser.v2     ObjectPool     46 ( 0.1%)     552 ( 0.0%)     
    oracle.xml.parser.v2     ParserState     2 ( 0.0%)     72 ( 0.0%)     
    oracle.xml.parser.v2     PathExpr     53 ( 0.1%)     3,180 ( 0.0%)     
    oracle.xml.parser.v2     Predicate     1 ( 0.0%)     12 ( 0.0%)     
    oracle.xml.parser.v2     SAXAttrList     2 ( 0.0%)     72 ( 0.0%)     
    oracle.xml.parser.v2     Step     28 ( 0.1%)     1,904 ( 0.0%)     
    oracle.xml.parser.v2     StringHashtable     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     XMLAttr     230 ( 0.6%)     13,800 ( 0.2%)     
    oracle.xml.parser.v2     XMLAttrList     288 ( 0.7%)     3,456 ( 0.0%)     
    oracle.xml.parser.v2     XMLComment     44 ( 0.1%)     1,584 ( 0.0%)     
    oracle.xml.parser.v2     XMLDOMImplementation     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     XMLDeclPI     5 ( 0.0%)     260 ( 0.0%)     
    oracle.xml.parser.v2     XMLDocument     5 ( 0.0%)     500 ( 0.0%)     
    oracle.xml.parser.v2     XMLElement     308 ( 0.7%)     18,480 ( 0.2%)     
    oracle.xml.parser.v2     XMLEntity     6 ( 0.0%)     600 ( 0.0%)     
    oracle.xml.parser.v2     XMLError     6 ( 0.0%)     456 ( 0.0%)     
    oracle.xml.parser.v2     XMLNodeList     139 ( 0.3%)     1,668 ( 0.0%)     
    oracle.xml.parser.v2     XMLPI     1 ( 0.0%)     36 ( 0.0%)     
    oracle.xml.parser.v2     XMLReader     1 ( 0.0%)     92 ( 0.0%)     
    oracle.xml.parser.v2     XMLText     498 ( 1.2%)     17,928 ( 0.2%)     
    oracle.xml.parser.v2     XMLUTF8Reader     1 ( 0.0%)     108 ( 0.0%)     
    oracle.xml.parser.v2     XSLAttribute     5 ( 0.0%)     580 ( 0.0%)     
    oracle.xml.parser.v2     XSLCondition     5 ( 0.0%)     540 ( 0.0%)     
    oracle.xml.parser.v2     XSLExprValue     106 ( 0.3%)     4,664 ( 0.1%)     
    oracle.xml.parser.v2     XSLForEach     7 ( 0.0%)     756 ( 0.0%)     
    oracle.xml.parser.v2     XSLNode     2 ( 0.0%)     200 ( 0.0%)     
    oracle.xml.parser.v2     XSLNodeList     103 ( 0.2%)     1,236 ( 0.0%)     
    oracle.xml.parser.v2     XSLNodeSetExpr     2 ( 0.0%)     72 ( 0.0%)     
    oracle.xml.parser.v2     XSLOutput     1 ( 0.0%)     148 ( 0.0%)     
    oracle.xml.parser.v2     XSLResultElement     87 ( 0.2%)     10,092 ( 0.1%)     
    oracle.xml.parser.v2     XSLStylesheet     1 ( 0.0%)     172 ( 0.0%)     
    oracle.xml.parser.v2     XSLTemplate     3 ( 0.0%)     540 ( 0.0%)     
    oracle.xml.parser.v2     XSLValueOf     6 ( 0.0%)     648 ( 0.0%)     
    oracle.xml.parser.v2     XSLVariable     23 ( 0.1%)     2,852 ( 0.0%)     
    oracle.xml.xsql     XSQLConfigManager     1 ( 0.0%)     100 ( 0.0%)     
    oracle.xml.xsql     XSQLConnectionManagerFactoryImpl     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.xsql     XSQLLRUCache     2 ( 0.0%)     40 ( 0.0%)     
    oracle.xml.xsql     XSQLLRUCache$LRUNode     2 ( 0.0%)     40 ( 0.0%)     
    oracle.xml.xsql     XSQLNamedConnection     9 ( 0.0%)     180 ( 0.0%)     
    oracle.xml.xsql     XSQLPage     1 ( 0.0%)     12 ( 0.0%)     
    oracle.xml.xsql     XSQLPageManager     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.xsql     XSQLStylesheet     1 ( 0.0%)     20 ( 0.0%)     
    oracle.xml.xsql     XSQLStylesheetManager     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.xsql     XSQLStylesheetPool     1 ( 0.0%)     52 ( 0.0%)

    Also, please note what exact version of Oracle XDK for Java you are using. You can find this out (if you're not sure) by doing:
      System.out.println(DOMParser.getReleaseVersion());

  • Bug in method newXSLStylesheet of XSLProcessor (with nested imports)

    This is a repost of a problem I still can't solve:
    I am using the parser included with the 9.0.2.0.0D XDK.
    There appears to be an bug in the method newXSLStylesheet when
    using the setBaseURL method to import nested stylesheets. The
    root level imports are found and processed, but child
    imports are not.
    The error I receive is:
    Error while processing include XSL file
    (/apps/badges/bml/includes/userBadges.xsl)
    The code that I am using to reproduce this error is below:
    XSLProcessor processor = new XSLProcessor();
    processor.setBaseURL(baseUrl)); sheet = processor.newXSLStylesheet(url);
    I am confident that all urls are correct, because the following
    deprecated code works correctly with the same urls.
    Document xslDoc = ParserUtils.parseDocument(url, false);
    sheet = new XSLStylesheet((oracle.xml.parser.v2.XMLDocument
    xslDoc, url);
    My stylesheets look something as follows:
    root.xsl
    <xsl:import href="/include/styles/html/members.xsl"/>
    members.xsl
    <xsl:import href="/apps/badges/bml/includes/userBadges.xsl"/>
    The import in members.xsl fails with the error above!
    Any help in this matter would be appreciated.
    Thanks,
    Michael Bacaarella
    Bolt, Inc.

    Please supply the sample XSL files for us to reproduce the problem.
    Thanks.

  • Xmldom, xslprocessor package and namespace

    Hello,
    First as I'm a newbie, is there a complete documentation on XML DB for developpers in oracle.com ?
    Now my problem : I'm using in PLSQL xmldom, xslprocessor package with XPATH method to retrieve some information.
    I have tested the code and it works except when I have this in the XML file :
    xmlns="x-schema:OpenShipments.xdr"
    THIS IS THE CODE I USE ( xmldom, xslprocessor are encapsulated ):
    FUNCTION Extract_Info( p_file_path IN VARCHAR2 -- path of the file, sample : /u01/E11T/e11tappl/als/11.5.0/
    ,p_file_name IN VARCHAR2 -- name of the file : sample UPS_1.xml
              ,p_nodelist IN VARCHAR2 -- list of XML nodes such as '/OpenShipments/OpenShipment/Receiver'
              ,p_node_attribute IN VARCHAR2 -- the node or attribute to analyse, sample for UPS : AddressLine1
              ,p_position IN NUMBER -- if 1 the first value retrieved is given, if 2 the second, if 3 ....
              ,p_message OUT VARCHAR2 -- error message
              ,p_res OUT VARCHAR2 -- error code 'S' if success, 'E' if error
    RETURN VARCHAR2
    IS
    l_return VARCHAR2(2000);
    BEGIN
    DECLARE
    doc_out xmldom.domdocument;
    file_in VARCHAR2(150):=p_file_path || p_file_name; ---
    l_nodelist xmldom.domnodelist;
    l_node xmldom.domnode;
    l NUMBER;
    l_message VARCHAR2(2000):=NULL;
    l_res VARCHAR2(1):='S';
    BEGIN
    ALS_XML_PK.parse_document (file_in,doc_out);
    l_nodelist:=ALS_XML_PK.selected_nodes (doc_out,p_nodelist);
    l_node := xmldom.item (l_nodelist,p_position-1);
    l_return:=xslprocessor.valueof (l_node,p_node_attribute);
    -- to check number of nodes
    -- l:=xmldom.getlength(l_nodelist);
    --dbms_output.put_line('nombre de node ' || xmldom.getlength(l_nodelist));
    --dbms_output.put_line('valeur ' || NVL(l_return,'IS NULL !!'));
    EXCEPTION
    WHEN xmldom.index_size_err
    THEN
    l_res:='E';
         l_message:='INDEX SIZE error';
    --raise_application_error (-20120, 'INDEX SIZE error');
    WHEN xmldom.domstring_size_err
    THEN
    l_res:='E';
         l_message:='String SIZE error';
    --raise_application_error (-20120, 'String SIZE error');
    WHEN xmldom.hierarchy_request_err
    THEN
    l_res:='E';
         l_message:='Hierarchy request error';
    --raise_application_error (-20120,'Hierarchy request error');
    WHEN xmldom.wrong_document_err
    THEN
    l_res:='E';
         l_message:='Wrong doc error';
    --raise_application_error (-20120, 'Wrong doc error');
    WHEN xmldom.invalid_character_err
    THEN
    l_res:='E';
         l_message:='Invalid CHAR error';
    --raise_application_error (-20120, 'Invalid CHAR error');
    WHEN xmldom.no_data_allowed_err
    THEN
    l_res:='E';
         l_message:='Nod data allowed error';
    --raise_application_error (-20120,'Nod data allowed error');
    WHEN xmldom.no_modification_allowed_err
    THEN
    l_res:='E';
         l_message:='No MOD allowed error';
    --raise_application_error (-20120,'No MOD allowed error');
    WHEN xmldom.not_found_err
    THEN
    l_res:='E';
         l_message:='NOT FOUND error';
    --raise_application_error (-20120, 'NOT FOUND error');
    WHEN xmldom.not_supported_err
    THEN
    l_res:='E';
         l_message:='NOT supported error';
    --raise_application_error (-20120,'NOT supported error');
    WHEN xmldom.inuse_attribute_err
    THEN
    l_res:='E';
         l_message:='IN USE attr error';
    --raise_application_error (-20120, 'IN USE attr error');
    END;
    -- return value extracted
    RETURN l_return;
    END Extract_Info;
    ---> error is with namespace :
    ORA-20100: Error occurred while parsing: Permission denied
    Message was edited by:
    ROMEO_G

    SQL> set serveroutput on
    SQL> declare
      2    xmldoc1 xmltype := xmltype (
      3  '<OpenShipments>
      4    <OpenShipment ProcessStatus="TESTONS">
      5      <Receiver>
      6        <CompanyName>DUMMY</CompanyName>
      7        <ContactPerson>000000</ContactPerson>
      8        <AddressLine1>DUMM</AddressLine1>
      9        <AddressLine2>DUMDUM</AddressLine2>
    10        <AddressLine3/>
    11        <City>PROUT</City>
    12        <CountryCode>BE</CountryCode>
    13        <PostalCode>1111</PostalCode>
    14        <Residential>0</Residential>
    15        <CustomerIDNumber>0</CustomerIDNumber>
    16        <Phone>0</Phone>
    17        <TaxIDNumber>0</TaxIDNumber>
    18        <LocationID/>
    19        <UpsAccountNumber>0</UpsAccountNumber>
    20        <RecordOwner>0</RecordOwner>
    21      </Receiver>
    22      <Shipment>
    23        <ServiceLevel>1</ServiceLevel>
    24        <PackageType/>
    25        <NumberOfPackages>1</NumberOfPackages>
    26        <ShipmentActualWeight>1</ShipmentActualWeight>
    27        <DescriptionOfGoods/>
    28        <Reference1/>
    29        <Reference2/>
    30        <DocumentOnly>1</DocumentOnly>
    31        <GoodsNotInFreeCirculation>1</GoodsNotInFreeCirculation>
    32        <BillingOption>1</BillingOption>
    33        <DeclareValue>
    34          <Amount>1</Amount>
    35        </DeclareValue>
    36      </Shipment>
    37    </OpenShipment>
    38  </OpenShipments>');
    39
    40    xmldoc2 xmltype := xmltype (
    41  '<OpenShipments xmlns="x-schema:OpenShipments.xdr">
    42    <OpenShipment ProcessStatus="TESTONS">
    43      <Receiver>
    44        <CompanyName>DUMMY</CompanyName>
    45        <ContactPerson>000000</ContactPerson>
    46        <AddressLine1>DUMM</AddressLine1>
    47        <AddressLine2>DUMDUM</AddressLine2>
    48        <AddressLine3/>
    49        <City>PROUT</City>
    50        <CountryCode>BE</CountryCode>
    51        <PostalCode>1111</PostalCode>
    52        <Residential>0</Residential>
    53        <CustomerIDNumber>0</CustomerIDNumber>
    54        <Phone>0</Phone>
    55        <TaxIDNumber>0</TaxIDNumber>
    56        <LocationID/>
    57        <UpsAccountNumber>0</UpsAccountNumber>
    58        <RecordOwner>0</RecordOwner>
    59      </Receiver>
    60      <Shipment>
    61        <ServiceLevel>1</ServiceLevel>
    62        <PackageType/>
    63        <NumberOfPackages>1</NumberOfPackages>
    64        <ShipmentActualWeight>1</ShipmentActualWeight>
    65        <DescriptionOfGoods/>
    66        <Reference1/>
    67        <Reference2/>
    68        <DocumentOnly>1</DocumentOnly>
    69        <GoodsNotInFreeCirculation>1</GoodsNotInFreeCirculation>
    70        <BillingOption>1</BillingOption>
    71        <DeclareValue>
    72          <Amount>1</Amount>
    73        </DeclareValue>
    74      </Shipment>
    75    </OpenShipment>
    76  </OpenShipments>');
    77
    78    DOC DBMS_XMLDOM.DOMDOCUMENT;
    79    NL DBMS_XMLDOM.DOMNODELIST;
    80  begin
    81
    82    DOC := DBMS_XMLDOM.newDOMDocument(xmldoc1);
    83    NL  := DBMS_XSLPROCESSOR.selectNodes(dbms_xmldom.makeNode(DOC),'/OpenShipments/OpenShipment/Receiver');
    84    dbms_output.put_line('NodeList.length() = ' || DBMS_XMLDOM.GETLENGTH(NL));
    85
    86    DOC := DBMS_XMLDOM.newDOMDocument(xmldoc2);
    87    NL  := DBMS_XSLPROCESSOR.selectNodes(dbms_xmldom.makeNode(DOC),'/OpenShipments/OpenShipment/Receiver');
    88    dbms_output.put_line('NodeList.length() = ' || DBMS_XMLDOM.GETLENGTH(NL));
    89
    90    NL  := DBMS_XSLPROCESSOR.selectNodes(dbms_xmldom.makeNode(DOC),'/OpenShipments/OpenShipment/Receiver','xmlns="x-schema:OpenShipments.
    xdr"');
    91    dbms_output.put_line('NodeList.length() = ' || DBMS_XMLDOM.GETLENGTH(NL));
    92
    93  end;
    94
    95  /
    NodeList.length() = 1
    NodeList.length() = 0
    NodeList.length() = 1
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.12
    SQL>The doc does not show that SELECTNODES takes a third argument, which is the namespace prefix mappings for the document. However a describe of the package does show that there is a third agument. A doc bug has been filed.

  • Problem with xslprocessor.newStylesheet

    I try to import a XML file with a XSL file to treat the out
    result. The out result is like insert into toto values
    (...,...,....). In internet explorer the result is good with my
    XML and XSL file.
    When i execute the function xslprocessor.newStylesheet i get
    this error message:
    ORA-20100: Error occurred while processing: XSL-1009:
    Attribute 'xsl:version
    not found in 'xsl:stylesheet'.
    ORA-06512: ` "SYS.XSLPROCESSOR", ligne 22
    ORA-06512: ` "SYS.XSLPROCESSOR", ligne 346
    ORA-06512: ` ligne 70
    I tried to write xsl:version='1.0' in the tag 'xsl:stylesheet'
    in xsl file and i get the same errors.
    I am a newbies in Oracle with XML, so all help we'll be wellcome.
    PS: I have read a lot of faq. So i tried to see where i could by
    the Muench's Book, but i am in france and this book will be in
    sold during the middle of the next month.

    XDB Issues (including use of the DBMS_XML.. packages) are best discussed here
    XML DB
    You probably need to use htttpuritype to get the Stylesheet. In general this is conidered bad practive due to the dangers of spoofing etc.

  • Xslprocessor problem

    Any idea why I get an 'End of communication channel' error after using xslprocessor ?
    My session gets kill after using the xslprocessor..
    I am using javaparserv2.jar 9.2.0.3

    Hi there :)
    I have the same problem using the DBMS_XSLPROCESSOR package. The XSLPROCESSOR package (included in the XDK, not as part of Oracle 9.2), however, seems to work but has given me problems with inserting extra unnecessary namespaces.
    The problem seems to be happening when the document is NOT in the default namespace. I've run DBMS_XSLPROCESSOR methods on XML without a special namespace, and it has worked. All of the XML for the application I'm working on uses a particular namespace, however, so this ultimately won't work for me.
    Sorry I can't offer any more than this.
    Constantine

  • Xslprocessor - performance problem

    Here we are using XDK for PL/SQL to process XML documents. we are facing a BIG perforance problem........
    When applying a stylesheet (xsl) to an XMLDOMdocument using xslprocessor.ProcessXSL
    function ,it is taking 23 minutes to process 938Kb file.
    Is there any way to improve the peformance ? do i need to change anyof the XDK/init.ora parameters for this ?
    null

    What Application Server you are using?
    I have samilar problem with you, I'm using Jrun Application Server.
    When using JSP only, the response time is less than 1 second but If using XML+XSL using XDK, it take about 5 second to display.
    I have added timestamp to each process including generate data from DB, generate XML, parse XML,XSL and ProcessXSL. Each process take less than 50ms.
    So I think the delay is cause by the Application Server / Web Server instead.
    Did anyone know is there any problem of JRun using taglib plus XDK?

  • Problems wth XSLPROCESSOR

    Greetings,
    I am trying to develop a PLSQL function that, given the URL of a XML file, it returns a HTML file through a prepared XLS file
    So far, the test procedure to check if the function is working ends with a ORA-20103: Null input is not allowed error.
    Function is as follows:
         FUNCTION translate_XML(path_xml VARCHAR2, path_xsl VARCHAR2) RETURN CLOB IS
              v_return               CLOB;
              v_processor          SYS.XSLPROCESSOR.PROCESSOR;
              v_style               SYS.XSLPROCESSOR.STYLESHEET;
              v_xmldom               SYS.XMLDOM.DOMDOCUMENT;
              BEGIN
              v_xmldom := SYS.XMLPARSER.PARSE(path_xml);
              v_style := SYS.XSLPROCESSOR.NEWSTYLESHEET(path_xsl, NULL);
              v_processor := SYS.XSLPROCESSOR.NEWPROCESSOR;
              SYS.XSLPROCESSOR.PROCESSXSL(v_processor, v_style, v_xmldom, v_return);
              RETURN v_return;
              EXCEPTION
    when others then
    sys.xslprocessor.freeprocessor(v_processor);
    raise;
              END;
    could anyone point me in the right direction, please?

    First, try resetting the iPod.
    http://support.apple.com/kb/HT1320
    If that does not work, you should probably use the Restore button in iTunes to erase the iPod and initialize its software. Then sync everything back, videos and music.
    FYI - It's a 5th Gen iPod.

  • Name() not supported XSLProcessor class?

    Hi,
    XSLProcessor doesn't seems to support the node set function name(). Is this true? Or is there something wrong with my code segment below?
    <xsl:template match="*">
    <TD>
    <INPUT>
    <xsl:attribute name="NAME">
    <xsl:value-of select="name()"/>
    </xsl:attribute>
    <xsl:attribute name="VALUE">
    <xsl:value-of select="."/>
    </xsl:attribute>
    </INPUT>
    </TD>
    </xsl:template>
    Can someone please advise? Thanks a lot!!!

    Hi all,
    I found the answer already!!! The name() function is not supported in a previous version of the XSLProcessor class! Thanks for your time! Cheers... :)
    regards,
    Jerry

  • XSLProcessor.Process throws  oracle.xml.xpath.XPathException:

    I have a java application which is parsing an XMLDocument using XMLProcessor.process(xsl,doc);
    It works for many XML messages, and their related XSL transformers, but throws this error regarding a dayTimeDuration() function.
    I'm using XDK version 10g, Java release:xdk_linux_10.2.0.2.0_production
    Other transformations without this function work fine. What am I doing wrong?
    Any help is appreciated.
    The Error is:
    oracle.xml.xpath.XPathException: Parse Error in dayTimeDuration function.
    The XML is:
    <SPLIMCreatedUpdatedOrder Destination="RTS">
         <HeaderData>
              <TransactionCode>3001</TransactionCode>
         </HeaderData>
         <TaskData>
              <FieldOrderNumber>TEST00001</FieldOrderNumber>
              <OrderStatus>Unassigned</OrderStatus>
              <DivisionName>Oregon</DivisionName>
              <DistrictName>Albany District</DistrictName>
              <CustomerName>Kathy Foote</CustomerName>
              <CustomerAddress1>105 CORCORAN LN</CustomerAddress1>
              <CustomerAddress2>Apt 101</CustomerAddress2>
              <CustomerCityState>CENTRAL POINT, OR</CustomerCityState>
              <CustomerZipCode>97502</CustomerZipCode>
              <OrderType>CON</OrderType>
              <TaskNumber>0</TaskNumber>
              <TaskDuration>10</TaskDuration>
              <TaskPriority>3</TaskPriority>
              <TaskExternalPriority></TaskExternalPriority>
              <Longitude>-122.923269</Longitude>
              <Latitude>42.370841</Latitude>
              <EnrouteDateTime></EnrouteDateTime>
              <OnsiteDateTime></OnsiteDateTime>
              <CompletionDateTime></CompletionDateTime>
              <PrimaryOrderNumber></PrimaryOrderNumber>
              <DatabaseAction>U</DatabaseAction>
              <ServiceAreaName>Serviceman - OR - 11256</ServiceAreaName>
              <DivisionCode>OR</DivisionCode>
              <DistrictCode>11256</DistrictCode>
              <ServiceAreaCode>SVC01</ServiceAreaCode>
              <CompletionStatusCode>O</CompletionStatusCode>
              <TrackingStatusCode>U</TrackingStatusCode>
         </TaskData>
         <SchedulingData>
              <EarlyStartDateTime>2007-01-17T08:00:00</EarlyStartDateTime>
              <DueOnDateTime>2007-01-31T17:00:00</DueOnDateTime>
              <ApptStartDateTime></ApptStartDateTime>
              <ApptFinishDateTime></ApptFinishDateTime>
              <TimeZone></TimeZone>
         </SchedulingData>
         <AssignmentData>
              <PreferredCrewName></PreferredCrewName>
              <RequiredCrewName></RequiredCrewName>
              <PrimaryFunction>Service</PrimaryFunction>
              <SkillData></SkillData>
              <CapabilityData></CapabilityData>
         </AssignmentData>
    </SPLIMCreatedUpdatedOrder>
    The XSL is:
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xdt="http://www.w3.org/2003/05/xpath-datatypes" xmlns:eg="local" xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
         <xsl:template match="SPLIMCreatedUpdatedOrder">
              <SOAP-ENV:Envelope
                   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:ns2="http://mwm.splwg.com/webservices/packets/"
                   xmlns:ns1="http://mwm.splwg.com/webservices/"
                   xmlns:ns3="http://mwm.splwg.com/webservices/methods/">
              <xsl:variable name="databaseAction">
                   <xsl:value-of select="TaskData/DatabaseAction"/>
              </xsl:variable>
              <xsl:choose>
                   <xsl:when test="$databaseAction='A'">
                        <NEW_STOP>
                             <NEW_STOP_DATA>
                                  <PLAN_STOP>
                                       <IDENT>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </IDENT>
                                       <STATUS>
                                            <xsl:value-of select="TaskData/OrderStatus"/>
                                       </STATUS>
                                       <STARTED_DATE>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,1,4)"/>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,6,2)"/>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,9,2)"/>
                                       </STARTED_DATE>
                                       <STARTED_TIME>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,12,2)"/>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,15,2)"/>
                                       </STARTED_TIME>
                                       <COMPLETION_DATE>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,1,4)"/>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,6,2)"/>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,9,2)"/>
                                       </COMPLETION_DATE>
                                       <COMPLETION_TIME>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,12,2)"/>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,15,2)"/>
                                       </COMPLETION_TIME>
                                  </PLAN_STOP>
                                  <STOP>
                                       <IDENT>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </IDENT>
                                       <INITIAL_STATUS>FREE</INITIAL_STATUS>
                                       <JOB_DELAY>
                                            <xsl:value-of select="xs:int(TaskData/TaskDuration) * 60"/>
                                       </JOB_DELAY>
                                       <R_MUSTHAVE>
                                            <xsl:for-each select="AssignmentData">
                                                 <xsl:for-each select="SkillData">
                                                      <xsl:value-of select="."/>,</xsl:for-each>
                                            </xsl:for-each>
                                       </R_MUSTHAVE>
                                       <LATITUDE>
                                            <xsl:value-of select="TaskData/Latitude"/>
                                       </LATITUDE>
                                       <LONGTITUDE>
                                            <xsl:value-of select="TaskData/Latitude"/>
                                       </LONGTITUDE>
                                       <PRIMARY_STOP_ID>
                                            <xsl:value-of select="TaskData/PrimaryOrderNumber"/>
                                       </PRIMARY_STOP_ID>
                                       <STREET_NO>
                                            <xsl:value-of select="substring-before(TaskData/CustomerAddress1,' ')"/>
                                       </STREET_NO>
                                       <STREET>
                                            <xsl:value-of select="substring-after(TaskData/CustomerAddress1,' ')"/>
                                       </STREET>
                                       <CITY>
                                            <xsl:value-of select="substring-before(TaskData/CustomerCityState,',')"/>
                                       </CITY>
                                       <STATE>
                                            <xsl:value-of select="substring-after(TaskData/CustomerCityState,',')"/>
                                       </STATE>
                                       <POSTCODE>
                                            <xsl:value-of select="TaskData/CustomerZipCode"/>
                                       </POSTCODE>
                                  </STOP>
                                  <STOP_TW>
                                       <IDENT>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </IDENT>
                                       <STOP>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </STOP>
                                       <xsl:if test="string-length(SchedulingData/ApptStartDateTime) > 0">
                                            <xsl:variable name="apptDuration">
                                                 <xsl:value-of select="xs:dayTimeDuration(xs:dateTime(SchedulingData/ApptFinishDateTime)-xs:dateTime(SchedulingData/ApptStartDateTime))"/>
                                            </xsl:variable>
                                            <START_DATE>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,1,4)"/>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,6,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,9,2)"/>
                                            </START_DATE>
                                            <START_TIME>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,12,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,15,2)"/>
                                            </START_TIME>
                                            <xsl:variable name="iTotalHours">
                                                 <xsl:value-of select="xs:int(days-from-duration($apptDuration) * 24 + hours-from-duration($apptDuration))"/>
                                            </xsl:variable>
                                            <xsl:variable name="iMinutes">
                                                 <xsl:value-of select="xs:int(minutes-from-duration($apptDuration))"/>
                                            </xsl:variable>
                                            <DURATION>
                                                 <xsl:if test="not ($iTotalHours > 99)">0</xsl:if>
                                                 <xsl:if test="not ($iTotalHours > 9)">0</xsl:if>
                                                 <xsl:value-of select="xs:string($iTotalHours)"/>
                                                 <xsl:if test="not ($iMinutes > 60)">0</xsl:if>
                                                 <xsl:value-of select="xs:string($iMinutes) "/>
                                            </DURATION>
                                       </xsl:if>
                                       <!---->
                                       <xsl:if test="string-length(SchedulingData/ApptStartDateTime) = 0">
                                            <xsl:variable name="apptDuration">
                                                 <xsl:value-of select="xs:dayTimeDuration(xs:dateTime(SchedulingData/DueOnDateTime) - xs:dateTime(SchedulingData/EarlyStartDateTime))"/>
                                            </xsl:variable>
                                            <START_DATE>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,1,4)"/>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,6,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,9,2)"/>
                                            </START_DATE>
                                            <START_TIME>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,12,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,15,2)"/>
                                            </START_TIME>
                                            <xsl:variable name="iTotalHours">
                                                 <xsl:value-of select="xs:int(days-from-duration($apptDuration) * 24 + hours-from-duration($apptDuration))"/>
                                            </xsl:variable>
                                            <xsl:variable name="iMinutes">
                                                 <xsl:value-of select="xs:int(minutes-from-duration($apptDuration))"/>
                                            </xsl:variable>
                                            <DURATION>
                                                 <xsl:if test="not ($iTotalHours > 99)">0</xsl:if>
                                                 <xsl:if test="not ($iTotalHours > 9)">0</xsl:if>
                                                 <xsl:value-of select="xs:string($iTotalHours)"/>
                                                 <xsl:if test="not ($iMinutes > 60)">0</xsl:if>
                                                 <xsl:value-of select="xs:string($iMinutes) "/>
                                            </DURATION>
                                       </xsl:if>
                                  </STOP_TW>
                             </NEW_STOP_DATA>
                        </NEW_STOP>
                   </xsl:when>
                   <xsl:when test="$databaseAction='U'">
                        <UPDATE_STOP>
                             <UPDATE_STOP_DATA>
                                  <PLAN_STOP>
                                       <IDENT>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </IDENT>
                                       <STOP>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </STOP>
                                       <STATUS>
                                            <xsl:value-of select="TaskData/OrderStatus"/>
                                       </STATUS>
                                       <STARTED_DATE>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,1,4)"/>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,6,2)"/>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,9,2)"/>
                                       </STARTED_DATE>
                                       <STARTED_TIME>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,12,2)"/>
                                            <xsl:value-of select="substring(TaskData/OnsiteDateTime,15,2)"/>
                                       </STARTED_TIME>
                                       <COMPLETION_DATE>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,1,4)"/>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,6,2)"/>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,9,2)"/>
                                       </COMPLETION_DATE>
                                       <COMPLETION_TIME>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,12,2)"/>
                                            <xsl:value-of select="substring(TaskData/CompletionDateTime,15,2)"/>
                                       </COMPLETION_TIME>
                                  </PLAN_STOP>
                                  <STOP>
                                       <IDENT>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </IDENT>
                                       <INITIAL_STATUS>FREE</INITIAL_STATUS>
                                       <JOB_DELAY>
                                            <xsl:value-of select="xs:int(TaskData/TaskDuration) * 60"/>
                                       </JOB_DELAY>
                                       <R_MUSTHAVE>
                                            <xsl:for-each select="AssignmentData">
                                                 <xsl:for-each select="SkillData">
                                                      <xsl:value-of select="."/>,</xsl:for-each>
                                            </xsl:for-each>
                                       </R_MUSTHAVE>
                                       <LATITUDE>
                                            <xsl:value-of select="TaskData/Latitude"/>
                                       </LATITUDE>
                                       <LONGTITUDE>
                                            <xsl:value-of select="TaskData/Latitude"/>
                                       </LONGTITUDE>
                                       <PRIMARY_STOP_ID>
                                            <xsl:value-of select="TaskData/PrimaryOrderNumber"/>
                                       </PRIMARY_STOP_ID>
                                       <STREET_NO>
                                            <xsl:value-of select="substring-before(TaskData/CustomerAddress1,' ')"/>
                                       </STREET_NO>
                                       <STREET>
                                            <xsl:value-of select="substring-after(TaskData/CustomerAddress1,' ')"/>
                                       </STREET>
                                       <CITY>
                                            <xsl:value-of select="substring-before(TaskData/CustomerCityState,',')"/>
                                       </CITY>
                                       <STATE>
                                            <xsl:value-of select="substring-after(TaskData/CustomerCityState,',')"/>
                                       </STATE>
                                       <POSTCODE>
                                            <xsl:value-of select="TaskData/CustomerZipCode"/>
                                       </POSTCODE>
                                  </STOP>
                                  <STOP_TW>
                                       <IDENT>
                                            <xsl:value-of select="TaskData/FieldOrderNumber"/>
                                       </IDENT>
                                       <xsl:if test="string-length(SchedulingData/ApptStartDateTime) > 0">
                                            <xsl:variable name="apptDuration">
                                                 <xsl:value-of select="xs:dayTimeDuration(xs:dateTime(SchedulingData/ApptFinishDateTime)-xs:dateTime(SchedulingData/ApptStartDateTime))"/>
                                            </xsl:variable>
                                            <START_DATE>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,1,4)"/>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,6,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,9,2)"/>
                                            </START_DATE>
                                            <START_TIME>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,12,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/ApptStartDateTime,15,2)"/>
                                            </START_TIME>
                                            <DURATION>
                                                 <xsl:if test="not (xs:hours-from-duration($apptDuration) > 99)">0</xsl:if>
                                                 <xsl:if test="not (xs:hours-from-duration($apptDuration) > 9)">0</xsl:if>
                                                 <xsl:value-of select="xs:hours-from-duration($apptDuration)"/>
                                                 <xsl:if test="not (xs:minutes-from-duration($apptDuration) > 9)">0</xsl:if>
                                                 <xsl:value-of select="xs:minutes-from-duration($apptDuration)"/>
                                            </DURATION>
                                       </xsl:if>
                                       <!---->
                                       <xsl:if test="string-length(SchedulingData/ApptStartDateTime) = 0">
                                            <xsl:variable name="apptDuration">
                                                 <xsl:value-of select="xs:dayTimeDuration(xs:dateTime(SchedulingData/DueOnDateTime) - xs:dateTime(SchedulingData/EarlyStartDateTime))"/>
                                            </xsl:variable>
                                            <START_DATE>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,1,4)"/>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,6,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,9,2)"/>
                                            </START_DATE>
                                            <START_TIME>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,12,2)"/>
                                                 <xsl:value-of select="substring(SchedulingData/EarlyStartDateTime,15,2)"/>
                                            </START_TIME>
                                            <xsl:variable name="iTotalHours">
                                                 <xsl:value-of select="xs:int(days-from-duration($apptDuration) * 24 + hours-from-duration($apptDuration))"/>
                                            </xsl:variable>
                                            <xsl:variable name="iMinutes">
                                                 <xsl:value-of select="xs:int(minutes-from-duration($apptDuration))"/>
                                            </xsl:variable>
                                            <DURATION>
                                                 <!-- Add leading zeros -->
                                                 <xsl:if test="not ($iTotalHours > 99)">0</xsl:if>
                                                 <xsl:if test="not ($iTotalHours > 9)">0</xsl:if>
                                                 <xsl:value-of select="xs:string($iTotalHours)"/>
                                                 <xsl:if test="not ($iMinutes > 60)">0</xsl:if>
                                                 <xsl:value-of select="xs:string($iMinutes) "/>
                                            </DURATION>
                                       </xsl:if>
                                  </STOP_TW>
                             </UPDATE_STOP_DATA>
                        </UPDATE_STOP>
                   </xsl:when>
              </xsl:choose>
              </SOAP-ENV:Envelope>
         </xsl:template>
    </xsl:stylesheet>

    The code is appended:
    public XMLElement TransformDoc(XMLDocument doc, String xslFile){
         DOMParser           parser;
         XMLDocument      xsldoc;
         URL                xslURL;
         try {
         // Parse xsl and xml documents
         xsldoc = new XMLDocument();
         parser = new DOMParser();
         // Parse the XSL file
         xslURL = createURL(xslFile);
         parser.parse(xslURL);
         xsldoc = parser.getDocument();
         // Instantiate a stylesheet
         XSLProcessor processor = new XSLProcessor();
         processor.setBaseURL(xslURL);
         XSLStylesheet xsl = processor.newXSLStylesheet(xsldoc);
         // Display any warnings that may occur
         processor.showWarnings(true);
         processor.setErrorStream(System.err);
         XMLDocumentFragment result = processor.processXSL(xsl, doc);

  • Code Review Help: XSLProcessor

    I have following code to process XML with XSLT processor. I am getting no output. Is anything wrong with code / xml /xsl ?
    Please help,
    Arun
    xml_clob clob;
    xsl_clob clob;
    buffer VARCHAR2(4000) := NULL;
    p Xmlparser.Parser;
    Xml_doc Xmldom.DOMDocument;
    xmldocnode Xmldom.DOMNode;
    proc Xslprocessor.Processor;
    ss Xslprocessor.Stylesheet;
    xsldoc Xmldom.DOMDocument;
    docfrag Xmldom.DOMDocumentFragment;
    docfragnode Xmldom.DOMNode;
    xslelem Xmldom.DOMElement;
    xslcmds Xmldom.DOMNodeList;
    BEGIN
    SELECT detaildata INTO xml_clob FROM adam.userdata
    WHERE userid = 50667;
    SELECT xsldata INTO xsl_clob FROM adam.usertemplate
    WHERE usertemplateid = 12;
    p := Xmlparser.newParser;
    Xmlparser.setValidationMode(p, FALSE);
    -- Parse XMLDOC
    Xmlparser.parseclob(p, xml_clob);
    Xml_doc := Xmlparser.getDocument(p);
    -- Parse SS
    Xmlparser.parseclob(p, xsl_clob);
    xsldoc := Xmlparser.getDocument(p);
    -- make stylesheet
    proc := Xslprocessor.newProcessor;
    ss := Xslprocessor.newStylesheet(xsldoc, 'http://www.w3.org/TR/WD-xsl');
    -- process xsl
    docfrag := Xslprocessor.processXSL(proc, ss, Xml_doc);
    docfragnode := Xmldom.makeNode(docfrag);
    Xmldom.writeTobuffer(docfragnode, buffer);
    dbms_output.put_line(SUBSTR(buffer,1,200));
    Xmlparser.freeparser(p);
    END;
    xml_clob : <Data><Country>USA</Country><City>New York</City><WorkPhone>123-456-7890</WorkPhone><State>NY</State><Zip>11201</Zip></Data>
    xsl_clob :
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!--Copy data into a vertical display. Generated by Horizontal.xsl, do not modify.-->
    <xsl:template match="/">
    <xsl>
    <b>Company/Institution:</b>
    <xsl:value-of select="Data/Company" />
    <b>Address:</b>
    <xsl:value-of select="Data/Address1" />
    <xsl:if test="Data/Address2">
    <xsl:value-of select="Data/Address2" />
    </xsl:if>
    <xsl:if test="Data/Address3">
    <xsl:value-of select="Data/Address3" />
    </xsl:if>
    <b>City: </b>
    <xsl:value-of select="Data/City" />
    <b>State: </b>
    <xsl:value-of select="Data/State" />
    <b>Zip Code: </b>
    <xsl:value-of select="Data/Zip" />
    <b>Country: </b>
    <xsl:value-of select="Data/Country" />
    <b>Work Phone #:</b>
    <xsl:value-of select="Data/WorkPhone" />
    <b>Fax:</b>
    <xsl:value-of select="Data/Fax" />
    </xsl>
    </xsl:template>
    </xsl:stylesheet>

    And, code is runs successfully and not producing any error neither output.
    TIA,
    Arun

  • Problem in XSLProcessor

    I have following code to process XML with XSLT processor. I am getting no output. Is anything wrong with code ?
    Please help,
    Arun
    begin
    xml_clob clob;
    xsl_clob clob;
    buffer VARCHAR2(4000) := NULL;
    p Xmlparser.Parser;
    Xml_doc Xmldom.DOMDocument;
    xmldocnode Xmldom.DOMNode;
    proc Xslprocessor.Processor;
    ss Xslprocessor.Stylesheet;
    xsldoc Xmldom.DOMDocument;
    docfrag Xmldom.DOMDocumentFragment;
    docfragnode Xmldom.DOMNode;
    xslelem Xmldom.DOMElement;
    xslcmds Xmldom.DOMNodeList;
    BEGIN
    SELECT detaildata INTO xml_clob FROM adam.userdata
    WHERE userid = 50667;
    SELECT xsldata INTO xsl_clob FROM adam.usertemplate
    WHERE usertemplateid = 12;
    p := Xmlparser.newParser;
    Xmlparser.setValidationMode(p, FALSE);
    -- Parse XMLDOC
    Xmlparser.parseclob(p, xml_clob);
    Xml_doc := Xmlparser.getDocument(p);
    -- Parse SS
    Xmlparser.parseclob(p, xsl_clob);
    xsldoc := Xmlparser.getDocument(p);
    -- make stylesheet
    proc := Xslprocessor.newProcessor;
    ss := Xslprocessor.newStylesheet(xsldoc, 'http://www.w3.org/TR/WD-xsl');
    -- process xsl
    docfrag := Xslprocessor.processXSL(proc, ss, Xml_doc);
    docfragnode := Xmldom.makeNode(docfrag);
    Xmldom.writeTobuffer(docfragnode, buffer);
    dbms_output.put_line(SUBSTR(buffer,1,200));
    Xmlparser.freeparser(p);
    END;null

    Would you try to print out the result to buffer directly by:
    xslprocessor.processXSL(proc,ss,xmldoc,resbuf);
    null

  • NullPointerException in xslprocessor

    I receive a null pointer exception when using xslprocess.processXSL. Presumably there's something wrong on my part either in initiallizing the stylesheet or passing in the variables to this method. Please help!
    select xmldoc into theXSL from e2b_xmldocuments where docname = 'ALAN';
    queryCtx := DBMS_XMLQuery.newContext(query);
    DBMS_XMLQuery.setTagCase(queryCtx,1);
    result := DBMS_XMLQuery.getXML(queryCtx);
    parser := xmlparser.newParser;
    retDoc := xmlparser.getDocument(parser);
    xmlparser.parseCLOB(parser,result);
    xmlparser.parseCLOB(parser,theXSL);
    retXSLDoc := xmlparser.getDocument(parser);
    stylesheet := xslprocessor.newStylesheet(retXSLDoc, 'http://rarusraweb02/public/utlfile/dsp_Codelist');
    xmlparser.freeParser(parser);
    xslprocessor.processXSL(engine,stylesheet,retDoc,alan);
    There's no documentation to tell me what the "ref" string should be in the newStylesheet command. This probably is the problem.
    Thanks,
    Chad
    null

    The string arguments to newStylesheet(inp VARCHAR2,ref VARCHAR2) are interpreted both as URL's, not XML document text to be parsed. There's currently a bug in this overloading of the method that causes the URL specified as inp to be ignored.
    Best to use the newStylesheet(xmldom.DOMDocument, ref VARCHAR2) flavor of this, where "ref" is a URL that should be used as the base url for relative URL references in the stylesheet.

  • XSL Transformation (XSLProcessor) doesn't work on WebSphere 3.5.4

    XSL-1013: (Error) Error in expression: '/'
    I have encountered this problem. The problem seems to be the same as running the oraxsl in the command line using java. I tried using jre instead of java and including the -nojit (Disable JIT Compiler) and it worked. The problem now is how can I do the same thing in Websphere (like how can I disable the JIT compiler and why does it affect the XSL transformation?). Take note that my servlets works (XSL transformation) in my local workstation uing JSWDK 1.0.1 and JDK 1.2.2 but when migrated to Websphere 3.5.4 the XSL transformation doesn't work anymore.
    I would gladly appreciate if somebody can give me a concrete answer.
    Thanks,
    NDC

    XSL-1013: (Error) Error in expression: '/'
    I have encountered this problem. The problem seems to be the same as running the oraxsl in the command line using java. I tried using jre instead of java and including the -nojit (Disable JIT Compiler) and it worked. The problem now is how can I do the same thing in Websphere (like how can I disable the JIT compiler and why does it affect the XSL transformation?). Take note that my servlets works (XSL transformation) in my local workstation uing JSWDK 1.0.1 and JDK 1.2.2 but when migrated to Websphere 3.5.4 the XSL transformation doesn't work anymore.
    I would gladly appreciate if somebody can give me a concrete answer.
    Thanks,
    NDC

Maybe you are looking for

  • New AT&T Upgrade Eligibility Update (Apple Stores Not Aware???) *Important*

    This is the link to AT&T official update release: http://www.att.com/gen/press-room?pid=1574 I went to my local AT&T store and informed them about this, and the person that took care of me didn't know about it, she was like "No, you gotta wait till 7

  • How to set the number of records displayed at run time

    Is it possible to set the number of records displayed block property at run time? The built-in 'GET_BLOCK_PROPERTY' can retrieve the number of RECORDS_DISPLAYED. But I can't find SET_BLOCK_PROPERTY to set this property. Is there anyway I can set this

  • Will my x120e run cod4?

    will my new x120e run call of duty 4 modern warfare on lowest settings and get a decent (20+) fps? system specs: OS Name Microsoft Windows 7 Ultimate Version 6.1.7600 Build 7600 Other OS Description  Not Available OS Manufacturer Microsoft Corporatio

  • How do I publish to Google+ from LR4?

    I can't seem to find a service for publishing to Google+. Please help.

  • Preview Encrypt PDF - Really Secure?

    When you use the Preview app in OS X to encrypt a PDF is it really secure? I haven't been able to find anything about the level of encryption used by Preview in OS X. What type of encryption does Preview use (40-bit, 128-bit)? A quick search of the w