Parsing a java expression

Write a program in Java that can parse a mathematical expression
String, calculate the expression, and produce a numeric result.
For example, given the string: "2.5+3*4+6/12-7" produce the result 8.0
Requirements: Parser
* expression can contain Integers or floating-point numbers
* expression can contain Operators for addition, subtraction, division
and multiplication
* parser should throw an Exception when the expression is invalid
Requirements: Solution
* Implement the solution in Java
* Compile and test the solution
* The solution should demonstrate good modularity, be self-contained,
reusable and extensible.
* The solution should be clearly written, easy to read, documented, and
production-quality.
Requirements: quality
* This is a timed exercise and should be completed quickly, however you
should take sufficient time to produce a quality result
* A quality solution is simple, concise, complete, well documented,
readable, adaptable, reusable, testable and robust.

If your assignment was to:
1) figure out how to create a login on the forums
2) cut-and-paste verbiage given to you by someone
3) create a topic in the forums with the above
then you get an 'A'. Congratulations!

Similar Messages

  • ANN: Oracle XML Parser for Java v2.0.2

    The new version of the Oracle XML Parser for Java v2 is
    available for download and has the following features and
    changes:
    1. Conformance to the XSLT/XPATH August WD.
    Note that there are several changes between April99 XSLT draft
    and the August99 XSLT/Xpath draft and these changes have been
    implemented in the XSL Processor. The XSL Processor has been
    modified to accept XPath syntax for expressions and patterns.
    Stylesheets might have to be modified to be conformant to the
    August XSLT/XPath draft before they can be used with this
    release.
    Some of the changes between April draft and the August draft
    are:
    a. Expressions in the stylesheet must match the XPath
    production Expr.
    b. Some of the attribute names and element names in XSL
    namespace have changed.
    c. Some new functions have been added to XPath CORE function
    library.
    Please refer to the August XSLT/XPath draft for more details.
    This is the first production release for v2.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

    The link has been fixed. You will go to the v2 download page
    now. Sorry for the inconvience.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Renilton Oliveira (guest) wrote:
    : I didn't find the file for version 2.0.0.0 as well.
    : Renilton
    : Andrei Filimonov (guest) wrote:
    : : I tried to download XML Parser for Java v2 it seems that
    only
    : v
    : : 1.0.1.4 is available. Could you please give an exact URL for
    : v2
    : : download?
    : : Andrei Filimonov
    : : Oracle XML Team wrote:
    : : : The Oracle XML v2 parser is now available for download
    here
    : as
    : : : an early beta release and is written in Java. It features
    : an
    : : : improved architecture over the Oracle XML v1 parser and
    has
    : : : shown better performance on small to large XML documents.
    : It
    : : : will also be able to format the XML document according to
    a
    : : : stylesheet, having integrated an XSLT processor.
    : : : Version 2 of the XML Parser for Java, besides
    incorporating
    : an
    : : : XSLT processor, has been re-architected from version 1.
    This
    : : has
    : : : resulted in a number of changes to the class names
    : especially
    : : : those that support Namespaces. See v2changes.txt and
    : the .diff
    : : : difference files in the sample directory.
    : : : Oracle XML Team
    : : : http://technet.oracle.com
    : : : Oracle Technology Network
    null

  • Parsing an Algebraic Expression

    Hi ,
    Can any body provide me an idea to parse an algebraic expression in Java.Are there any built in classes for parsing an expression and evaluating after substituting the values for variables in the expression?
    If no classes are availble,plz provide me any algorithm for doing that.
    Thanks in Advance

    Observe:
    Parsing an expression is essentially the act of converting the expression from infix notation to postfix notation. Infix requires parens and precedence to specify order of operations but post fix unambiguously specifies them by the order of the tokens
    So something like
    "a+b*c" becomes "a b c * +"
    "a*b+c" becomes "a b * c +"
    "(a+b)*c" becomes "a b + c *"
    notice that arguments (variables and numbers, the leaves of the implied expression tree) occur in the same sequence in both the infix and the postfix notation. Thus you can view the parsing as a filtering process that passes arguments directly from input to output and all the filter is doing is re-arranging the order of the operators.
    All this rearranging of operators can be done with a single stack and it is all based on this observation:
    When you saw a string like "a op1 b op2 c" you run across the token for the first operator before you have even collected its right argument. You must put that operator somewhere and a OpStack is the place to put it. You don't know whether to emit op1 until you have had a look at the next operator, op2. If op2 was higher priority than op1, then op2 gets to consume the argument b first. In that case op2 just gets added to the stack on top of op1.
    However if op2 was less than or equal in precedence to op1, well then op1 can now be flowed to the output stream and allowed to act on the b argument that is already out on the output stream.
    This means that the fundamental operation of the expression parser is the business of pushing an opertor token onto the stack, but first spewing to the output all the other operators on the stack that had a higher or equal priority. If we give this function a name like opStack.pushSpew(token) it could look something like this:
    class OpStack{
      Stack s = new Stack();
      void pushSpew(List out, Token t){
        Token tos;
        while(!s.empty() && (tos = peek()).priority >= t.priority){out.add(pop());}
        push(t);
    }Next thing to observe is that a grouper, like open and close parens, behaves in the following way. An open paren acts like a very high priority operator when pushed to the stack in that it spews nothing. The previous op is NOT allowed to eat the argument that is about to come right after the open paren. However once the open paren marks the stack, the open should be a lower priority than any real op that gets pushed onto the stack above it because it must delay going out until every real op in the group had its shot. The close paren should also act like a very low priority op. It should spew every op upto but not including the open paren that started this group.
    As a computation trick, if you set the priority of an open lowest of all, and the priority of a close just above that, and you just push the open onto the stack instead of pushSpewing it onto the stack, you will get the desired behavior. You with then pushSpew the close paren and it will dump everything from the stack to the output up to but not including the open. At this point it is easy to check the balance. If you do not have an open/close pair sitting as the top two elements on the stack then the parens (or the brackets or the braces) were not properly nested.
    We are almost done. There are post fix operators like factorial and prefix operators like minus that we need to deal with. It only makes sense to evaluate these suckers from the inside out i.e. if you had a string of prefixs on an arg
    op1 op2 op3 arg
    the only sensible order is defined by parens like this
    (op1 (op2 (op3 arg) ) )
    and in post fix that would be
    arg op3 op2 op1
    that is exactly what you would get if you just pushed each prefix op onto the stack in the order you saw them and then popped them off after you dumped out the argument.
    Post ops should also work from the inside out
    arg op1 op2
    being
    ( (arg op1) op2 )
    and you get this behavior by just dumping a post op to the output when you see it.
    There is only one special concern. What should you do if you saw, both pre ops and post ops on the same arg?
    is "op1 arg op2" done like this: "(op1 arg) op2" or "op1 (arg op2)"? Well, why should these be any different from regular diadic ops, let precdence decide. An espression like minus three factorial "-3!" should be interpreted as take the factorial of 3 and then negate it (and not the other way around!) so let the priority of factorial be greater than that of minus and just do the standard pushSpew with post ops to let them spew out any high priority pre ops before they go onto the stack, but then unlike binary ops, the post op immediately comes off the stack and goes to the output because post ops bind up right away.
    Now if you are not careful with your precedences you could get "wierd" behavior. If for example you did not assign a high priority to a factorial, you could write expressions like "3+4!" and the priority would treat that like "(3+4)!" the plus would bind tighter than the factorial. It is hard for me to imagine a language where you would want the effects of either a postfix or a prefix operator to span across multiple arguments combined by single diadic operator, but that is really up to you. You certainly could have a language where you gave a very low precedence to ~ which could mean the boolean NOT, a lower precedence than the diadic operator >= which would allow you to write "~ a >= b" which would mean "~(a>=b)"
    After all it is your language, do what you want. None the less I would advise against alowing ANY pre or post op to have a priority LESS than that of ANY diadic operator.
    Lots of talk here but to recap, the code is quite simple:
    while((t = getNextToken()) != null){
      switch (t.type()){
        case ARG:  out.add(t); break; // arguments pass straight to output
        case PRE:  stack.push(t); break; // pre ops are just pushed (binding them to the next arg)
        case OPEN: stack.push(t); break; // Opens just push, they don't spew to output
        case DI: stack.pushSpew(out,t); break; // Diadic ops do the standard pushSpew
        case POST: stack.pushSpew(out,t); out.add(stack.pop()); break; //spew and then go out
        case CLOSE: stack.pushSpew(out,t); stack.removeOCpair(); // spew all ops in group
          // and then check if you had a balancing open
    }That just about does the entire parse. If you can find the tokens in the input you can rearrange them into the output. You do need to flush the opStack when you are done with the input stream and there is a convenient trick to doing that. The trick is this. Invent an invisible Open and Close pair, invisible meaning that they never show up in any input stream, you just made them up and pretended that that expression started with an invisible OpenExp and at the end it closed with a CloseExp.
    The CloseExp at the end will act like any grouper, it will flush the stack looking for the corresponding opener. IF there was any unbalanced grouper, like say an extra unbalanced open paren somewhere in the expression, the CloseExp will spew its way down to that unbalanced paren and then fail when it discovers that it does not match the open in the call to remove the OC pair. The is a way to do error detection. Use a fictional group on the entire expression to both flush the remainder of the opStack and to do a final check for unbalanced groupers.
    In fact, while we are on the topic of error checking there is another one that is very good to include. Basically in a real expression if you ignore the parens, the progression should be an alternation between args and diadic ops, with an occasional pre or post op thrown in.
    A simple count tells you where you are. Go up to 1 when you pass an argument, go back down to zero when you see a diadic operator. You should start at zero, because there have been no arguments or ops yet. In state zero the only legal things to do are to put in a pre op or an arg. Once you have an arg out there the only legal things to do are to have a post op or a diadic op. This little state machine will tell you if and when you have got either a pair of arguments together with no op between them, or a pair of ops with no argument between them. You should start at state = 0 and you should end at state = 1 (unless you allow empty expressions) So we can beef up the error checking with a very simple addition. The guts of the parse will now look like this:
    state = 0
    stack.push(Token.OpenExp); // start off with an open of the expression
    while((t = getNextToken()) != null){
      switch (t.type()){
        case ARG:  assertStateIs(0); out.add(t); state = 1; break;
        case PRE:  assertStateIs(0); stack.push(t); break;
        case OPEN: stack.push(t); break;
        case DI: assertStateIs(1); stack.pushSpew(out,t); state =0; break;
        case POST: assertStateIs(1);stack.pushSpew(out,t); out.add(stack.pop()); break;
        case CLOSE: stack.pushSpew(out,t); stack.removeOCpair();
    stack.pushSpew(out,Token.CloseExp); stack.removeOCpair();
    assertState(1);
    return out;So - there it is, in outline form the way that you parse an expression.You build 3 classes, Token, ExpressionParser, and OpStack
    Token is just a bucket that holds a name, a type (ARG, PRE, OPEN, DI, ...) and a precedence.
    OpStack is just a wrapper for a reqular stack that will hold Tokens and allow for a pushSpew function.
    ExpressionParser is little other than a Map full of all your Tokens. This map allows the parser to map substrings, tokens, that it finds in the input like >= to actual Tokens with a capital T. It will have two main methods:
    1) the parse method which I have almost completly written for you. It takes an input string and will fill up an output list placing the Tokens in post fix order, which is your parse tree.
    2) the routine getNextToken which will walk the input string, skipping white space when appropriate, looking for names, numbers, and operators and building each chunk that it finds into a Token.
    One last complexity note. If you want to allow functional notation like sqrt(3) you are using parens in a fundamentally different way than was described above (ditto when you use brackets to represent array indexing like x[5]) the fundamentally different thing that you are doing is that you are allowing an argument (a name) like "sqrt" to sit right next to another argument like "3" with no binary op in between. You are using an "implied" binary op at that point. You have saved the user from typing "sqrt FUNCTIONCALL (3)" or "x ARRAYINDEX 5"
    I will leave it as an exercise to the reader to see how you make a small modification to the OPEN case to detect and deal with an implied operation. Don't forget that you must tell the state error checker what you are doing.
    And now that I have shown you how fundamentally simple it is to build an expression parser let me comment on why you do not find a standard library routine for doing this.
    The primary reason is that there is no such thing as a "standard" math expression. Parsing is based on a language and there is no one language. Are you going to allow hex numbers in your expressions? How about scientific notation? Is = equality or assignment? Do you allow functional notation? Array indexing? Multi-dimensional array (like x[2,3])? How about string constants like "foobar"? How do you embed quotes in your quoted strings? Are you allowing comments, block comments, statements, code, Lisp expressions, complex numbers, implicit type conversion, type casting? At what point does it stop being a simple expression and start being a full computer language?
    Furthermore, most of the work you will quickly see if you use what I have suggested to build an expression parser, it how to give your user feedback that the expression that he typed had problems and where. There is no stardard UI for error feedback in things that don't parse correctly. Are you just going to dump cryptic strings to the console or are you going to highlight something in a text box somewhere?
    All the work turns out to be that of defining your language and determining your set of tokens and what precedence you will employ. Once you get that all worked out, parsing the expressions only takes the ten or fifteen lines of code that I outlined.
    And look, it only took several thousands of words to explain why it only takes about 15 lines of code to parse expressions once you have decided upon your language and written your tokenizer.
    Enjoy

  • ANN: Oracle XML Parser for Java v2.0.0.1

    A new maintenance release of the Oracle Parser for Java is
    available for download. It has the following fixes and changes:
    Bug fixes for #920536, i.e. Cannot access element attributes via
    XSLT; #898423. i.e. ElementDecl's in DTDs; #774774, i.e. DOM
    extensions using XSL pattern matching; #863890 i.e. SAX
    IOException not thrown.
    New APIs in the following new interface:
    1. oracle.xml.parser.v2.NSResolver
    - resolveNamespacePrefix( find the namespace definition in scope
    for a given namespace prefix )
    New APIs in the following classes:
    1. oracle.xml.parser.v2.XMLNode
    - selectNodes( Selects nodes from the tree which match the given
    pattern; client can provide an NSResolver implementation to
    resolve namespace prefixes in the pattern ).
    2. oracle.xml.parser.v2.ElementDecl
    - getParseTree( Returns the root Node of Content Model parse
    tree, which could then be traversed node by node using
    getFirstChild() and getLastChild(). The Node types are: PLUS,
    COMMA, ASTERISK, ELEMENT, QMARK ).
    This is the first beta patch release for v2.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

    unzip -l appsborg2.zip | grep 9.0.4
    0 04-18-03 20:10 .xdkjava_version_9.0.4.0.0_production
    do i still need to do that step?No, you do not have to since "XML Parser for Java v9.0.4" is already installed as part of appsborg2.zip

  • ANN: XML Parser for Java v2.0.2.6

    The v2.0.2.6 of the XML Parser for Java is now available for download. The following features and bug fixes are included:
    Changes:
    Conformance to the XSLT/XPATH October REC.
    New API in XSLStylesheet class:
    removeParam(String param)
    resetParams()
    Bug fixes:
    Bug #1111423: OutOfMemory exception, if multiple calls made to document()
    Bug #1101028: Unexpected character error in DTD parsing document using Docbook DTD
    Bug #1101021: #default not supported in exclude-result-prefixes
    Bug #1099830: Extra characters inserted into output using the XML Parser
    Bug #1099663: HTML output does not allow only doctype-public to be specified
    Bug #1099536: HTML output does not disable escaping for script, style unless lowercase
    Bug #1098738: ArrayOutOfBoundsException xsl:if test="not(@a)'"
    Bug #1095047: XSLProcessor NPE'S on named templates with non-empty namespaces
    Bug #1094971: XSLStylesheet needs methods for removing parameters
    Bug #1092351: Using valueof() shuffles order of elements in my source document
    Bug #1086663: xsl:sort data-type attribute can now be a namespace-prefixed name
    Bug #1086661: xsl:version attribute now required on literal result element
    Bug #1064692: Default xml-serialization should use empty-element syntax
    Bug #1064689: Current() function doesn't work correctly
    This is the sixth production patch release for v2.
    Oracle XML Team http://technet.oracle.com
    Oracle Technology Network
    null

    The link has been fixed. You will go to the v2 download page
    now. Sorry for the inconvience.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Renilton Oliveira (guest) wrote:
    : I didn't find the file for version 2.0.0.0 as well.
    : Renilton
    : Andrei Filimonov (guest) wrote:
    : : I tried to download XML Parser for Java v2 it seems that
    only
    : v
    : : 1.0.1.4 is available. Could you please give an exact URL for
    : v2
    : : download?
    : : Andrei Filimonov
    : : Oracle XML Team wrote:
    : : : The Oracle XML v2 parser is now available for download
    here
    : as
    : : : an early beta release and is written in Java. It features
    : an
    : : : improved architecture over the Oracle XML v1 parser and
    has
    : : : shown better performance on small to large XML documents.
    : It
    : : : will also be able to format the XML document according to
    a
    : : : stylesheet, having integrated an XSLT processor.
    : : : Version 2 of the XML Parser for Java, besides
    incorporating
    : an
    : : : XSLT processor, has been re-architected from version 1.
    This
    : : has
    : : : resulted in a number of changes to the class names
    : especially
    : : : those that support Namespaces. See v2changes.txt and
    : the .diff
    : : : difference files in the sample directory.
    : : : Oracle XML Team
    : : : http://technet.oracle.com
    : : : Oracle Technology Network
    null

  • Parse Exception : java.text.ParseException: Unparseable date

    I have inherited a UDF in some mapping that on the whole, works okay...
    but it throws an error after mapping a few dates:
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"
    Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"
    the first few map okay...  then i get the exception.
    the UDF is as follows:
    public String convertDateTimeToUTC(String strDate, Container container) throws StreamTransformationException{
    AbstractTrace trace = container.getTrace();
    Date date=null;
    SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
    try{
    String dt = strDate;
    date = sdfSource.parse(dt);
    trace.addInfo("Local Date:"+date);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    strDate = sdfDestination.format(date);
    catch(ParseException pe){
    trace.addInfo("Parse Exception : " + pe);
    return strDate;
    can anyone see why this fails after successfully mapping a few fields???

    the first mapping works correctly...
    then we reuse the same fields to map to the additional segments.
    the context is correct as it is trying to pull the same fields in...  it just throw the error with the same data in the same UDF/Function Library but for different segments! :o(
    http://img199.imageshack.us/img199/3104/dateconversion.jpg
    as you can see from the screenshot above, the mapping works in the first instance, then fails on subsequent nodes.

  • ORACLE XML PARSER FOR JAVA FOR AIX

    Hi people!
    I'm looking for the Oracle XML Parser for Java 9.0.2.0.0C, my 9iAS is BI Installation 9.0.2.3, where can I get it? In the Downloads Section there is only the version for 10g, and the existing versions for 9i are not for AIX (my OS is AIX 5.2L).
    Thanks.

    Thanks for your help, I navigate through this link and, even it shows a table where appears the release for AIX (9.2.0.6.0), when I get to http://www.oracle.com/technology/tech/xml/xdk/software/prod/utilsoft_java.htm
    it shows me only downloads for Sun, Linux and HP-UX, but not for AIX.
    Has the version for AIX being deprecated or something like that?

  • Parsing an XML using DOM parser in Java in Recursive fashion

    I need to parse an XML using DOM parser in Java. New tags can be added to the XML in future. Code should be written in such a way that even with new tags added there should not be any code change. I felt that parsing the XML recursively can solve this problem. Can any one please share sample Java code that parses XML recursively. Thanks in Advance.

    Actually, if you are planning to use DOM then you will be doing that task after you parse the data. But anyway, have you read any tutorials or books about how to process XML in Java? If not, my suggestion would be to start by doing that. You cannot learn that by fishing on forums. Try this one for example:
    http://www.cafeconleche.org/books/xmljava/chapters/index.html

  • Parsing xml using DOM parser in java

    hi there!!!
    i don have much idea about parsing xml.. i have an xml file which consists of details regarding indentation and spacing standards of C lang.. i need to read the file using DOM parser in java n store each of the attributes n elements in some data structure in java..
    need help as soon as possible!!!

    DOM is the easiest way to parse XML document, google for JDOM example it is very easy to implement.
    you need to know what is attribute, what is text content and what is Value in XML then easily you can parse your document with dom (watch for space[text#] in your XML document when you parse it).
    you get root node then nodelist of childs for root then go further inside, it is easy believe me.

  • ANN: XML Parser for Java v2.0.2.5

    The v2.0.2.5 of the XML Parser for Java is now available for
    download. The following features and bug fixes are included:
    Conformance to the XSLT/XPATH October PR.
    Support for internationalized error messages has been added. The
    locale can be set using setLocale(java.util.Locale) function in
    XSLProcessor, SAXParser, and DOMParser.
    New APIs in XMLNode class:
    value-of(String pattern)
    selectNodes(String pattern)
    selectSingleNode(String pattern)
    selectSingleNode(String pattern, NSResolver ns)
    New API in XSLStylesheet class
    setParam(String param, String value)
    Bug fixes:
    Bug #957465: Missing a way to set stylesheet-level param-
    variables
    Bug #962290: selectNodes() improvements
    Bug #1033472: Html output prints empty elements for non-empty
    elements
    Bug #1040717: Character entity for greater that in html output
    style
    Bug #1046003: Bug is parsing text nodes larger than 16K
    Bug #1051671: 'xsl:namespace-alias' not supported
    Bug #1052387: Disable-output-escaping doesn't flush while
    printing
    Bug #1053273: 'xsl:message' terminate attribute not supported
    Bug #1058004: No access to media-type and encoding on xsl:output
    Bug #1058008: xsl:version attribute not copied to result
    Bug #1061159: Exclude-result-prefixes not supported
    Bug #1067965: Bug in Non-validating parser while reading QNames
    in DTD
    This is the fifth production patch release for v2.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

    The link has been fixed. You will go to the v2 download page
    now. Sorry for the inconvience.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Renilton Oliveira (guest) wrote:
    : I didn't find the file for version 2.0.0.0 as well.
    : Renilton
    : Andrei Filimonov (guest) wrote:
    : : I tried to download XML Parser for Java v2 it seems that
    only
    : v
    : : 1.0.1.4 is available. Could you please give an exact URL for
    : v2
    : : download?
    : : Andrei Filimonov
    : : Oracle XML Team wrote:
    : : : The Oracle XML v2 parser is now available for download
    here
    : as
    : : : an early beta release and is written in Java. It features
    : an
    : : : improved architecture over the Oracle XML v1 parser and
    has
    : : : shown better performance on small to large XML documents.
    : It
    : : : will also be able to format the XML document according to
    a
    : : : stylesheet, having integrated an XSLT processor.
    : : : Version 2 of the XML Parser for Java, besides
    incorporating
    : an
    : : : XSLT processor, has been re-architected from version 1.
    This
    : : has
    : : : resulted in a number of changes to the class names
    : especially
    : : : those that support Namespaces. See v2changes.txt and
    : the .diff
    : : : difference files in the sample directory.
    : : : Oracle XML Team
    : : : http://technet.oracle.com
    : : : Oracle Technology Network
    null

  • Oracle XML Parser for Java

    Does the latest release of the Oracle XML Parser for Java support JDK 1.2.2?
    I have an application which makes use of the XML Parser which runs fine with JDK 1.1.7.
    But the application crashes with the use of JDK 1.2.2 .
    Any insight into this is appreciated.
    null

    The Oracle XSQL Servlet makes extensive use of the Oracle XML Parser for Java V2 as well as its XSLT Engine and runs without issue under 1.1.8 and 1.2.2.

  • XML parser for Java setup

    I download the XML Parser for Java 3.2.1 Release from the IBM site and I have JDK1.3 installed on my Windows 2000 PC. I've placed the files "xerces.jar" and "xalan.jar" in the location specified by the extensions mechanism (i.e "C:\JDK1.3\jre\lib\ext\").
    I downloaded an example where java uses XML but I get an error because it fails to import the following class:
    import com.ibm.xml.parser.Parser;
    Also in another application the same thing happens with this class:
    import com.ibm.xml.parser.TXDocument;
    If I remove the xerces and xalan JAR files from the directory mentioned above I get move errors so I presume I have the files in the right location. Do I need to place any other files in that DIR other than the xerces and xalan JAR files?
    Any help greatly appreciated!

    Not sure if you solved your problem.
    I think Xerces was handed over to the Apache organisation by IBM and the package names were then changed so that com.ibm would have become org.apache or whatever. At a guess nobody got round to changing the examples.

  • Parser for Java v2 decimal formatting bug

    XML Parser for Java v2 (up to 2.0.2.7) does not seem to format decimal numbers correctly with format-number() function. It can handle floats, but not doubles. When can this bug get fixed?
    BTW, is there a bug database for Java XML Parser?
    Thanks,
    null

    Thanks for your prompt response, here is one test:
    format.xml:
    <?xml version="1.0"?>
    <numberlist>
    <number>1234567.123456789</number>
    <number>12345678.123456789</number>
    <number>123456789.123456789</number>
    </numberlist>
    format.xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="number">
    <xsl:value-of select="format-number(current(), '#,##0.00000000')"/>
    </xsl:template>
    </xsl:stylesheet>
    The following output was generated from 2.0.2.7:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    1,234,567.12500000
    12,345,678.00000000
    123,456,792.00000000
    Apache Xalan 0.20 generates the following:
    <?xml version="1.0" encoding="UTF-8"?>
    1,234,567.12345679
    12,345,678.12345679
    123,456,789.12345679
    This problem also exists in v2 versions before 2.0.2.7.
    A month ago, I posted another bug report, but didn't get any reponse. Can someone look into the problem? I suspect XMLElement.setAttribute(name, value) doesn't add attributes of ID type to the internal list of ID's. The posting is at:
    http://technet.oracle.com:89/ubb/Forum11/HTML/000994.html
    Thanks,
    null

  • XML Parser for Java version 2.0.2.9

    I can no longer find the XML parser for Java (version 2.0.2.9) for Sun Solaris and Oracle version 8.1.7.3. This would be the file xmlparserv2.jar for parser version 2.0.2.9
    This file support the latest Oracle Applications work flow version and so is necessary but does not seem to be available. All notes on Metalink point to Techweb.
    Thanks for your help. -Erik Stromholt

    This is covered by patch for bug 2199206. Thanks

  • Upgrading Oracle XML Parser for Java v9.0.4 with Oracle Applications 11i

    Guys, I applied ATG.PF.H.RUP4. In postinstall steps it is mentioned,Upgrading Oracle XML Parser for Java v9.0.4 with Oracle Applications 11i(doc-271148.1)
    which says after applying patch 4038964 do the following--
    AUTOCONFIG ENABLED APPLICATIONS ENVIRONMENT
    If the Oracle E-Business Suite configuration files are maintained using the AutoConfig infrastructure, proceed with the following:
    1. Run the AutoConfig utility.
    2. Go to [JAVA_TOP].
    3. Run the unzip -l appsborg2.zip | grep 9.0.4 command. If there is a file named as .xdkjava_version_9.0.4.0.0_production, which indicates that XML Parser for Java v9.0.4 is installed correctly as part of appsborg2.zip. Otherwise, run ADAdmin to regenerate the appsborg2.zip file.
    4. Restart the application tier server processes such that the new version of Oracle XML Parser for Java will take effect.
    but actually the patch is already applied- 4038964. How do i verify if i need to do these steps or not.
    The xmlparserv2-904.zip file is already there in wrapper.classpath. of jserv.properties, forms.properties. So i think i dont need to do these steps.

    unzip -l appsborg2.zip | grep 9.0.4
    0 04-18-03 20:10 .xdkjava_version_9.0.4.0.0_production
    do i still need to do that step?No, you do not have to since "XML Parser for Java v9.0.4" is already installed as part of appsborg2.zip

Maybe you are looking for