Marquis Samuel | 1 Dec 2005 16:40
Picon
Favicon

java.lang.NumberFormatException

Hello,

I use xerces-j 1.4.4 with java 1.3.1 (no choice.)
For weeks I used it in a program to parse a file and it worked well but now
I got this:

java.lang.NumberFormatException: 20051411427
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111)

Nowhere do I say that this tag should contain a number (I have no DTD or
Schema); 
and the funny thing is that if 
I change its content to characters other than numbers, the file is parsed
without error.

If I understand well, the parse should just call my handler implementation
for any tag and
characters it meets; it should not try do convert the tag's content or the
caracters into anything,
right?
Also, I seems to me I have not changed any code related to this lately, so I
do not understand
what is wrong.

I made some tests:
-if I change the content of the file such as to replace the fautly
"20051411427" with
a string other than digits, it works;
-if I reduce the number of digits, it works : number too large?
-I have other 11-digits strings in the file, they do not produce errors.
(Continue reading)

Michael Glavassevich | 1 Dec 2005 22:57
Picon

Re: java.lang.NumberFormatException

Hi Samuel,

Line 1111 in org.apache.xerces.framework.XMLParser just wraps a 
RuntimeException which was thrown from somewhere else in the stack, 
possibly from application code. Are you sure that the handlers you've 
registered with the parser (or any methods they call) don't try to convert 
text into an integer? If that exception was thrown from parser code then 
it's probably a bug in Xerces 1.4.4. You haven't provided much information 
so I can't really tell. Can you post your XML document to the list?

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

Marquis Samuel <samuel.marquis <at> elca.ch> wrote on 12/01/2005 10:40:21 AM:

> Hello,
> 
> I use xerces-j 1.4.4 with java 1.3.1 (no choice.)
> For weeks I used it in a program to parse a file and it worked well but 
now
> I got this:
> 
> java.lang.NumberFormatException: 20051411427
>    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111)
> 
(Continue reading)

Lisa Bahler | 2 Dec 2005 22:15
Favicon

Multiple schema imports not handled

I am using Xerces 2.7.1.

A schema associated with one namespace is trying to import multiple 
schemas that are each associated with another namespace.  Only the first 
in a sequence of imports appears to be processed.  (The same thing 
happens if the sequence contains both includes and imports; the first 
such element, whether an import or include, is the only one that appears 
to be processed.)

When types from the schemas associated with all but the first import or 
include are encountered in the top level schema, I see a lot of 
unresolved references.

A sequence of includes works properly, by the way.  The issue is 
encountered only if imports are involved.

I created a simplified version of what I am seeing.  I have 3 schemas, 
all in the same directory.

Top.xsd:

> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> targetNamespace="topLevelNS" elementFormDefault="qualified" 
> attributeFormDefault="unqualified" xmlns="topLevelNS"
> xmlns:b = "bottomLevelNS">
>     <xs:import namespace="bottomLevelNS" schemaLocation="A.xsd"/>
>     <xs:import namespace="bottomLevelNS" schemaLocation="B.xsd"/>
>
>     <xs:element name="root">
(Continue reading)

Michael Glavassevich | 5 Dec 2005 04:37
Picon

Re: Multiple schema imports not handled

Hi Lisa,

Since the schemaLocation attribute is only a hint, schema processors are 
allowed to ignore all but the first import for a given namespace. This is 
what Xerces-J does by default. To instruct the parser to read from all the 
schema locations specified for a given namespace you need to set the 
honour-all-schemaLocations [1] feature to true.

Thanks.

[1] 
http://xerces.apache.org/xerces2-j/features.html#honour-all-schemaLocations

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

Lisa Bahler <bahler <at> research.telcordia.com> wrote on 12/02/2005 04:15:22 
PM:

> I am using Xerces 2.7.1.
> 
> A schema associated with one namespace is trying to import multiple 
> schemas that are each associated with another namespace.  Only the first 

