SAX XML Parser problem

Hi,
I have a standard .xml file and a file called TemplateContentHandler that parses the info in the xml doc but there is an error in it. See below:
TemplateContentHandler.java
if ( strElementName.equals( TemplateConstants.RNC_Module_LDN_TU1 ) ) {
            timingUnit1TagExistInDefaultTemplateFile = true;
            System.err.println("timingUnit1TagExistInDefaultTemplateFile for TU1 == "+timingUnit1TagExistInDefaultTemplateFile);
            System.err.println("strValue for TU1 == "+strValue);
            tTemplate.setRNC_Module_LDN_TU1( strValue );
            Trace.exit();
            return;
        if ( strElementName.equals( TemplateConstants.RNC_Module_LDN_TU2 ) ) {
            timingUnit2TagExistInDefaultTemplateFile = true;
            System.err.println("timingUnit2TagExistInDefaultTemplateFile for TU2 == "+timingUnit2TagExistInDefaultTemplateFile);
            System.err.println("strValue for TU2 == "+strValue);
            tTemplate.setRNC_Module_LDN_TU2( strValue );       
            Trace.exit();
            return;
        }DefaultTemplate
<RNC_Module_LDN_TU2>ManagedElement=1,Equipment=1,Subrack=MS,Slot=5,PlugInUnit=1</RNC_Module_LDN_TU2>
<RNC_Module_LDN_TU1>ManagedElement=1,Equipment=1,Subrack=MS,Slot=4,PlugInUnit=1</RNC_Module_LDN_TU1>
OutPut
root@atrcus13> timingUnit2TagExistInDefaultTemplateFile for TU2 == true
strValue for TU2 == ManagedElement=1,Equipment=1,Subrack=MS,Slot=5,PlugInUnit=1
timingUnit1TagExistInDefaultTemplateFile for TU1 == true
strValue for TU1 == ManagedElement=1,Equipment=1,Subrack=MS,SlottimingUnit1TagExistInDefaultTemplateFile for TU1 == true
strValue for TU1 == =4,PlugInUnit=1
as you can see it parses the Tag <RNC_Module_LDN_TU1> twice and splits it in2 pieces. does anyone know why this is? Also I added a dirty hack whcih works:
private int timimngUnit1Tagcounter = 0;
    private int timimngUnit2Tagcounter = 0;
if( timimngUnit1Tagcounter == 0) {
                tempTU1 = strValue;
                timimngUnit1Tagcounter++;
                Trace.message("FIRST TIME STRVALUE === "+strValue);
                tTemplate.setRNC_Module_LDN_TU1( strValue );
            else {
                Trace.message("SECOND TIME STRVALUE === " + tempTU1+strValue);
                 tTemplate.setRNC_Module_LDN_TU1( tempTU1+strValue );
                 timimngUnit1Tagcounter = 0;
            }but now the parser is screwing up other tags in the file; anyone have any ideas?
Thanks,
Vinnie

In which method is the code you've posted called?
Given your results, I'd suspect that it's in characters, and strValue is a string created from the character data passed in.
in that case, read
http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int)
in particular
The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
The accepted pattern of use where you want to process all character data between tags in one go is to use a StringBuffer to acculmulate the characters, then process them in the following endElement or beginElement method.
Pete

Similar Messages

  • Sax XML Parser? URLDecoder.decode bad in applet? Explorer Browser jvm?

    Ok, here it goes folks, I have a serious problem with Explorers jvm, I'm developing using jdk 1.3.1 to write swing applets, in anyevent little functions that I use will not work with Explorers Browser, for example, the Explorer JVM understands the Vector addElement function, but not the Vector add function? Also, It doesn't recognize the HashMap class? Ok, is there anyway to control the JVM used with Explorer? Ok, but here goes my real question?
    I am writing an applet/servlet that interfaces with an oracle database. The data is returned in the form of xml. We are using the Sax XML parser interface. The parser code previously in the servlet(server side) and worked fine, but I've now moved the parsing code to the applet side, however, it seems to not want to work on the applet side. It simply hangs? I think it's a jvm issue, I've been getting many hangs with seemingly standard classes and methods, such as URLDecoder.decode(). Anyone else run into this problem using the Sax XML Parser, I have no idea what classes in the SAX Parser could be giving us a problems, or if that is even my issue. Anyone else using SAX XML parsing in an applet with Explorer 5.5. or 5.0, please let me know, if you've had issues?
    Sorry, to be so long winded, and not explaining the problem very well.

    First, get Sun's Java Plug-in from http://java.sun.com/products/plugin/index-1.4.html
    and read up on how to make your browser use it instead.

  • WIJ 20002 xml Parser Problem - Rich Client

    Hi,
    I have a problem with the rich client on a new installation:
    Business Objects Enterprise XI 3.1 SP3 on Windows 2008 Standard.
    If I connect with the rich client "import document"is disabled.
    if I try to create a new document from the rich client it returns the error below (I used the rich client on two workstations):
    WIJ 20002
    Version: null
    Analisi dello stack:
    java.lang.RuntimeException: java.lang.RuntimeException: XML parser problem:
    XMLJaxpParser.parse(): Element type "ABOUT_Patentnumbers" must be followed by either attribute specification, ">" or "/>".
    at com.businessobjects.wp.xml.jaxp.XMLJaxpParser.parse (Unknown Source)
    at.com.businessobjects.webi.richclient.XMLviaOccaRC.getServerConfiguration (Unknown Source)
    Have you any solution?

    The fixpack 3.5 client resolves the problem.

  • SAX XML Parsing and Garbage Collection

    I'm writing an XML parser that is running extremely slow while parsing large documents, I believe due to garbage collection. The implementation just overloads the DefaultHandler and hands that to a SAX Parser. This works fine on 2500 line XML document, taking on average a second or two, but becomes untennable when the document size is increased by a factor of 10 (often taking 5+ minutes).
    I come from a C++ background and haven't dealt with automatic garbage collection at an expert level, so I'd appreciate any help. Below is a snapshot garbage collection done while a 25000 line document being parsed. It looks to me as the young objects are staying small, but older objects are going between 13M and 90M and back again. Is that what's happening? Can anyone give me leads as to what to look? Thanks in advance.
    [GC [DefNew: 6234K->0K(7168K), 0.0057359 secs] 15517K->13022K(101696K), 0.0057907 secs]
    [GC [DefNew: 6235K->0K(7168K), 0.0057748 secs] 19257K->16762K(101696K), 0.0060357 secs]
    [GC [DefNew: 6235K->0K(7168K), 0.0023584 secs] 22997K->18009K(101696K), 0.0024123 secs]
    [GC [DefNew: 6236K->0K(7168K), 0.0040785 secs] 24245K->20502K(101696K), 0.0041315 secs]
    [GC [DefNew: 4990K->0K(7168K), 0.0041025 secs] 25492K->22996K(101696K), 0.0041544 secs]
    [GC [DefNew: 4990K->0K(7168K), 0.0041486 secs] 27987K->25491K(101696K), 0.0042022 secs]
    [GC [DefNew: 4991K->0K(7168K), 0.0040782 secs] 30481K->27985K(101696K), 0.0041299 secs]
    [GC [DefNew: 4991K->0K(7168K), 0.0040935 secs] 32976K->30479K(101696K), 0.0046294 secs]
    [GC [DefNew: 4991K->0K(7168K), 0.0041433 secs] 35471K->32974K(101696K), 0.0041958 secs]
    [GC [DefNew: 4992K->0K(7168K), 0.0041114 secs] 37966K->35469K(101696K), 0.0041634 secs]
    [GC [DefNew: 6240K->0K(7168K), 0.0024190 secs] 41709K->36717K(101696K), 0.0024729 secs]
    [GC [DefNew: 6240K->0K(7168K), 0.0041377 secs] 42957K->39212K(101696K), 0.0041972 secs]
    [GC [DefNew: 4993K->0K(7168K), 0.0041234 secs] 44205K->41707K(101696K), 0.0041762 secs]
    [GC [DefNew: 4993K->0K(7168K), 0.0042827 secs] 46701K->44203K(101696K), 0.0046299 secs]
    [GC [DefNew: 4994K->0K(7168K), 0.0043195 secs] 49197K->46699K(101696K), 0.0043751 secs]
    [GC [DefNew: 4994K->0K(7168K), 0.0042740 secs] 51693K->49195K(101696K), 0.0043293 secs]
    [GC [DefNew: 4995K->0K(7168K), 0.0042044 secs] 54190K->51692K(101696K), 0.0042575 secs]
    [GC [DefNew: 4995K->0K(7168K), 0.0042237 secs] 56686K->54188K(101696K), 0.0042762 secs]
    [GC [DefNew: 4996K->1K(7168K), 0.0040036 secs] 59183K->56685K(101696K), 0.0040550 secs]
    [GC [DefNew: 4996K->1K(7168K), 0.0042095 secs] 61680K->59182K(101696K), 0.0045992 secs]
    [GC [DefNew: 4997K->1K(7168K), 0.0042193 secs] 64178K->61679K(101696K), 0.0042715 secs]
    [GC [DefNew: 4997K->1K(7168K), 0.0042301 secs] 66675K->64176K(101696K), 0.0042818 secs]
    [GC [DefNew: 4997K->1K(7168K), 0.0042726 secs] 69173K->66674K(101696K), 0.0043251 secs]
    [GC [DefNew: 4998K->1K(7168K), 0.0042564 secs] 71671K->69172K(101696K), 0.0043084 secs]
    [GC [DefNew: 4998K->1K(7168K), 0.0040301 secs] 74169K->71669K(101696K), 0.0040812 secs]
    [GC [DefNew: 4999K->1K(7168K), 0.0042656 secs] 76668K->74168K(101696K), 0.0047255 secs]
    [GC [DefNew: 4999K->1K(7168K), 0.0043100 secs] 79166K->76666K(101696K), 0.0043737 secs]
    [GC [DefNew: 5000K->1K(7168K), 0.0043492 secs] 81665K->79165K(101696K), 0.0044034 secs]
    [GC [DefNew: 5000K->1K(7168K), 0.0043165 secs] 84164K->81664K(101696K), 0.0043693 secs]
    [GC [DefNew: 5001K->1K(7168K), 0.0044196 secs] 86663K->84163K(101696K), 0.0044735 secs]
    [GC [DefNew: 5001K->1K(7168K), 0.0044439 secs] 89163K->86662K(101696K), 0.0044967 secs]
    [GC [DefNew: 5001K->1K(7168K), 0.0043983 secs] 91662K->89161K(101696K), 0.0045313 secs]
    [GC [DefNew: 5002K->1K(7168K), 0.0043422 secs] 94162K->91661K(101696K), 0.0043944 secs]
    [GC [DefNew: 5002K->1K(7168K), 0.0044223 secs] 96662K->94160K(101696K), 0.0044757 secs]
    [GC [DefNew: 5002K->1K(7168K), 0.0048545 secs][Tenured: 96659K->9291K(97032K), 0.0863445 secs] 99162K->9291K(104200K), 0.0913954 secs]

    I don't think I'm creating megabytes of data, not using hashes or other expandable arrays. I've copied and pasted some code from my overriding of a DefaultHandler to give better definition to the problem.
    I'm working with TPTP right now as a profiler. Are there any others you'd recommend?
         public void startElement(String uri, String localname, String qName, Attributes attribs)
         throws SAXException
              if(qName.equals("Line"))
                   attributes = attribs;
              else if(qName.equals("Note"))
                   attributes = attribs;
              else if(qName.equals("Selection"))
                   String idValue = attribs.getValue("id");
                   String oValue = attribs.getValue("off");
                   String lValue = attribs.getValue("len");
                   if(idValue != null && oValue != null && lValue != null)
                        if(isImport)
                             issueSelectionContainer.addUnloadedSelection(Integer.parseInt(idValue), Integer.parseInt(oValue), Integer.parseInt(lValue));
                        else
                             issueSelectionContainer.addSelection(Integer.parseInt(idValue), Integer.parseInt(oValue), Integer.parseInt(lValue));
              else if(qName.equals("Issue"))
                   attributes = attribs;
              if(qName.equals("IsFinal"))
                   isFinal = true;
         public void endElement(String uri, String localname, String qName)
         throws SAXException
              if(textElement.length() > 0)
                   if(qName.equals("Line"))
                        String qmValue = attributes.getValue("qm");
                        String lnValue = attributes.getValue("ln");
                        String pgValue = attributes.getValue("pg");
                        boolean qm = (qmValue != null && qmValue.equalsIgnoreCase("true"));
                        short ln = (lnValue != null) ? Short.parseShort(lnValue) : 0;
                        short pg;
                        if(pgValue != null)
                             pg = Short.parseShort(pgValue);
                             page = pg;
                        else
                             pg = page;
                        lineContainer.addLine(textElement + '\n', ln, pg, qm, null);
                   else if(qName.equals("Note"))
                        String lnValue = attributes.getValue("line");
                        if(lnValue != null)
                             int line = Integer.parseInt(lnValue);
                             try
                                  lineContainer.getLine(line).setNote(textElement);
                             catch (IndexOutOfBoundsException e)
                                  throw new SAXException("XML/Data mismatch.  Note on line \"" + line + "\" out of \"" + lineContainer.lineCount() + "\" lines", e);
                   else if(qName.equals("Issue") && isImport)
                        String idValue = attributes.getValue("id");
                        String cValue = attributes.getValue("color");
                        if(idValue != null && cValue != null)
                             issueSelectionContainer.addUnloadedIssueSelection(Integer.parseInt(idValue), new Color(Integer.parseInt(cValue)), textElement);
                   else if(qName.equals("Name"))
                        name = textElement;
                   else if(qName.equals("Description"))
                        description = textElement;
                   else if(qName.equals("CreationDate"))
                        date = getCalendarFromString(textElement);
                   textElement = "";
                   attributes = null;
         public void characters(char buf[], int offset, int len)
        throws SAXException
              textElement = new String(buf, offset, len);
        }

  • XML parsing problem

    Hi, my problem is :
    In my Application i want to parse an XML file with DOM parser. The problem is that in my Project "MyProject -> Project Properties -> Libraries and Classpath"
    I have included some 15 libraries which are useful for my Application: ADF Faces Runtime 11, ADF Web Runtime and etc.
    Problems are causing the libraries: BC4J Runtime,ADF Model Runtime, MDS Runtime Dependencies
    because when added my source which is parsing an XML file stops working.The source code is:
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    File file =
    new File("C:\\Documents and Settings\\ilia\\Desktop\\begin.xml");
    Document doc = db.parse(file);
    Element root = doc.getDocumentElement();
    NodeList dots = root.getElementsByTagName("w:t");
    Element firstDot = (Element)dots.item(0);
    String textValue = firstDot.getFirstChild().getNodeValue();
    I use DOM because i need to change some values in the XML file, but its not working neither for reading nor for writing.When debugging I see that it gets the root of the xml but " firstDot.getFirstChild().getNodeValue() " returns null and it breaks with NullPointerException. And that's only when the libraries mentioned above are added to the project. Without them it works just fine !
    I don't know, it's like when added the parser validates my xml against some schema and returns null.
    The xml file is very simple MS Word Document saved as .xml .But I don't think that's the problem.
    Thanks in advance !
    iliya

    Hi all,
    I found the solution to my problem.The right way to parse and change an XML file with DOM parser using the Oracle XML Parser v2 should look like this:
    JXDocumentBuilderFactory factory =
    (JXDocumentBuilderFactory)JXDocumentBuilderFactory.newInstance();
    JXDocumentBuilder documentBuilder =
    (JXDocumentBuilder)factory.newDocumentBuilder();
    File file = new File("c:/Documents and Settings/ilia/Desktop/begin.xml");
    InputStream input =
    new FileInputStream(file);
    XMLDocument xmlDocument = (XMLDocument)(documentBuilder.parse(input));
    System.out.println("Encoding: " + xmlDocument.getEncoding());
    System.out.println("Version: " + xmlDocument.getVersion());
    NodeList namespaceNodeList =
    xmlDocument.getElementsByTagNameNS("http://schemas.microsoft.com/office/word/2003/wordml","t");
    XMLElement namespaceElement17 = (XMLElement)namespaceNodeList.item(17);
    namespaceElement17.getFirstChild().setNodeValue("someString");

  • XML Parser Problem

    am using XML parser for PL/SQL in Oracle9i Enterprise Edition Release 9.0.1.1.1
    When i run the sample xml program, i get error which is as follows. While compiling no errors. But while executing it reports error as given below.
    SQL> execute domsample('c:\xml', 'family.xml', 'errors.txt');
    begin domsample('c:\xml', 'family.xml', 'errors.txt'); end;
    ORA-20100: Error occurred while parsing: No such file or directory
    ORA-06512: at "COMMODITYBACKCONNECT.XMLPARSER", line 22
    ORA-06512: at "COMMODITYBACKCONNECT.XMLPARSER", line 79
    ORA-06512: at "COMMODITYBACKCONNECT.DOMSAMPLE", line 80
    ORA-06512: at line 1
    What need to be done to rectify the above problem.
    when i do the following validation check
    SQL>
    SQL> select substr(dbms_java.longname(object_name),1,30) as class, status
    2 from all_objects
    3 where object_type = 'JAVA CLASS'
    4 and object_name = dbms_java.shortname('oracle/xml/parser/v2/DOMParser')
    5 ;
    CLASS STATUS
    oracle/xml/parser/v2/DOMParser VALID
    oracle/xml/parser/v2/DOMParser VALID
    Please advice to how remove the following error:
    ORA-20100: Error occurred while parsing: No such file or directory

    Found the solution on metalink. There is a file under /$ORACLE_HOME/javavm/install/init_security.sql
    which needs to be run under username where you are installing xml parser.
    This step is not in readme.txt file provided as a part of download from the OTN website.

  • Faces-config.xml XML parser problem ???

    I'm taking below error message when I was opening faces-config.xml file with diagram view, what's the exact solution of this problem???
    Message
    BME-99100: An error has been reported from the XML parser
    Cause
    The parse has reported the following error:
    <Line 24, Column 2>: XML-20201: (Fatal Error) Expected name instead of <.
    Action
    Thanks for all...
    Message was edited by:
    user559176

    I looked very well, there was'nt any error on line 24 about "<", I think if the size of faces-confic.xml file increased JDeveloper XML Parser cannot parse with high file size, what're other solutions?

  • XML parsing problems with Oracle XML parser for PL/SQL

    I am using the Oracle XML parser for PL/SQL to transform XML into HTML usign XSL. The parser gives me sporadic errors trying to parse various XML documents. For the same XML source, the XMLPARSER will parse without errors one day and the next day will give me errors such as "invalid char in text", "Expected ';'.", or even Java null pointer exceptions.
    I have verified that the XML sources are well formed, so I am pretty certain that the problems I am having are bugs in the XMLPARSER.
    Is there going to be a XML parser for PL/SQL version 2 that will fix these bugs? If so, when??? If not, is there anything else I could do to fix these problems?
    Thanks!

    You can use the latest version.

  • XML-Parser-Problem ? DataBindings.cpx

    Hello,
    Ok -I just will formulate my question somewhat different: It is possible that the XML-Parser has a Problem ? Please see the stuff below.
    I just got a warning:
    Project: D:\ORAJDev101320\jdev\mywork\LoginJSF\ViewController\ViewController.jpr
    D:\ORAJDev101320\jdev\mywork\LoginJSF\ViewController\src\login\DataBindings.cpx
    Warning(11,15): <Line 11, Column 15>: XML-24521: (Fehler) Element nicht abgeschlossen: 'Application'
    for the following xml file when compiling my sampe books (chapter9) code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <Application xmlns="http://xmlns.oracle.com/adfm/application"
    version="10.1.3.40.66" id="DataBindings" SeparateXMLFiles="false"
    Package="login" ClientType="Generic">
    <pageMap>
    <page path="/home.jsp" usageId="homePageDef"/>
    </pageMap>
    <pageDefinitionUsages>
    <page id="homePageDef" path="login.pageDefs.homePageDef"/>
    </pageDefinitionUsages>
    </Application>
    After trying a little bit it turned out that the message disappears when
    the :
    Application xmlns="http://xmlns.oracle.com/adfm/application"
    is rewritten to
    Application xmlns="http://xmlns.oracle.com/adfm/Application"
    (Application with a upper first A)
    I have to point out that previously I did not by hand coding in this file.
    Is this a known issue.?
    And will/could these change do cause other/addition problems somewhere ?
    Andre
    Message was edited by:
    andreml
    null

    How about adding this tag <dataControlUsages/>? My JDev doesn't complain about your content.
    just my 2 cents
    --olaf                                                                                                                                                                                                                                               

  • XML parser Problem in Oracle 9iAS

    Dear All,
    I am trying to parse a xml file by using a SAX Parser.
    I am getting error "oracle.xml.parser.v2.XMLParseException: Invalid InputSource.'. I have already included 'xerces.jar' in the classpath.
    But it is always taking oracle xml parser.
    How to change the default XML parser in Oracle 9ias.
    This is my report.jsp File
    &lt;%@ page import="java.io.*,java.util.*,java.sql.*,javax.sql.*,javax.naming.*,javax.jms.*,iims.util.*,javax.xml.parsers.*,org.xml.sax.*,org.xml.sax.helpers.*, org.w3c.dom.*"%&gt;
    &lt;%
    generateTree();
    %&gt;
    &lt;%!
         //This method is to be called during startup. It will generate the template and rule nodes.
         public static void generateTree() throws Exception
              //Proceed with this method if the template and rule trees are not built already.
              //if (nodeTemplate != null && nodeRule != null) return;
              // Validate
              Node nodeRule = parseXml("d:\\ora9ias\\j2ee\\home\\Reports\\IIMSReportsTemplate1.xml");
         }//generateTree
    %&gt;
    &lt;%!
         //parse the input file and return a node.
         private static Node parseXml(String fileName) throws Exception
              //Parse the input file
              Document objDocument = null;
              DocumentBuilder objDocumentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
              objDocument = objDocumentBuilder.parse(fileName);
              Node nodeRet = objDocument;
              return nodeRet;
         }//parseXml
    %&gt;
    Report template:
    &lt;ROOT&gt;
         &lt;HEADINGS&gt;
              &lt;HEADING1&gt;H1&lt;/HEADING1&gt;
              &lt;HEADING2&gt;H2&lt;/HEADING2&gt;
              &lt;HEADING3&gt;H3&lt;/HEADING3&gt;
              &lt;HEADING4&gt;H4&lt;/HEADING4&gt;
              &lt;HEADING5&gt;H5&lt;/HEADING5&gt;
              &lt;HEADING6&gt;H6&lt;/HEADING6&gt;
         &lt;/HEADINGS&gt;
         &lt;ROWSETS&gt;
              &lt;ROWSET&gt;
                   &lt;COLHDRS&gt;
                   &lt;/COLHDRS&gt;
                   &lt;ROWS&gt;
                   &lt;/ROWS&gt;
              &lt;/ROWSET&gt;
         &lt;/ROWSETS&gt;
         &lt;Footer&gt;
              &lt;PageNo&gt;Generate&lt;/PageNo&gt;
              &lt;Date&gt;SystemDate&lt;/Date&gt;
         &lt;/Footer&gt;
    &lt;/ROOT&gt;
    Stack Trace:
    strRuleFileD:\ora9ias\j2ee\home\Reports\IIMSReportsRules.xml
    oracle.xml.parser.v2.XMLParseException: Invalid InputSource.
    at oracle.xml.parser.v2.XMLError.flushErrors(XMLError.java:145)
    at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:208)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:140)
    at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:96)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:165)
    at iims.REPORTS.IIMSGenerateReport.parseXml(IIMSGenerateReport.java:115)
    at iims.REPORTS.IIMSGenerateReport.generateTree(IIMSGenerateReport.java:
    100)
    at iims.REPORTS.IIMSGenerateReport.buildXML(IIMSGenerateReport.java:147)
    at PCREPORT_PROCESS.processBody(PCREPORT_PROCESS.java:3248)
    at PCREPORT_PROCESS.doPost(PCREPORT_PROCESS.java:100)
    at PCREPORT_PROCESS.doGet(PCREPORT_PROCESS.java:92)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:244)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterC
    hain.java:59)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:523)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:269)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:735)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java
    :151)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    Please advise.
    Thanks
    Siva Kishor Rao U

    Adding Xerces XML parser is not enough to make it work. Since some version of JDK (I think 1.4.X) XML parser is included and for older version it can be setup like a runtime option. And this is probably how ORACLE is using its XML parser. If you want to use different parser, you have to pass runtime option to JVM - for Xalan it looks like this:
    -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
    ...this way it becomes default parser factory used by javax interface functions. Look for documentation on xml.apache.org
    Myrra

  • How to use sax xml parser

    hi was wondering if someone could give me an example on how to use sax
    and a document handler and explain a bit

    to use sax parsers you need basically to extends handlerBase wich will force you to have the 3 following methods
    // imports for the sax portion of the manager,
    // the portion that will permit the interpretation of
    import com.sun.xml.parser.Resolver;
    import org.xml.sax.*;
    import org.xml.sax.helpers.ParserFactory;
    public class XMLManager extends HandlerBase
    private String currentElement = null; //current element name for parsing
    * Default constructor
    public XMLManager()
    /*SAX METHODS*/
    * This method is called when the SAX parser encounters an open element
    * tag. Must remember which element tag was just opened (so that the
    * characters(..) method can do something useful with the data that is
    * read by the parser.
    public void startElement(String name,AttributeList atts){
    if( name.equalsIgnoreCase("MY XML TAG NAME") )
    currentElement = "MY XML TAG NAME";
    //then do stuff for that type of tag
    * This method is called when the SAX parser encounters a close element
    * tag. If the message tag is closed it means the message is valid and ready
    * to be treated
    public void endElement(String name){
    currentElement = "";
    * This method is called when the SAX parser encounters #PCDATA or CDATA.
    * It is important to remember which element tag was just opened so that
    * this data can be put in the right object or variable.
    * Also the start index and length integer must be used to retrieve only
    * a portion of the data stored in the char[]
    * This section will only contain treatment for tags wich have content
    * between start and end tags
    public void characters(char ch[],int start,int length){
    //dont read ch[] , use the
    //range provided by the SAX parser.
    String value = new String(ch,start ,length);
    Once you have defined these 3 methods, define a method called for example parseIt(String mss) wich will contain the following code to parse the content of a string mss, a string containing xml data
    try
    //create an InputSource from the XML source received
    StringReader r = new StringReader(mss);
    InputSource is = new InputSource( r );
    //create a SAX parser using SAX interfaces and classes
    String parserClassName = "com.sun.xml.parser.Parser";
    org.xml.sax.Parser parser = org.xml.sax.helpers.ParserFactory.makeParser(parserClassName);
    //create document handler to do something useful
    //with the XML document being parsed by the parser.
    parser.setDocumentHandler(this);
    parser.parse(is);
    catch(Throwable t){System.out.println(t);t.printStackTrace();}
    you can't fail with this ;)

  • XML Parsing - problem with a value of an element if starting with space

    Hi Experts,
    I need your valuable guidence to get out of a problem in parsing an XML file.
    An XML file is read into xstring variable and it is processed to be split into the corresponding itab.
    Please find the code below
    types: begin of ty-itab,
                field(4096),
              end of ty-itab.
    Data:
    g_ixml                       TYPE REF TO if_ixml,
    g_ixmldocument               TYPE REF TO if_ixml_document,
    g_ixmlstreamfactory          TYPE REF TO if_ixml_stream_factory,
    g_ixmlstream                 TYPE REF TO if_ixml_istream,
    g_ixmlparser              TYPE REF TO if_ixml_parser,
    g_ixmlnodemainlist        TYPE REF TO if_ixml_node_list,
    g_ixmlnodelistmainelement TYPE REF TO if_ixml_node_list,
    g_sxmldata                TYPE string,
    g_ixmlnode                TYPE REF TO if_ixml_node.
      DATA: wa_xmltab TYPE xstring,
                itab type table of ty-itab.
    OPEN DATASET l_file IN BINARY MODE FOR INPUT MESSAGE v_msg.
    READ DATASET l_file INTO wa_xmltab.
    PERFORM f_create_xmltable USING wa_xmltab
                                  CHANGING v_msg.
    IF NOT v_msg IS INITIAL.
          msg = v_msg.
          EXIT.
        ELSE.
          itab[] = it_xmldata[].
        ENDIF.
    CLOSE DATASET l_file.
    Subroutine to convert xstring to char type ITAB.
    FORM f_create_xmltable USING  value(pi_inputxmlstring) TYPE xstring
                           CHANGING v_msg.
    *-- create the main factory
      g_ixml = cl_ixml=>create( ).
    *-- create the initial document
      g_ixmldocument = g_ixml->create_document( ).
    *-- create the stream factory
      g_ixmlstreamfactory = g_ixml->create_stream_factory( ).
    *create input stream
      g_ixmlstream = g_ixmlstreamfactory->create_istream_xstring( string =
    pi_inputxmlstring ).
    *-- create the parser
      g_ixmlparser = g_ixml->create_parser( stream_factory =
    g_ixmlstreamfactory
                                      istream        = g_ixmlstream
                                      document       = g_ixmldocument ).
    *-- parse the stream
      IF g_ixmlparser->parse( ) NE 0.
    *if parser cannot be created then give error exit
        IF g_ixmlparser->num_errors( ) NE 0.
          EXIT.
        ENDIF.
      ENDIF.
    *-- we don't need the stream any more, so let's close it...
      CALL METHOD g_ixmlstream->close( ).
      CLEAR g_ixmlstream.
    *get the number of main nodes of the XML document
      g_ixmlnodemainlist = g_ixmldocument->get_children( ).
    *set number of elemtns
      g_inummainelements = 0.
      g_imainelementsctr = 0.
      g_inummainelements = g_ixmlnodemainlist->get_length( ).
      g_ifirstlevelctr = 0.
    *loop through the document till all have nodes have been covered.
      WHILE g_ifirstlevelctr LT g_inummainelements.
    *get the first node
        g_ixmlnode = g_ixmlnodemainlist->get_item( g_ifirstlevelctr ).
    *check the type of node
        g_isnodeelement = g_ixmlnode->get_type( ).
    *if node is not of type Element then continue
    *because we have got to read only text from element nodes.
        IF g_isnodeelement NE c_nodeelement.
          g_ifirstlevelctr = g_ifirstlevelctr + 1.
          CONTINUE.
        ENDIF.
    *get nodes of the element just found.
        g_ixmlnodelistmainelement = g_ixmlnode->get_children( ).
    *get number of children of main element
        g_inumchildelements = g_ixmlnodelistmainelement->get_length( ).
    *loop trhough the number of children
        WHILE g_imainelementsctr LT g_inumchildelements.
          g_ixmlnodemainelement = g_ixmlnodelistmainelement->get_item(
        g_imainelementsctr ).
    *get type of node
          g_isnodeelement = g_ixmlnodemainelement->get_type( ).
          IF g_isnodeelement NE c_nodeelement.
            g_imainelementsctr = g_imainelementsctr + 1.
            CONTINUE.
          ENDIF.
    *get name of the node.
          g_selementvalue = g_ixmlnodemainelement->get_name( ).
    *get children of node
          g_childnodelist = g_ixmlnodemainelement->get_children( ).
          g_inumchildren =  g_childnodelist->get_length( ).
          g_ichildelementcounter = 0.
    *while there are number of children of node.loop through
          WHILE g_ichildelementcounter LT g_inumchildren.
    *get the child node
            g_childnode = g_childnodelist->get_item(
    g_ichildelementcounter ).
    *check the type of node
            g_isnodeelement = g_childnode->get_type( ).
    *if node is not of element type continue
            IF g_isnodeelement NE c_nodeelement.
              g_ichildelementcounter = g_ichildelementcounter + 1.
              CONTINUE.
            ENDIF.
    *otherwise get element name
            g_selementname = g_childnode->get_name( ).
    *get value stored in this node.
            g_selementvalue = g_childnode->get_value( ).
            g_numelem = g_inumchildren - 1.
            IF g_ichildelementcounter EQ g_numelem.
              CONCATENATE: g_slinedata g_selementvalue
                      INTO g_slinedata.
            ELSE.
    *      store the value of noide in delimiter ~ line
    *      Check for Invalid characters in file
                IF g_selementvalue CA '&'.
                  REPLACE ALL OCCURRENCES OF '&amp;' IN g_selementvalue WITH
                endif.
    *if value contains delimiter then error
                IF g_selementvalue CA '~'.             
                  V_MSG = text-003.
                  EXIT.
                ELSE.
                  CONCATENATE: g_slinedata g_selementvalue '~'  .
                  INTO g_slinedata.
                ENDIF.
            ENDIF.
    *continue
            g_ichildelementcounter = g_ichildelementcounter + 1.
          ENDWHILE.
          g_ichildelementcounter = 0.
    *increment the main element counter by one to go to the next node
          g_imainelementsctr = g_imainelementsctr  + 1.
    *move the current delimiter line creted to internal table to be given
    *back to the calling program
          MOVE g_slinedata TO wa_xmldata-data.
          APPEND wa_xmldata TO it_xmldata.
          MOVE '' TO g_slinedata.
          MOVE '' TO wa_xmldata-data.
        ENDWHILE.
    *increment counter to move to hte next node.
        g_ifirstlevelctr = g_ifirstlevelctr + 1.
        g_imainelementsctr = 0.
      ENDWHILE.
    ENDFORM.                    "f_create_xmltable
    XML structure
    <?xml version="1.0" encoding="utf-8"?>
    <ABCInbound xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\XYZSchema\ABCInbound.xsd">
    <HH>
    <RecordType>HH</RecordType>
    <Source>ABC</Source>
    <Destination>XYZ</Destination>
    <TimeStamp>20050909220546</TimeStamp>
    </HH>
    <BH>
    <RecordType>BH</RecordType>
    <DocType>AB</DocType>
    <Reference>2205516125</Reference>
    <DocumentDate>20080909</DocumentDate>
    <PostingDate></PostingDate>
    <CompanyCode>ABC</CompanyCode>
    <Currency>INR</Currency>
    <ExchangeRate>1.0000</ExchangeRate>
    <Park></Park>
    <ItemNumber>2</ItemNumber>
    </BH>
    <BL>
    <RecordType>BL</RecordType>
    <Reference>2205516125</Reference>
    <RefLineItem>1</RefLineItem>
    <AcctType>K</AcctType>
    <DrCrIndicator>H</DrCrIndicator>
    <Account>01000003</Account>
    <Amount>364.00</Amount>
    <VendorName-1>TOM &amp; JERRY IS MY</VendorName-1>
    <VendorName-2> NAME TO BE PAID</VendorName-2>
    <VendorName-3>1987566Z</VendorName-3>
    <VendorName-4>22</VendorName-4>
    <Street>UCX STREET</Street>
    <City>ROAD 4</City>
    <PostalCode>515004</PostalCode>
    <Country>IND</Country>
    <ContactPerson></ContactPerson>
    <AlternatePayeeCode></AlternatePayeeCode>
    <AlternatePayeeName-1></AlternatePayeeName-1>
    <AlternatePayeeName-2></AlternatePayeeName-2>
    <AlternatePayeeName-3></AlternatePayeeName-3>
    <PaymentTerms></PaymentTerms>
    <BaselineDate></BaselineDate>
    <PaymentMethods></PaymentMethods>
    <Allocation></Allocation>
    <LineItemText>item text</LineItemText>
    <TaxCode></TaxCode>
    <TaxAmount>0.00</TaxAmount>
    <WHTaxCode></WHTaxCode>
    <WHTaxbase>0.00</WHTaxbase>
    <Fund></Fund>
    <FundCenter></FundCenter>
    <CostCenter></CostCenter>
    <InternalOrder></InternalOrder>
    <TaxAutomatically></TaxAutomatically>
    <SpecialGLIndicator></SpecialGLIndicator>
    </BL>
    <TT>
    <RecordType>TT</RecordType>
    <TotalRecords>1</TotalRecords>
    <TotalValue>222</TotalValue>
    </TT>
    </ABCInbound>
    when the above xml file is read and populated into ITAB, for element vendorname-2 which has a space in first position , that space is ignored.
    This is being used for a FB01 posting and vendor is paid based on Name1+Name2 printed on cheque and due to the space ignoring problem, the vendor name is displayed wrongly thus causing problems.
    I appreciate if someone could guide me thru and help me in solving this problem.
    How to preserve the leading or trailing space.
    g_selementvalue = g_childnode->get_value( ).
    when i check g_selementvalue, space is ignored.
    i will be greateful if someone could guide me through.
    Regards,
    Simha
    Edited by: Simha on Dec 11, 2008 10:49 AM

    0.02: A C C E P T: Request="NEXT"
    0.06: Fetch session state from database
    0.08: ...Check session ... owner
    0.08: ...Metadata: Fetch Page, Computation, Process, and Branch
    0.08: Session: Fetch session header information
    0.08: ...Metadata: Fetch page attributes for application ..., page 330
    0.08: ...Validate item page affinity.
    0.08: ...Validate hidden_protected items.
    0.08: ...Check authorization security schemes
    0.08: Session State: Save form items and p_arg_values
    0.08: ...Session State: Save "P330_PROJECT" - saving same value: ""
    0.09: ...Session State: Saved Item "P330_SHUTTLE" New Value=""
    0.09: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.09: Branch point: BEFORE_COMPUTATION
    0.09: Computation point: AFTER_SUBMIT
    0.09: Tabs: Perform Branching for Tab Requests
    0.09: Branch point: BEFORE_VALIDATION
    0.09: ...Evaluating Branch: BEFORE_VALIDATION type: "REDIRECT_URL" button: 12904321314585385 branch: (Unconditional)
    0.09: Perform validations:
    0.09: ...Item Not Null Validation: P330_SHUTTLE
    0.09: ...Validation did NOT pass
    This is from debugging, what does the point "0.09: ...Session State: Saved Item "P330_SHUTTLE" New Value="" "
    mean ? I think it means, that the Shuttle somehow sets itself to null ?! but i dont understand why...
    There is no computation or anything that deletes the shuttle, the page is quite small, there is not much more than the shuttle and the validations and computations to give default value and transforming the shuttle items into a collection to continue working with the IDs.
    I dont check whats the problem
    Edited by: user12154443 on 21.07.2010 09:47

  • PL/SQL XML Parser (problem getting text of a node)

    I am trying to get the contents of an ELEMENT (node with a CDATA section) using xmldom.getNodeValue(). However, it seems that there is a MAXIMUM number of characters that I can get back.
    I think I've found a work-around using xmldom.writeToBuffer() which seems to write all of the CDATA contents to a VARCHAR2 variable. Now my problem is that it is using strings like '&#60' and '&#38'. I recognize these strings as being "internal representations of '<' and '&' respectively. I'd not have to replace every occurence of these types of strings with the ASCII equivalent -especially since I don't know all of the possible '&#nn' strings that may crop up.
    Help!

    The use of "//" or "\\" appears to be a bug in JServer. It has
    been filed. You should not specify the path as a shared
    directory as a workaround.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Andre (guest) wrote:
    : Oracle 8.1.5 database on NT
    : When i try running the example with command:
    : SQL*Plus> exec domsample
    : ('//SERVER_03/ORACLE/xml_tmp','family.xml', 'err.txt');
    : I get the following error:
    : ERROR at line 1:
    : ORA-20100: Error occurred while parsing:
    : //ORACLE/xml_tmp/err.txt
    : ORA-06512: at "OEF1_MGR.XMLPARSER", line 43
    : ORA-06512: at "OEF1_MGR.XMLPARSER", line 120
    : ORA-06512: at "OEF1_MGR.DOMSAMPLE", line 80
    : ORA-06512: at line 1
    : If i use backward-slashes '\' which should be OK for NT i get:
    : ORA-20100: Error occurred while parsing:
    : \\ORACLE\xml_tmp/err.txt
    : I tried using a directory (create directory ...) but this
    : results in the same error.
    : Thus anyone now how it should be done?
    : Thanks
    null

  • Sax xml format problem

    I must parse an xml file(quite large) and there is an "<" character inside of an attribute name (instead of "& lt").
    Of course it appears an SAXParseException and the program stops; the attribute name is not important for me (for example I could ignore < ), but I want that the program to continue to parse.
    Which is the best way to solve this problem?
    thanks, liviu

    XML parsers will not parse documents unless they are well-formed XML.
    Your document is not well-formed XML.
    Therefore it follows that you must fix the document. Contact the person who sent it to you and tell them not to send you garbage any more.

  • SAX XML Parsing

    I am very new to JAVA, but been doing JavaScript for many years. I am working in an Eclipse based editor. I have the task of reading an XML file, parsing it, using the tags as table and fields, and the values as parameters. I was successfully able to parse the XML easily with SAX, but I am having a hell of a time controling my values.
    Can someone point me in the right direction on how to distinguish the tag values from the data values returned from XML? I basically need to write select statements based on these XLM files, retrieve the data from SQL, then build the output in an XML structure.
    One more thing; this has to be dynamic. It needs to be able to accept random XML structures because I'll never know what is going to be imported in.
    Thanks for any help.
    -Motley Drew

    Sorry, I've never done much with XML, so i don't know
    the proper terminology. Here is a simple sample of
    what I mean.
    <customer>
    <name>MonkeyBoy Inc</name>
    <state>AZ</state>
    </customer>Okay. In that example, "customer", "name", and "state" are element names. Your example shows a "customer" element. It has for children a "name" element and a "statement" element (plus some whitespace text elements). The "name" element and the "state" element both have a single child, a text node in both cases.
    If you're using a SAX parser then the startElement() method gives you an element name. The characters() method gives you characters from a text node. Beware of this because it will give you the whitespace that you want to ignore, and it can give you a text node in pieces (more than one call).
    The term "tag" does exist in XML but it is restricted to talking about begin tags (the <customer> bit at the start of the element) and end tags (the </customer> bit at the end of the element).

Maybe you are looking for

  • Software updates

    Luv how the Ipod freezes after you update Itunes.

  • Apex using result_cache has an invalid status for wwv_flow_language query

    In the v_$result_cache_objects view of SYS I noticed that Apex is using the result_cache feature of 11g. Some of the Apex queries will have the status 'PUBLISHED', but others have the status 'INVALID' Why does the "SELECT /*+ result_cache */ NLS_LANG

  • Third Party Application Integration with Oracle EBS Without any middleware

    Hi, Please give suggestions about the Third Party Application Integration with Oracle EBS Without any middleware. Can we achieve this? Thank you, Muhammad Nasir Edited by: User129 on Feb 4, 2013 3:45 AM

  • Error while strarting SOA service (oracle.ias.opmn.optic.OpticControlExcept

    Hi All , Am facing a big problem with SOA suite installed in Windows vista , first time it worked fine but now am not able to start the service . If am creating a integration service connection in Jdeveloper it showing Failed for BPEL PM and ESB . Fo

  • Get/set methods

    I've been programming in java for a while now, but just recently i started wondering about something. Doesn't get/set methods that contain no other code defeat the point of encapsulation? i.e public void getXxx() { return xxx; But now to the importan