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

Discussion in 'Java' started by nstanevski@gmail.com, Jun 18, 2006.

  1. Guest

    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
    , Jun 18, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martijn Mulder

    J2SE 1.4.2 or J2SE 5.0?

    Martijn Mulder, Jun 27, 2005, in forum: Java
    Replies:
    15
    Views:
    1,818
    Tor Iver Wilhelmsen
    Jun 28, 2005
  2. frankarl
    Replies:
    0
    Views:
    735
    frankarl
    Apr 5, 2006
  3. Leona
    Replies:
    9
    Views:
    1,969
    Henry S. Thompson
    Nov 1, 2004
  4. Replies:
    3
    Views:
    903
    Peter Flynn
    Nov 16, 2005
  5. Boni Satani
    Replies:
    0
    Views:
    140
    Boni Satani
    Jan 9, 2014
Loading...

Share This Page