> in a sequence of imports appears to be processed.  (The same thing 
> happens if the sequence contains both includes and imports; the first 
> such element, whether an import or include, is the only one that appears 
(Continue reading)

Lisa Bahler | 5 Dec 2005 05:56
Favicon

Re: Multiple schema imports not handled

Michael,

Thanks.  We had been using an older Xerces version, and before I sent my 
query, I tried our code with the latest version to see if that made a 
difference.  I was not aware of this new feature that was added with 
2.7, however, so I did not set that in my code.

Lisa

Michael Glavassevich wrote:

>Hi Lisa,
>
>Since the schemaLocation attribute is only a hint, schema processors are 
>allowed to ignore all but the first import for a given namespace. This is 
>what Xerces-J does by default. To instruct the parser to read from all the 
>schema locations specified for a given namespace you need to set the 
>honour-all-schemaLocations [1] feature to true.
>
>Thanks.
>
>[1] 
>http://xerces.apache.org/xerces2-j/features.html#honour-all-schemaLocations
>
>Michael Glavassevich
>XML Parser Development
>IBM Toronto Lab
>E-mail: mrglavas <at> ca.ibm.com
>E-mail: mrglavas <at> apache.org
>
(Continue reading)

Hannaford.Michael | 5 Dec 2005 21:29
Favicon

question about validation feature in xerces 2.7.1

Hello Xerces gurus,

I am trying to enable the feature
http://apache.org/xml/features/validation/warn-on-undeclared-elemdef
using xerces 2.7.1, which I just downloaded from
http://www.wmwweb.com/apache/xml/xerces-j/. 

This is my java class:

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.SAXNotRecognizedException;

public class TestSAXParser
{
    //~ Methods
----------------------------------------------------------------

    public static void main( String[] args )
    {
        try
        {
            SAXParserFactory factory = SAXParserFactory.newInstance(  );
            factory.setFeature( VALIDATE_XML_FEATURE, true );
            factory.setFeature( WARN_ON_UNDECLARED_ELEMENT, true );
            factory.setFeature( WARN_ON_DUPICATE_ENTITY, true );

            SAXParser parser = factory.newSAXParser();
        }
(Continue reading)

Michael Glavassevich | 6 Dec 2005 00:21
Picon

Re: question about validation feature in xerces 2.7.1

Hello Michael,

It's a long standing bug [1] and has been broken for so long I'm not sure 
any version of Xerces 2.x ever supported the feature. It's been on my TODO 
list for awhile and I'm hoping to finally get around to it for Xerces 
2.8.0.

By the way you weren't actually using Xerces 2.7.1 when you ran your test 
(probably since you didn't put the Xerces jars on the classpath). The 
com.sun.org.apache.xerces.internal.* packages originate from Sun's Java 
5.0.

Thanks.

[1] http://issues.apache.org/jira/browse/XERCESJ-506

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas <at> ca.ibm.com
E-mail: mrglavas <at> apache.org

"Hannaford.Michael" <Michael.Hannaford <at> ftb.ca.gov> wrote on 12/05/2005 
03:29:12 PM:

> Hello Xerces gurus,
> 
> I am trying to enable the feature
> http://apache.org/xml/features/validation/warn-on-undeclared-elemdef
> using xerces 2.7.1, which I just downloaded from
(Continue reading)

Bhupinder | 8 Dec 2005 07:29
Picon
Favicon

Difference between Java xerces Parser and C++ xerces Parser

Hi ,
 
I wanted to understand the difference between Java  xerces Parser and  C++ xerces Parser.Could you please give some information or some pointers.
 
Thanks,
Bhupinder Jeet Singh
Software Engineer.

Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
Gareth Reakes | 8 Dec 2005 10:48

Re: Difference between Java xerces Parser and C++ xerces Parser

Hey,

	They are both XML parsers that implement standards such as DOM and SAX. 
Apart from the obvious language difference they have slightly different 
functionality (for example, Java implements XInclude and C does not). 
You best point to start is the web sites:

http://xerces.apache.org/xerces2-j/
http://xml.apache.org/xerces-c/

If you have a specific requirement then post it back and we will try to 
help.

Cheers,

Gareth

Bhupinder wrote:
> Hi ,
>  
> I wanted to understand the difference between Java  xerces Parser and  
> C++ xerces Parser.Could you please give some information or some pointers.
>  
> Thanks,
> Bhupinder Jeet Singh
> Software Engineer.
> 
> ------------------------------------------------------------------------
> Yahoo! Shopping
> Find Great Deals on Holiday Gifts at Yahoo! Shopping 
>
<http://us.rd.yahoo.com/mail_us/footer/shopping/*http://shopping.yahoo.com/;_ylc=X3oDMTE2bzVzaHJtBF9TAzk1OTQ5NjM2BHNlYwNtYWlsdGFnBHNsawNob2xpZGF5LTA1 
>  >

--

-- 
Gareth Reakes, Managing Director           Embrace Mobile
+44-1865-811197              http://www.embracemobile.com
Demetrio Cruz | 15 Dec 2005 14:39
Picon

Problems with jdk1.4 rt.jar and Node.getTextContent

Hi.

I'd been using xerces 2.7.1 and I want to use the method getTextContent from
org.w3c.dom.Node, but every time I compile my class I get a cannot resolve
symbol, so I try it again with -verbose and I notice that it loads the
class Node from the rt.jar included in the jdk and not the one from my
xml-apis.jar which must be, do you know how could I compile it, without
having to install jdk1.5 ?

--

-- 

"Common Lisp, a happy amalgam of the features of previous Lisps"

- Winston & Horn, Lisp

Gmane