DTD definitions

Question:
Is there a document available which details how DTD's are defined? I am struggling with is understanding if you define a
tag such as, <Sales > Order> XXX<Sales Order>, how do you
define what is valid for the element (numeric only, field
lenghth, syntax)
also, does the DTD define the XML file hieararchy?
null

Susan, what you are asking for is does the DTD permit datatype
checking. The answer is very poorly to not at all. The XML
Schema WG of the W3C is addressing this issue. You can review
the current working drafts at http://www.w3.org/XML/#discussion.
In answer to your second question, DTD's due define an XML
document's structure which can be validated.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Susan Zaffarano (guest) wrote:
: Question:
: > Is there a document available which details how DTD's are
: defined? I am struggling with is understanding if you define a
: tag such as, <Sales > Order> XXX<Sales Order>, how do you
: define what is valid for the element (numeric only, field
: lenghth, syntax)
: also, does the DTD define the XML file hieararchy?
null

Similar Messages

  • Standard XSD / DTD definitions

    Are there any standard XSD / DTD definitions that represents open interface tables, if so how to extract those.

    Hi Sravan,
    Thanks for your valuable input,
    Actually when we unarchive any SAP standard repository, under XML Schema Table we will have few SAP Standard .XSD files, this files we cannot download it from console.., But I am sure we can get this .xsd files from Service Market place or through SAP Notes.
    if you have any idea about where to get this Standard .xsd files..
    For more information could you please refer to the below link.
    Re: XSD and Port
    Thanks
    Bharat

  • DTD definition in XML

    DTD is valid. DTD and XML are in the same directory.
    I can read from XML, when is validation off.
    When is validation on, it is throwing exception...
    Project path: d:/dbt
    Path to xml is: /files/xml
    In XML file :
    <!DOCTYPE ABCD SYSTEM "dictionary.dtd">
    <ABCD>
    <JKL>
    </JKL>
    </ABCD>
    JavaException:
    org.jdom.JDOMException: Error on line 1: Relative URI "dictionary.dtd"; can not be resolved without a base URI.
    Thanx.

    I implemented the exemple, bt I have another problem.
    My DTD includes other DTD and I have the same error for the others DTD.
    JavaException:
    org.jdom.JDOMException: Error on line 4: Relative URI "./geographie_mcto.dtd"; can not be resolved without a base URI.
    Following the beginning of the DTD :
    <?xml version="1.0" encoding="UTF-8"?>
    <!ENTITY % Booleen "(oui|non) 'non'">
    <!ENTITY % Numerique "#PCDATA">
    <!ENTITY % Geographie SYSTEM './geographie_mcto.dtd'>
    %Geographie;
    <!ENTITY % Date_heure SYSTEM './date_heure.dtd'>
    %Date_heure;

  • Problem with Struts Validation and apache dtd definition.

    Jakarta Struts
    Java Version 1.5
    We have one web application that is being a little problematic, on startup two errors are thrown relating to the same problem (errors below).
    We get 401 returned for http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    both the validation.xml and validation-rules.xml have the same doc type set as below:
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    We have the same configuration set for several other web application deployed succesfuly on the same tomcat application server without any problems. I'm not sure why this one application is causing a problem, I don't see any difference between the validation.xml and validation-rules.xml files in this application to any of the others that have been succesfully deployed, infact the validation-rules.xml is identical for all the web applications hosted on this server.
    Any ideas appreciated
    Error
    2006-03-30 15:04:50,968 ERROR [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:224) - Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
         at java.net.URL.openStream(URL.java)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:265)
         at oracle.xml.parser.v2.NonValidatingParser.pushExternalDTD(NonValidatingParser.java:540)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:465)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:298)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:277)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:184)
         at org.apache.commons.digester.Digester.parse(Digester.java:1515)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknown Source)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:222)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:161)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
         at javax.servlet.GenericServlet.init(GenericServlet.java:259)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2141)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4582)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4676)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:820)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:542)
         at com.evermind.server.Application.getHttpApplication(Application.java:889)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:690)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2006-03-30 15:04:50,968 INFO [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:209) - Loading validation rules file from '/WEB-INF/validation.xml'
    2006-03-30 15:04:50,984 ERROR [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:224) - Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
         at java.net.URL.openStream(URL.java)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:265)
         at oracle.xml.parser.v2.NonValidatingParser.pushExternalDTD(NonValidatingParser.java:540)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:465)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:298)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:277)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:184)
         at org.apache.commons.digester.Digester.parse(Digester.java:1515)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknown Source)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:222)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:161)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
         at javax.servlet.GenericServlet.init(GenericServlet.java:259)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2141)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4582)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4676)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:820)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:542)
         at com.evermind.server.Application.getHttpApplication(Application.java:889)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:690)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    -----------------------------------------------------------------------

    hi,
    I am also facing the same issue. Could you tell me which are those jar files you were missing & from where you got those?
    regards
    prasanth

  • How to get the content of a DTD ?

    (i'm French, please excuse my English)
    I'm trying to get the content of the DTD corresponding to the file "fic"
    fic is like : "....../XXXXXX.xml"
    and contains : <!DOCTYPE composants SYSTEM "test.dtd">
    Here is my code :
    org.w3c.dom.Document Doc = DBXML.newDocument();
    Doc = DBXML.parse(fic);
    //Doc is a correctly parsed Document
    org.w3c.dom.DocumentType DT = Doc.getDoctype();
    System.out.println(DT.getSystemId());
    //echo : "test.dtd" so I think that DT is good
    System.out.println(DT.getNodeType());
    //Echo "10" ==> DocumentType Node
    System.out.println(DT.getNotations().getLength());
    //Echo "0" !!!!!!!!!
    I can't figure why getNotations() can't give me the DTD definitions
    Please tell me if I try to use a wrong way or if I missed something.
    Thanks a lot ...

    getNotations() method returns Dtd NOTATIONS when the NOTATIONS are referenced in the DTD.
    Dtd:
    <!ELEMENT map (entry*) >
    <!ELEMENT entry (#PCDATA)>
    <!ATTLIST entry value NOTATION (n1|n2) #REQUIRED>
    <!NOTATION n1 SYSTEM "n1-url">
    <!NOTATION n2 SYSTEM "n2-url">
    /* getNotation() returns NamedNodeMap*/
    DocumentType docType=xmlDocument.getDoctype();
    System.out.println(docType.getName());
    NamedNodeMap nnm=docType.getNotations();
    System.out.println((nnm.item(0)).getNodeName());
    System.out.println((nnm.item(1)).getNodeName());
    System.out.println(docType.getNotations().getLength());
    Output:
    map
    n1
    n2
    2

  • XML validation with DTD stored in String object

    Does anyone know if this is plausible......
    I am trying to validate some XML with a DTD... easy enough, right? The catch is that the dtd is NOT stored in a file somewhere and is also not declared in the XML to be validated. It is stored in a String object (as is the XML file to be validated).
    To clarify - I want to do something like this... but not sure how to incorporate the DTD.
    String dtd = // dtd definition here
    String xml = // xml text here (no URI at the top)
    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser parser = factory.newSAXParser();
    DefaultHandler handler = new DefaultHandler();  // DTD handler??
    parser.parse(new InputSource(new StringReader(xml.toString())), handler);any help would be greatly appreciated.
    thanks in advance,
    Terrance

    I guess it makes the most sense to make the dtd local to the xml. Therefore I would only have one string with both the xml contents and dtd contents. That is how I am going to approach this unless I hear something different.

  • Faces-config.xml Component definition exception

    Hello,
    I have a taglib file with the following content :
    <component>
      <description>
          <p>Represents an HTML <code>input</code> element
          of type <code>text</code> with built-in completion.</p>
        </description>
        <display-name>Completion Text Field</display-name>
        <component-type>bpcatalog.ajax.AjaxTextField</component-type>
        <component-class>com.sun.j2ee.blueprints.bpcatalog.ajax.components.AjaxTextField</component-class>
        &uiinput-props;
        &core-props;
        &events-props;
        &focus-props;
        &i18n-props;
        &input-props;
        &text-props;
        <component-extension>
         <!-- TODO - can I specify HtmlInputText as the parent here? -->
          <base-component-type>javax.faces.Input</base-component-type>
          <renderer-type>AjaxTextField</renderer-type>
        </component-extension>
      </component>And when I launch my webapp, I have the following exception :
    Element type "base-component-type" must be declared
    The entity "input-props" was referenced, but not declaredCan someone explain me what is the cause of this ?
    Thanks in advance.
    bgOnline

    Sounds like you're missing definitions like:
    <!ELEMENT base-component-type (#PCDATA)>
    <!ENTITY input-props SYSTEM "input-props.xml">
    (one for each of the references)
    These definitions need to be nested in the DOCTYPE
    declaration like so:
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd" [
    (definitions)
    ]>

  • Wrap xml definition

    Hi,
    is there a possibility to wrap .xml or .jsp report definitons so that the file is´nt anymore human readable?
    The advantage for me would be that our customers that receive the reports source code could´nt read the source file. Of course I could still use the .rdf and .rep format but there´s the problem with the different operating systems.
    thanks in advance

    We have to send outgoing invoices via XML and special Format "Finvoice" (where we have the XSD and DTD definition)to an operator. Therefore we are looking for to solutions: 1. Creating standard Invoice IDOC and map it in XI or 2. to write a program to collect the Invoice data into a dictionary structure and use the NetWeaver environment to convert with "TRANSFORMATION ID" into XML. But I thought for both ways we need a SAP dictionary structure which is quite a bit of work to manually define - therefore an automatic generation based on the XSD or DTD would be very helpful

  • Reg: adding DTD declaration using java

    Dear All,
    I want to add the document type declaration definition to xml file using java.
    I am using ,
    transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "test.dtd");But it refers the specified dtd file....Can i add dtd definition directly....The dtd are as,
    <!DOCTYPE test [
    <!ATTLIST person nick ID #IMPLIED>
    ]>Is it any method to add the above...
    Thanks,
    Karthik.V

    If you invoke the print method on the top-level ELEMENT, you get
    just the body of the document with no DTD or XMLDecl. if you invoke
    print on the top level NODE (the DOCUMENT node), then the output
    document will contain the XMLDecl and DTD.
    So please try to print from DOCUMENT node.

  • Getting error in 9.2.0.4.0 Pro*c version while running the query.

    HI All,
    I am using oracle database 9.2.0.4.0. Previously we are using the oracle version Release 8.0.6.3.0. In this version Pro*c we have a query like below:
    SELECT a.trn_id, a.i_cd, a.mfg_cd, a.co,
    TO_CHAR (a.i_date, 'YYYYMMDD'), a.store, a.pur_num,
    TO_CHAR (a.terms_date, 'YYYYMMDD'), a. amt, a.i_amt,
    TO_CHAR (a.due_dt, 'YYYYMMDD'), COUNT (b.trn_id)
    FROM t_abc_ln b, t_abc a
    WHERE b.trn_id(+) = a.trn_id AND a.orig_cd = 'RECUR'
    GROUP BY a.trn_id,
    a.i_cd,
    a.mfg_cd,
    a.co,
    a.i_date,
    a.store,
    a.pur_num,
    a.terms_date,
    a. amt,
    a.i_amt,
    a.due_dt
    ORDER BY a.trn_id ASC;
    was working fine. But in the new version 9.2.0.4.0 the above query in the Pro*C is not working properly.
    It is throughing the error
    Fatal Error: File: C_ABC_CURDB.cpp Line: 431
    Not Found
    sqlerrd[4]: SQL parse error, offset: 0
    sqlerrd[2]: Rows Processed: 4
    **** Abnormal Termination ****
    Failure happens at the time of FETCHing the cursor, whereas OPEN cursor is successful. When I remove outer join above query i.e., program runs fine without any errors. Rows Processed is equal to number rows in the t_abc table. Running the above query on SQLPLUS executes fine.
    How this could be resolved to make it to work on Pro* C/C++ version 9.2.0.4.0? are is it a limitation on this version? Do we need to re-write the query by removing the outer join?
    Thanks,
    SUN

    If an XML document has a dtd definition, the document is validated with the dtd.
    Remove the DOCTYPE definition by applying an XSLT.
    <xsl:template match="/">
       <xsl:copy-of select="." />
    </xsl:template>

  • Oracle 11g - how to disable the Static Type-Checking of XQuery Expressions

    Hi,
    I loaded XML files using pl/sql in Oracle 10 suggesfully and now after upgrading to 11g the thing doesn't work anymore.
    I believe the problem has to do with the DTD, the xml files structure is not as specified in the DTD. I did get away in Oracle 10 issuing the alter session set events ='31156 trace name context forever, level 2' in the code. Now this doesn't seem to have any effect. When loading the xml file I get the following error message
    "ORA-19276 XPST0005 - Xpath step specifies an invalid element/attribute name"
    How can I skip the checking as I can't change the DTD's.
    TIA,
    Kari

    DTD Support in Oracle XML DB
    A DTD is a set of rules that define the allowable structure of an XML document. DTDs are text files that derive their format from SGML and
    can be associated with an XML document either by using the <code>DOCTYPE</code> element or by using an external file through a DOCTYPE
    reference. In addition to supporting XML Schema, which provides a structured mapping to object-relational storage or binary XML storage,
    Oracle XML DB also supports DTD specifications in XML instance documents. Though DTDs are not used to derive the mapping, XML
    processors can still access and interpret the DTDs.
    Inline DTD Definitions
    When an XML instance document has an inline DTD definition, it isused during document parsing. Any DTD validations and entity
    declaration handling is done at this point. However, once parsed, theentity references are replaced with actual values and the original
    entity reference is lost.
    External DTD Definitions
    Oracle XML DB also supports external DTD definitions if they are stored in Oracle XML DB Repository. Applications needing to process an
    XML document containing an external DTD definition such as /public/flights.dtd, must first ensure that the DTD document is stored in Oracle XML DB at path /public/flights.xsd.
    .... thats all I could find...
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb05sto.htm#sthref540
    Edited by: Marco Gralike on Feb 26, 2009 11:19 AM

  • XML parsing in EJB

    I am using WLS 7.0. XML Message is passed to Session EJB. EJB needs to process
    the XML. How can we pass the XML to a parser class or so and check Well-Formedness
    and Validate against a XML schema respective to the XML. Any examples, sample
    code would be a great help.
    Method which has xml messages
    public String processXML( String[] xmlStrs ) {
    //String[] xmlStrs = (String[]) xmlList.toArray();
    for ( int i=0; i < xmlStrs.length; i++ ) {
    System.out.println( xmlStrs.toString() );
    return new Integer(xmlStrs.length).toString();
    Thanks in Advance
    Ganesh C.

    Your well-formed validation can go thru a DTD file. Inside the XML file file
    header, include the proper DTD definition.
    "Ganesh C" <[email protected]> wrote in message
    news:[email protected]..
    >
    I am using WLS 7.0. XML Message is passed to Session EJB. EJB needs toprocess
    the XML. How can we pass the XML to a parser class or so and checkWell-Formedness
    and Validate against a XML schema respective to the XML. Any examples,sample
    code would be a great help.
    Method which has xml messages
    public String processXML( String[] xmlStrs ) {
    //String[] xmlStrs = (String[]) xmlList.toArray();
    for ( int i=0; i < xmlStrs.length; i++ ) {
    System.out.println( xmlStrs.toString() );
    return new Integer(xmlStrs.length).toString();
    Thanks in Advance
    Ganesh C.

  • WAR files (Tomcat) and deployment descriptor

    Hello,
    I am currently writing a small utility to package a web application for Jakarta Tomcat as a .war file.
    I have a functional version that imports the deployment descriptor web.xml, but I'd like to make it possible for the user to edit or create from scratch that file. I use the DOM API to make a logical model of my web.xml, but the parser won't accept the external dtd definition :
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    Here is my parser :
    private void parse(File in) {
    try {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setValidating(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(in); (((*)))
    catch (...)
    }//parse
    ---------------------------------------------It seems I have no further controls on DocumentBuilder and DocumentBuilderFactory.
    The builder.parse call generates this exception :
    java.net.NoRouteToHostException: Operation timed out: no further information
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at org.apache.crimson.parser.Resolver.resolveEntity(Resolver.java:389)The problem seems to be located in DOM's DefaultHandler entity resolver, but I don't ee clearly what to do.
    Thanks for helping.

    Hi,
    I already tried every combination of settings with
    DocumentBuilderFactory.setNamespaceAware
    DocumentBuilderFactory.setValidating
    DocumentBuilderFactory.setCoalescing
    DocumentBuilderFactory.ExpandEntityReferencesI had the same result. Here is the exact dump :
    java.net.NoRouteToHostException: Operation timed out: no further information
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:312)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
            at java.net.Socket.<init>(Socket.java:273)
            at java.net.Socket.<init>(Socket.java:100)
            at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:331)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:517)
            at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
            at sun.net.www.http.HttpClient.<init>(HttpClient.java:277)
            at sun.net.www.http.HttpClient.New(HttpClient.java:289)
            at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
    .java:379)
            at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:472)
            at org.apache.crimson.parser.Resolver.resolveEntity(Resolver.java:389)
            at org.apache.crimson.parser.ExternalEntity.getInputSource(ExternalEntit
    y.java:88)
            at org.apache.crimson.parser.Parser2.pushReader(Parser2.java:2986)
            at org.apache.crimson.parser.Parser2.externalParameterEntity(Parser2.jav
    a:2721)
            at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1154)
            at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:488)
            at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
            at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
            at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
    .java:179)
            at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:161)
            at DOMView.main(DOMView.java:96)This shows that the entity resolver tries to access the distant DTD, so I tried to implement myself the EntityResolver interface, but I didn't well understood
    what to do with that InputStream it has to return.

  • Deployment Tool Error - unknown document type - Add to Application EJB jar

    I am creating a new application in the J2EE deployment tool and adding an EJB JAR to it. The jar contains the ejb-jar.xml file. This file has the standard doctype:
    <!DOCTYPE ejb-jar PUBLIC
    '-//Sun Microsystems, INC.//DTD Enterprise JavaBeans 1.1//EN'
    'file:/C:/j2sdkee1.3/lib/dtds/ejb-jar_2_0.dtd'>
    I get the Unknown Document Type error when I try to add this jar to the application:
    Error: Adding EJB JAR - java.lang.RuntimeException: Invalid XML : Unknown document type : org.apache.crimson.tree.Doctype@e8647
    The xml file validates fine in NetBeans 3.4. I use NetBeans to generate the jar file.
    Any ideas as to what is happening would be appreciated.

    Try replacing the DTD definition as specified below.
    http://java.sun.com/dtd/ejb-jar_2_0.dtd
    regards,
    Siddique

  • Xml parse tries to access the internet

    Why is this happening and how can I stop this? Thanks.
    My code:
            DocumentBuilder htmlBuild = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            logentry = htmlBuild.newDocument();
            sitelog = htmlBuild.parse(this.getClass().getResourceAsStream("sitelog.xml"));If I don't allow it to access the internet, it shows this:
    java.io.IOException
    at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3339)
    at org.apache.crimson.parser.Parser2.externalParameterEntity(Parser2.java:3027)
    at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1314)
    at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:623)
    at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
    at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
    at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
    at MainPane.logEntry(MainPane.java:127)
    at MainPane.<init>(MainPane.java:28)
    at SiteLog.<init>(SiteLog.java:18)
    at SiteLog.main(SiteLog.java:28)

    I would guess that your 'sitelog.xml' file is either...
    (1) DTD based and refers to an external DTD definition (the parser is trying to validate the xml file)
    (2) Schema based and refers to an external XSD definition (the parser is trying to validate the xml file)
    (3) The XML file uses entity includes.
    In SAX you could get around (1) and (2) by installing a null EntityResolver. I'm sure you could do the same thing in DOM (but i'm no DOM expert).
    Also, you should look at the properties to see if there's a way to turn-off validation etc.

Maybe you are looking for