XML parsing huge file

Hi,
I have a 36M XML file i need to parse, I'm new to XML.
I usually get a 200K file in CSV format from most of my client that they transfer into there account i then simply update the MSSQL database with the CSV file at midnight on my server. But now i have 74 clients that are regroup and they send me 1 XML file.
When i run it using the sample they gave me it works fine but on the 36M file i get a Jrun error then i found out that :
<CFFile action="READ" variable="xmlfile" file="c:\mypath\#clientfile#.xml" charset="utf-8">
<cfset xmlObj = xmlParse(#xmlfile#)>
Doesnt work on big files because it runs out of memory.
I need a way to parse that file using Java i downloaded xmlsax.js but i dont know how to use it to parse then get my parsed var back from it can anyone help me please.
I got the file here :  http://xmljs.sourceforge.net/website/sampleApplications-sax.html
Thank you

In response to Owain Norths' comments about DOM parsing.
I'm not sure if the memory issues are the fault of the DOM parsing method being used or if the problem is in how CF converts XML text into CF objects (arrays, structs) that the XML text represents.  It possible that the CF objects are responsible for using excessive amounts of memory.  Either way it sounds like CF's XML parsing capabilities aren't appropriate for larger (large being a relative term) XML files.
It might be an interesting experiment to use third party Java components (such as Xerces2) to parse some XML files and see what the performance and memory usage look like.
I will re-state my original advice.  The poster needs to import data from XML files into tables on MS SQL Server.  Bulk import tasks, such as from XML or CSV files, are generally better handled in MS SQL Server.  Some options include: a job that executes T-SQL, an Integration Services package, or the Bulk Copy Program (BCP) utility. 
From: Owain North [email protected]
Sent: Fri 11/12/2010 8:57 AM
To:
Subject: XML parsing huge file
Couldn't agree more, and to be honest I can't believe this hasn't come up before. To me, the thought that something like CF should have to be bypassed when you get to files of a few megs is utterly ridiculous. I haven't looked into the different methods of parsing XML as it's really not my thing, but are we saying that DOM parsing is necessary for CF to be able to perform the functions it does on  the resulting XML object? Or does one create the same result, just through a different method?
Owain North
Code Monkey
Titan Internet Ltd
http://www.titaninternet.co.uk <http://www.titaninternet.co.uk/>
Owain North is a mildly overweight computer programmer who likes to sit in the corner of a darkened room tapping away on his keyboard whilst wearing a massive set of headphones to avoid human contact where possible. He particularly likes to avoid natural light and salad.
In his spare time he likes to pet his dog and work on his track car: http://www.306gti6.com/forum/showthread.php?id=124722&page=1
The other day he went up to the toilets upstairs and there were no hand towels left! Bad times.
It's Filthy Friday, so we all got Dominos for lunch. Large (obviously) half and half Mighty Meaty and American Hot. Good it was, especially as one of the other guys didn't want his garlic & herb dip = win.
At the moment, he's having to look into WCF for a new project on  server monitoring. He doesn't know anything about it yet but after a  quick session on Amazon with the company credit card and some  extortionate delivery fees he's well on his way to writing his first WCF  service.
In case you're interested - in the end, he just had to dry his hands on his jeans.

Similar Messages

  • Installing xml parser jar files in oracle 8i

    hi list
    please i need help on how to install xml parser jar files manually into the database
    we have 8i running on windowsNT box
    i have checked my database these classes are not there .
    thanks

    You'll need to use the LOADJAVA program. Check out the Oracle XML Portal website. It has information on how to do this.
    www.webspedite.com/oracle

  • Xml parser problem------file not found!  urgent!!!

    I have write some codes to parse a xml file like this :
    File xml=new File(xmlpath,frame.statusXMLofEachSequence);
    if(xml.exists()){
    System.out.println("xml..."+xml.getAbsolutePath());
    try {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    System.out.println("statusFile1 is.."+xml.getPath());
    ��������
    It's ok in JBuilder and JCreater, but when I run it in Dos , it throws an exception .
    Although I print the name of the xml file before to parse it and get the right name of the xml file, just like this:
    statuseFile1 is..F:/JavaDebug/user/dwsun/seq1/config.status.xml
    the exception as follows:
    org.xml.sax.SAXParseException: File "file:///F:/JavaDebug/config.status.xml" not found.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1014)
    at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:512)
    at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:304)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:899)
    ���� ����
    why???
    Hope to get your helps!!!
    Thanks a lot!!!

    Please try the following code.
    import java.io.*;
    public class MyFile {
      public static void main(String args[]) {
        File file = new File(args[0]);
        System.out.println("File is " + file.getAbsolutePath());
        System.out.println("File is " + file.getPath());
    }ex)
    $ java MyFile MyFile.java
    File is /home/ikeda/work/java/forum/MyFile.java
    File is MyFile.java
    What FILE_PATH occured wrong print?

  • RegEx Error for Huge File .. Please help , Its Urgent

    Hi all,
    I am getting following exception,
    does anyone know about it
    java.lang.IndexOutOfBoundsException: No group 1
    at java.util.regex.Matcher.group(Matcher.java:355)
    at java.util.regex.Matcher.appendReplacement(Matcher.java:585)
    at java.util.regex.Matcher.replaceFirst(Matcher.java:701)
    at XSLT_OnlyJava.<init>(XSLT_OnlyJava.java:84)
    at XSLT_OnlyJava.main(XSLT_OnlyJava.java:93)
    Exception in thread "main"
    I am parsing huge file with regex and replacing some part
    Thanks,
    Vinayak

    sorry for late
    This is my code
    text = contents.toString();
              String regex = "<tu.*?/tu>";
              Matcher matcher = Pattern.compile(regex,Pattern.CASE_INSENSITIVE|Pattern.DOTALL).matcher(text);
              while(matcher.find()){
                   tuvSegment = matcher.group();
                   String segRegex = "<seg>.*?</seg>";
                   Matcher segMatcher = Pattern.compile(segRegex,Pattern.CASE_INSENSITIVE|Pattern.DOTALL).matcher(tuvSegment);
                   if(segMatcher.find()){
                        SegVal = segMatcher.group();
                   String ReplsegRegex = "<seg />";
                   Matcher ReplsegMatcher = Pattern.compile(ReplsegRegex,Pattern.CASE_INSENSITIVE|Pattern.DOTALL).matcher(tuvSegment);
                   text = ReplsegMatcher.replaceFirst(SegVal);
    The text string contains teh .tmx file
    Thanks,
    Vinayak

  • XML Parse error while loading an XML file

    HI Folks,
    I was trying to load and XML file into BODS.. The XML file is well-formed and the same when tested in other tools  is getting loaded without any issues..
    I have created a XML-File format with the corresponding XSD..
    But here in BODS it is giving - Parse error
    1) when i try to view the data of the source XML in my dataflow ..it is giving "XML Parser Failed".. and not able to show data..
    2) When I run my job i get the same pares error - with details as under..
    ---> Error here is "Unable to recognize element 'TAB' " or some time is say " Element TAB should be qualified"
    Please guide with this if you have any info..thanks
    I'm pasting the XML source file format here for your reference:--
      <?xml version="1.0" encoding="iso-8859-1" ?>
    - <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    - <asx:values>
    - <TAB>
    - <items>
    + <CUSTOMER_RECORD>
      <CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
      <NAME_1>ABC</NAME_1>
      <NAME_2>OFM/COMMERCIAL ACCOUNTS</NAME_2>
      <STREET_1>31 CENTER DRIVE MCS2045</STREET_1>
      <STREET_2 />
      <CITY>BETHESDA</CITY>
      <STATE_CODE>MD</STATE_CODE>
      <POSTAL_CODE>20892-2045</POSTAL_CODE>
      <COUNTRY_CODE>US</COUNTRY_CODE>
      <ORDER_BLOCK />
      <ERP_CREATE_DATE>20040610</ERP_CREATE_DATE>
      <ERP_CREATED_BY>DGUPTA</ERP_CREATED_BY>
      <ERP_MODIFY_DATE>20120201</ERP_MODIFY_DATE>
      <ERP_MODIFIED_BY>LWOHLFEI</ERP_MODIFIED_BY>
      <INDUSTRY_CODE>0103</INDUSTRY_CODE>
      <ACCOUNT_GROUP_ID>0001</ACCOUNT_GROUP_ID>
      <SALES_NOTE />
      <ADDRESS_NOTE />
      <CUSTOMER_CLASSIFICATION_CODE>02</CUSTOMER_CLASSIFICATION_CODE>
      <GLN_NUMBER />
      <PREVIOUS_ACCT_NO />
      <ACCOUNT_TYPE />
      <GAG />
      <SDI_ID />
      <HOSP_ID />
      <HIN />
      <DUNS />
      <PO_BOX />
      <POB_CITY />
      <POB_ZIP />
      <PHONE_NUMBER>77777</PHONE_NUMBER>
      <EMAIL_DOMAIN />
      <REQUESTER />
      <ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
      </CUSTOMER_RECORD>
    - <SALES_ORG_DATA>
    + <item>
      <CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
      <SALES_ORG>0130</SALES_ORG>
      <CUSTOMER_GROUP>03</CUSTOMER_GROUP>
      <ORDER_BLOCK_CODE />
      <ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
      </item>
    + <item>
      <CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
      <SALES_ORG>0120</SALES_ORG>
      <CUSTOMER_GROUP>11</CUSTOMER_GROUP>
      <ORDER_BLOCK_CODE />
      <ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
      </item>
      </SALES_ORG_DATA>
      </items>
      </TAB>
      </asx:values>
      </asx:abap>

    Pierre,
    Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
    function openXMLFile ( ) {
        var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
    While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
    Good luck
    Jang

  • File to IDoc : XML parsing in ABAP mapping

    Hi,
    In ABAP mapping I want to parse all of the incoming XML strings to internal table.Later I add few more fields to this table and transfer them to IDOC adapter in IDOC-XML format.In thsi case how do i get all of the input file data(converted from XML) into internal table using XML parsing in ABAP Mapping?
    Thansk in advance,
    RP

    Hi Amil,
    I insert into table but not immediately,I want all the parsed xml data into internal table and do something before I insert into DB /send it to IDOC.
    I knwo how to get single Xml parsing,but how to get multple records(looping xml parse) to internal table?
    Thanks,
    RP
    Edited by: RP@261 on Jun 3, 2009 2:14 PM

  • Attempt to process file failed with Exception in XML Parser-format problem

    Hi all,
    Iam getting an unusual error in the J2EE stack in XI.
    And the message is:
    006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)' 2006-11-30 17:31:07 Error Exception caught by adapter framework: null 2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    My scenerio iam posting IDOC to a flat file with content conversion in the receiver side,the mapping got executed successfully and in the audit log i found that the error was after the 'Start converting XML document content to plain text'.
    This means that error occured during content conversion of XML to the prescribed file format.
    Can anyone suggest any better approach using which we may trace the junk data in IDoc. Manual adhoc approach could take time and is error prone.
    Thanks in advance...
    karun

    Hi Bhavesh,
    Thanks for the early reply. I checked the mapping and everything is fine and the output is also in valid XML format.
    The audit log shows that the mapping got executed successfully and the error is after the step 'Start converting XML document content to plain text '. Is there any constraint in the file adapter regarding the message size for parsing.
    2006-11-30 17:30:50 Success Transfer: "BIN" mode, size 2912595 bytes, character encoding -
    2006-11-30 17:30:50 Success Start converting XML document content to plain text
    2006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)'
    2006-11-30 17:31:07 Error Exception caught by adapter framework: null
    2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    2006-11-30 17:31:07 Success The asynchronous message was successfully scheduled to be delivered at Thu Nov 30 17:36:07 GMT 2006.
    2006-11-30 17:31:07 Success The message status set to WAIT.
    2006-11-30 17:31:08 Success Acknowledgement creation triggered for type: SystemErrorAck
    2006-11-30 17:31:08 Success Acknowledgement sent successfully for type: SystemErrorAck
    2006-11-30 17:36:08 Success Retrying to deliver message to the application. Retry: 1

  • SQL Server 2012 Management Studio:Importing XML file to new Table of new Database-XML parsing: unexpected end of input???

    Hi all,
    In the Notepad, I created an xml file (ZenQroducts.xml) :
    <Qroducts>
    <Qroduct>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Qroduct>
    In my SQL Server 2012 Management Studio, I executed the following code:
    --to create a new object Qroducts in a new database OPENXMLtesting
    CREATE DATABASE OPENXMLtesting
    GO
    CREATE TABLE Qroducts(
    sku INT Primary KEY,
    qroduct_desc VARCHAR(30));
    INSERT INTO Qroducts (sku, qroduct_desc)
    SELECT X.qroduct.query('SKU').value('.', 'INT'),
    X.qroduct.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenQroducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Qroducts/Qroduct') AS X(qroduct);
    SELECT sku, qroduct_desc
    FROM Qroducts;
    I got the following message:
    Msg 9400, Level 16, State 1, Line 6
    XML parsing: line 13, character 12, unexpected end of input
    I have no ideas why I got this "XML parsing:line 13, character12, unexpected end of input" message. Please kindly help, advise me on where I made mistake and how I can resolve this problem, and respond in this Forum.
    Thanks in advance,
    Scott Chang
     

    Hi Manish, Thanks for your response.
    Yes, it is a duplicate with Qroducts/Qroduct instead of Products/Product. I did it, because I don't know how to remove the existing "Products" database.
    Again, I got the existing "Qroducts" database in this second trial!!??  I am comletely lost in doing "Importing XML file to SQL Table" now!!  I think that I have not touched T-SQL and XML programming, since 2008. I
    did not catch the new features of T-SQL 2008, XML, SQL/XML, XQuery, etc. for long time. Recently, I did not know what DECLARE, @x, SET,...were, and dived into the SQL/XML and XQuery programming. I knew the SQL Basics (SELECT, FROM, WHERE,..), creating
    the names of databases and tables in SQL Server 2008/2012 Management Studio (Express) before. This morning, I found an old T-SQL 2008 Prgrammer's Guide that has the new features of SQL Server 2008 for T-SQL, XML, XQuery, etc. I just starting reading
    it to know what DECLARE, @x, SET,... are. But, I still don't know where the existing databases "Products" and "Qroducts" (created by me) are - they are not in the Databases of SQL Server 2012 Management Studio I am using!!??  Could
    you please kindly point out where the "Products" and "Qroducts" databases are?
    Prashanth responded to my posted question too and he asked to to try his code: DECLARE @xml XML, SELECT @xml =' <Qroducts>.....SELECT product.value.....FROM @XML.nodes.....AS.... I just learned that his code is doing the thing we
    want to do and print the results below the SQL Query. This is not what I need in doing my SQL/XML programming. I am reading/studying the new (2008) features of T-SQL, XQuery 1.0: An XML Query Language (Second Edition), and Microsoft XQuery Language Reference
    (SQL Server 2012 Books Online) closely now. I hope that I can resume the T-SQL, XML Query, SQL/XML, XQuery in my SQL Server 2012 Management Studio soon.
    Please tell me  where the existing databases "Products" and "Qroducts" I created in my previous trials in my SQL Server 2012 Management Studio.  This is what I need to know and to delete them, before I do this kind of "Importing
    XML file to Table of SQL Server 2012 Management Studio"  programming again.
    Please kindly help, advise and respond again.
    Many Thanks,
    Scott Chang

  • SQL Server 2012 Management Studio: Import XML File to SQL Table - XML parsing: illegal qualified name character

    Hi all,
    In my SQL Server 2012 Management Studio, I executed the following code:
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    I got the following message:
    Msg 9455, Level 16, State 1, Line 5
    XML parsing: line 3, character 12, illegal qualified name character
    I have no ideas why the "product" in the statement "SELECT X.product.query('SKU').value('.','INT')" is not legal qualified name charcter!!!???  Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Manish, Thanks for your response.
    Here is a copy of my ZenProducts.xml:
    <Products>
    <Product>
    <SKU>1<</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2<</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3<</SKU>
    <Desc>Video</Desc>
    </Product>
    I found the wrong "<<" in my xml file and changed it to the right "<" for the statement<SKU>1</sku>. I executed the corrected code and I got the following new message:
    Msg 2714, Level 16, State 6, Line 1
    There is already an object named 'Products' in the database.
    I don't know how to remove the old, existing the 'Products' object in the database and execute the corrected code again. Please kindly help, advise and tell me how to resolve this new problem.
    Many Thanks,
    Scott Chang
    P. S. I played with another project to get the 'Products' object in my database before. Frankly, I don't know where the old 'Products' object and the database are. Please enlighten me in resolving this matter more clearly.
    You welcome Scott, As Olaf mentioned in this post, there was already a table exists , so need to drop your Products table.
    Apart from this, I guess either you did not pasted the full XML file or what, I needed to have the (  </Products>)closing tag in your XML file as follows.
    <Products>
    <Product>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Product>
    </Products>
    You can use following script to drop if your 
    Products table is already existing.
    if exists(select 1 from sys.tables where name ='Products')
    drop table Products
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    Let us know if you face any other problem.
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • Losing Line-feed in XML parsing (XMLTRANSFORM) or File output (clob2file)?

    Hi all, need some help please!
    I'm using a xslt file to transferm a XML file into a txt format file. Within the XSLT file, there is a carriage-return (<xsl:text>
    </xsl:text>) (it disappeared already, here is what i'm using "#xD" or "#xA", have to take the '&' and ';' away), but the final output txt file seems to lose this carriage-return/line-feed information. The output data became one-line.
    Here are the steps I've used:
    1. lv_xml_data = XMLTRANSFORM (a.xml_data, b.f_xslt)
    => output data into XMLTYPE;
    2. using XMLTYPE.getclobval to get the output data into CLOB format.
    lv_output_clob := XMLTYPE.getclobval (lv_xml_data);
    3. using encoding:
    lv_output_clob :=
    DBMS_XMLGEN.CONVERT (lv_output_clob, DBMS_XMLGEN.entity_decode);
    4. using clob2file write to a file with txt format.
    DBMS_XSLPROCESSOR.clob2file (lv_output_clob,
    lv_output_dir,
    lv_filename,
    NLS_CHARSET_ID ('UTF8')
    Been struggling with these a few days already. Any help is appreciated. I would really like to get some input to see what might cause the carriage-return/line-feed characters lost.
    Thanks in advance!
    -Jane
    Edited by: user9084567 on Feb 1, 2010 1:45 PM
    Edited by: user9084567 on Feb 1, 2010 1:47 PM
    Edited by: user9084567 on Feb 1, 2010 1:48 PM

    A_non,
    After a few testing, I can identify the CRLF was lost in XMLTRANSFORM. I had read your other thread related to this, and try to run this sample code:
    /* Formatted on 2010/02/03 15:32 (Formatter Plus v4.8.8) */
    DECLARE --Local variables here
    v_xml XMLTYPE
    := XMLTYPE
    ('<
    offers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd.xsd"><
    submit type="DAM" date="2007-03-28" name="MKTPART1" mode="NORMAL"/><
    offer name="Jamestown" flag="true" version_no="1.0"><
    standing date="2007-03-29" type="WED"/><
    identifier external_id="523736560"/><
    /offer><
    /offers>'
    v_xslt XMLTYPE
    := XMLTYPE
    ('<
    xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <
    xsl:output method="text"/> <
    xsl:variable name="new_line" select="''&#xA;''" /> <
    xsl:template match="/"> <
    xsl:value-of select="/offers/offer/...name"/><
    xsl:value-of select="$new_line" /><
    xsl:value-of select="/offers/submit/...date"/><
    xsl:value-of select="$new_line" /><
    xsl:value-of select="/offers/offer/standing/...date"/><
    xsl:value-of select="$new_line" /><
    xsl:value-of select="/offers/offer/standing/...type"/><
    xsl:value-of select="$new_line" /><
    /xsl:template><
    /xsl:stylesheet>'
    BEGIN -- Test statements here
    DBMS_OUTPUT.put_line (XMLTYPE.transform (v_xml, v_xslt).getstringval ());
    END;
    But come out these error:
    Error at line 2
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00230: invalid character 10 (U+000A) found in a Name or Nmtoken
    Error at line 4
    ORA-06512: at "SYS.XMLTYPE", line 310
    ORA-06512: at line 2
    Can not figure out why. Try to use this <xsl:variable name="new_line" select="''& # x A ;''" /> inside my style sheet, but it seems not taking it. Not too sure what's exactly should be the quotes for "''& # x A ;''" (w/o space). If I used doub quote + two single quotes, it returns error, LPX-00601: Invalid token in: ' '; if I used single quote + double quote, it did not bring in CRLF at all.
    Any input?
    Thanks in advance.

  • Error parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta name="generator" content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Transform</title>
    <link type="text/css" rel="stylesheet" href="css/CascadeMenu.css">
    </head>
    <body id="Bdy">
    Hello all, I've run into a perplexing problem with a new and unexptected error on a web application that resides in a JDeveloper 11g environment. I just run it from JDeveloper on my laptop. No deployement other than to the default server at run time Integratedweblogicserver. I am doing an XML transform using XSLT and it has been working fine until I tried to use the page yesterday. I get the following error. javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser). at weblogic.servlet.jsp.PageContextImpl.handlePageException(PageContextImpl.java:417) at jsp_servlet.__transform._jspService(__transform.java:109) at weblogic.servlet.jsp.JspBase.service(JspBase.java:34) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) Caused by: javax.xml.transform.TransformerConfigurationException: XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser). at oracle.xml.jaxp.JXSAXTransformerFactory.reportConfigException(JXSAXTransformerFactory.java:759) at oracle.xml.jaxp.JXSAXTransformerFactory.newTemplates(JXSAXTransformerFactory.java:371) at oracle.xml.jaxp.JXSAXTransformerFactory.newTransformer(JXSAXTransformerFactory.java:272) at weblogic.xml.jaxp.RegistryTransformerFactory.newTransformer(RegistryTransformerFactory.java:209) at org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag(TransformSupport.java:145) at jsp_servlet.__transform._jsp__tag2(__transform.java:223) at jsp_servlet.__transform._jspService(__transform.java:102) ... 25 more Caused by: java.lang.ClassCastException: weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser at oracle.xml.jaxp.JXSAXTransformerFactory.newTemplates(JXSAXTransformerFactory.java:357) ... 30 more ------------------------------------------------ I changed no code or moved any XML or XSLT file. I do see an error in the log regarding a bad URL ----------------------------------------------- XML-22108: (Error) Invalid Source - URL format is incorrect. XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser). &lt;[ServletContext@10343785[app:QSBQAR module:QSBQAR-QSBQAR-context-root path:/QSBQAR-QSBQAR-context-root spec-version:2.5], request: weblogic.servlet.internal.ServletRequestImpl@699744[ GET /QSBQAR-QSBQAR-context-root/Transform.jsp?reqtype=1 HTTP/1.1 Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Language: en-us User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; . ------------------------------ Here is the XML ------------------------------ <?xml version="1.0" encoding="windows-1252" standalone="no"?>
    ACME Bird Seed Co. Capture the Road Runner using a boulder, rope and bird seed. Quinn Brian 00 00 00 00 00 00 00 00 00 11 08 08 08 08 00 43 43 Hours have been approved. APPROVED Smart Jean 00 00 00 00 00 00 00 00 00 Hours approved. APPROVED --------------------------------------------------------------------------------------- Here is the XSL --------------------------------------------------------------------------------------- <?xml version="1.0" encoding="windows-1252"?>
    <!-- Root template -->
    <h2>Project Hours Worked</h2>
    ----------------------------------------------------------------------------------------- Here is the JSP with the transform ----------------------------------------------------------------------------------------
    <table>
    <tr>
    <td>Week Ending Date:--</td>
    </tr>
    <tr>
    <td></td>
    </tr>
    <tr>
    <th>Client</th>
    <td></td>
    <th>Project</th>
    <td></td>
    </tr>
    <tr>
    <td></td>
    </tr>
    <tr>
    <td></td>
    </tr>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Task</th>
    <th>---</th>
    <th>Sun</th>
    <th>Mon</th>
    <th>Tue</th>
    <th>Wed</th>
    <th>Thu</th>
    <th>Fri</th>
    <th>Sat</th>
    <th>---</th>
    <th>Ttl</th>
    </tr>
    <tr>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>---</td>
    <td>---</td>
    <td></td>
    <td>---</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>---</td>
    <td></td>
    </tr>
    <tr>
    <td>Total Hours: </td>
    <td></td>
    <td></td>
    </tr>
    <%@ page contentType="text/html;charset=windows-1252"%><%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %></table>
    <script type="text/javascript" src="scripts/CascadeMenu.js">
    </script>
    <% int bad = 1; %>
    <div id="menuBar" class="menuBar">
    <div id="Bar1" class="Bar">Home</div>
    <div id="Bar3" class="Bar">Accounting</div>
    <div id="Bar4" class="Bar">Help</div>
    </div>
    <div style="background:#84ffff; color:Aqua; "><br>
    <br>
    <p style="color:Orange; font-size:x-large; font-style:italic; font-weight:bold;
    font-family:Arial, Helvetica, sans-serif; "><img src="images/logoqsq.jpg" style="border:1" height="120" width="120" alt="Q Squared">
    </p>
    </div>
    <div>
    <p style="color:Black; font-size:x-large; font-style:italic; font-weight:bold; font-family:Arial, Helvetica, sans-serif;"><img src="images/dilbert.gif" alt="Dilbert" height="100" width="100">
    ? ? Welcome to Q Squared-Brian Quinn Consulting - Manager Time Approval</p>
    </div>
    <div>
    <table width="100%" class="table1">
    <tr>
    <td style="width:15%; border-width:medium; background-color:silver ">
    <h3>Contractor Resources</h3>
    <ul style="list-style-type:circle; ">
    <li>Time Entry</li>
    <li>Profile</li>
    </ul>
    <h3>Manager Resources</h

    LOL - I didn't think about the forum message area having trouble displaying my XML XSLT problem
    It seemed to mix the code with the site XML.
    Oh brother
    The deal is this.
    The XML XSLT transform was working and now it is not and I think it has something to do with
    the HTTP links for either the Oracle core and/or XML TAGLIBs. Either that or the W3.org has
    outdated XSLT http links.
    Anyone know if changes have been made to any of these taglib links?
    This in the JSP
    <!--
    <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <c:import url="HoursWorked.xml" var="xmlHoursWorked" charEncoding="windows-1252"/>
    <c:import url="./HoursWorked3.xsl" var="xslt" charEncoding="windows-1252"/>
    <x:transform xml="${xmlHoursWorked}" xslt="${xslt}" />
    -->
    This in the XSL
    <!--
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    -->
    And the other JSP having the same problem.
    <!--
    <%@ page contentType="text/html;charset=windows-1252"
    import="java.util.List, qsbqar.XMLHandler, org.w3c.dom.NodeList,
    javax.xml.transform.*, javax.xml.transform.stream.*,
    org.w3c.dom.Node, oracle.xml.parser.v2.*, java.io.File,
    java.io.FileReader " %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
    <xsl:param name="employeeID" value="2"/>
    <%session.setAttribute("employee_ID", request.getParameter("consultantID")); %>
    <c:import url="HoursWorked.xml" var="xmlHoursWorked" charEncoding="windows-1252"/>
    <c:import url="./HoursWorked4.xsl" var="xslt" charEncoding="windows-1252"/>
    <x:transform xml="${xmlHoursWorked}" xslt="${xslt}">
    <x:param name="employeeID" value="${sessionScope.employee_ID }"/>
    </x:transform>
    -->
    Edited by: B of Carbon on Dec 19, 2010 12:25 AM

  • Error in parsing taglib 'customtag' tag in web.xml or .tld file of the tagl

    Hi
    While execution Portal application, I am getting error," Error in parsing taglib 'customtag' tag in web.xml or .tld file of the taglib library."
    Complete stack is
    >>#1.5 #005056AE006400690000002000000A440004BA8F3ECB004A#1331024303056#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt.runtime#M1005000#6994##99593FD6676911E1807500000041A352#99593fd6676911e1807500000041a352-0#99593fd6676911e1807500000041a352#SAPEngine_Application_Thread[impl:3]_31##0#0#Error##Java###02:28_06/03/12_0020_4301650
    [EXCEPTION]
    #1#com.sapportals.portal.prt.servlets_jsp.server.jsp.ParseException: Error in parsing taglib 'customtag' tag in web.xml or .tld file of the taglib library.
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.JspTaglibDirective.verifyAttributes(JspTaglibDirective.java:189)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.JspDirective.parse0(JspDirective.java:162)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.JspDirective.parse(JspDirective.java:117)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.ElementCollection.parse(ElementCollection.java:86)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.ParserImpl.parse(ParserImpl.java:595)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:2170)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.compile(JSPCompiler.java:81)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.run(JSPCompiler.java:140)
    at com.sapportals.portal.prt.core.broker.JSPComponentItem.compileJSP(JSPComponentItem.java:291)
    at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:141)
    at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.service(PortalComponentItemFacade.java:355)
    at com.sapportals.portal.prt.core.broker.PortalComponentItem.service(PortalComponentItem.java:934)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:435)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:527)
    at com.sapportals.portal.prt.component.AbstractComponentResponse.include(AbstractComponentResponse.java:89)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:232)
    at com.sapportals.portal.htmlb.page.JSPDynPage.doOutput(JSPDynPage.java:76)
    at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:133)
    at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.doPreview(AbstractPortalComponent.java:240)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:168)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
    at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:545)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:434)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    Regards
    Pratyush

    Hi,
    See the following guide and make sure to carefully follow all instructions.
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40599e45-8cf9-2910-cbaa-d4cd8e15ff34?QuickLink=index&overridelayout=true&14770392545262]
    Regards,
    Alex

  • Error in parsing taglib taglib tag in web.xml or .tld file of the taglib

    Hi All,
    I have added ResourceBundle.tld file in following path : /PORTAL-INF/taglib/tld/
    I have added portalapp.xml file following entry  :
    <property name="/PORTAL-INF/taglib/tld/ResourceBundle.tld" value="/PORTAL-INF/taglib/tld/ResourceBundle.tld"/>
    I have added jsp file following entry :
    <%@ taglib uri="/PORTAL-INF/taglib/tld/ResourceBundle.tld" prefix="bundle" %>
    I am getting the following the error: Error in parsing taglib taglib tag in web.xml or .tld file of the taglib library
    can you tell me where i am giving the wrong.
    Regards
    Siva

    hi rabih,
    in jsp..
    <%@ taglib uri="tagLib" prefix="bundle" %>
    in portalapp.xml
    <component-profile>
      <property name="tagLib" value="/PORTAL-INF/taglib/tld/ResourceBundle.tld"/>
    </component-profile>
    it may help u..
    regards,
    Chinnadurai.R

  • Exception in XML Parsing:Premature End of file.

    Hii
    I am geting exception in XML pasing in following line
    doc=parser.parse(new File(sFileName));
    if any one kno about this then plz send me solution and reason of this exception.
    Thanks

    Your XML file is malformed.

  • Parse XML Inbound Interface file

    What are SAP best practices to parse XML Inbound Interface file?
    Currently we are parsing XML Inbound file with custom ABAP code, but it is somewhat cumbersome and requires maintenance.
    We do not any middleware that can parse file for us.
    Is there is any best way we can handle this without lot of maintenance..

    You can do it thro XLST..
    Check this links..
    Upload XML to internal table and vice versa in SAP 4.6C
    /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
    YOu can do it through XLST. it is supported in ABAP from 4.7. you can create a XSLT, and read you XML, then CALL TRANSFORMATION to convert a XML into ABAP data structure.
    reference link:
    http://help.sap.com/saphelp_nw04/helpdata/en/fd/9d7348389211d596a200a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/bb/576670dca511d4990b00508b6b8b11/content.htm
    Reward each helpful answer.
    Raja T
    Message was edited by:
            Raja Thangamani

Maybe you are looking for