Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Migration from J2SE 1.4 to J2SE 5: cannot validate XML file

Reply
Thread Tools

Migration from J2SE 1.4 to J2SE 5: cannot validate XML file

 
 
nstanevski@gmail.com
Guest
Posts: n/a
 
      06-18-2006
Hello,
I have a code I run on J2SE 1.4 which fails while running on 1.5. Seems
that 1.4 built-in JAXP 1.1 ("Crimson" implementation) conflicts 1.5
built-in JAXP 1.3 ("Xerces" implementation). Following is the snippet
causing the problem:

import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
......
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(true);
try{
DocumentBuilder db = dbf.newDocumentBuilder();
ErrorHandler myErrHnd = new XMLParseErrHandler();
db.setErrorHandler(myErrHnd);
Document doc = db.parse(XMLFile); //EXCEPTION THROWN HERE
.....
}
Exception text is: "The name token is required in the enumerated type
list for the "TransferFunction" attribute declaration".
Here DTD validation fails. Into this DTD "TransferFunction" attribute
is used like that:
<!ATTLIST Layer
TransferFunction %TRANSFERFUNCTION; #IMPLIED
>

Where %TRANSFERFUNCTION is enum-ed like that:
<!ENTITY % TRANSFERFUNCTION "(
value_1|
value_2|
...
)">

I would be glad if somebody helps me fix this DTD in order to be
successfully validated in J2SE 5.
Thanks,
-Nikolay

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot remove J2SE Java Runtime Environment frankarl Java 0 04-05-2006 03:48 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
How to validate a xml file by an external dtd file? yw XML 2 08-02-2005 01:21 AM
J2SE 1.4.2 or J2SE 5.0? Martijn Mulder Java 15 06-28-2005 07:23 PM
tool to validate xml file against custom XML Schema file Leona XML 9 11-01-2004 09:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57