DTD validation without a !DOCTYPE

I am doing some integration with a third-party. The project involves sending an XML request, receiving a response, parsing, and displaying the results in a browser. I have received DTDs from the third party, and must validate the request before the message is sent (posted) from my side. However, the third party requires that a <!DOCTYPE> declaration should not exist in the document. Can someone give me an example of how to validate an XML document with no <!DOCTYPE>? I am building the document object with JDOM. Also, any suggestions on a parser implementation?
Thanks,
Ben

This is the model I am using: I have millions of docs I need to
validate, so I am reading one at a time in memory, I process
the string for some offline edit operatiosn then validate the
resulted xml string. I am creating the parser once in memory
and validating each document by changing the xml string its
supposed to parse. (all are being validated against same DTD)
Now as I said before the timing actually surprised me also.. and I
have no explenation either.. I am running on a Windows2000/jdk1.4
and xerces.. and sax parser for validation. And the results were:
With string manipulation to change doctype:
DOMValidation: 13Microsecs
SAXValidation: 10Microsecs
and using entity stuff it was 29Microsecs. As I said I am just a
messenger presenting the results, and I would like to find
out also whats happening here.

Similar Messages

  • Ejb-jar.xml DTD validation error?

    I am attempting to deploy a JAR on App Server 8 PE. The application does not contain any EJBs but I understand that the ejb-jar.xml descriptor is still needed. I am running the app server on Windows XP.
    My issue is as follows:
    I understand that the root element for the ejb-jar.xml file (<ejb-jar>) is required. Since I have no EJBs, I should be able to leave this root element blank (as I have in previoius successful deployments to earlier versions of Sun App Server). When I attempt to deploy, I receive the following DTD Validation error via the admin console:
    The content of element type "ejb-jar" is incomplete, it must match "(description?,display-name?,small-icon?,large-icon?,enterprise-beans,relationships?,assembly-descriptor?,ejb-client-jar?)".
    Am I missing something?
    My ejb-jar.xml file looks like:
    <!DOCTYPE ejb-jar PUBLIC
         "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
         "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    </ejb-jar>
    Many thanks in advance to any assistance...

    I am attempting to deploy a JAR on App Server 8 PE.
    The application does not contain any EJBs but I
    I understand that the ejb-jar.xml descriptor is still
    needed. I am running the app server on Windows XP.
    My issue is as follows:
    I understand that the root element for the
    ejb-jar.xml file (<ejb-jar>) is required. Since I
    have no EJBs, I should be able to leave this root
    element blank (as I have in previoius successful
    deployments to earlier versions of Sun App Server).
    When I attempt to deploy, I receive the following
    g DTD Validation error via the admin console:
    The content of element type "ejb-jar" is incomplete,
    it must match
    "(description?,display-name?,small-icon?,large-icon?,e
    nterprise-beans,relationships?,assembly-descriptor?,ej
    b-client-jar?)".
    Am I missing something?
    My ejb-jar.xml file looks like:
    <!DOCTYPE ejb-jar PUBLIC
    "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    s 2.0//EN"
         "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    </ejb-jar>
    Many thanks in advance to any assistance...I hav tried this and it is working
    <?xml version="1.0" encoding="UTF-8" ?>
    <ejb-jar
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
    version="2.1">

  • Weblogic 9.2 JDk 1.5 DTD Validation

    Hi
    We are using xerces parser and doing DTD Validation .
    We want to have all the DTD present in the local directory
    C:/temp( as reading from the WAR is a performance hit)
    When we try to run with Weblogic 8.1 ( with JDK1.4 and JDK1.5 ) the xml is being parsed properly and validated with DTD without any errors
    But when we are trying to Validate the DTD with Weblogic 9.2 and JDK 1.5 it gives the error
    C:/temp/a.dtd not found even though the DTD is present in that location .
    Is there a settiing in Weblogic 9.2 which needs to be set for it to read local file system files?
    Thanks
    Sachin

    weblogic 9.2 uses jdk 1.5_04 if i recall correctly.

  • Message Mapping - Turn Off dtd validation

    Hi,
    I would like to know how to turn off dtd validation in a message map.
    The source message type is based on dtd. When testing, I get the following error
    java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.io.FileNotFoundException: D:\usr\sap\XYZ\DVEBMGS01\j2ee\cluster\server0\abc.dtd (The system cannot find the file specified)
    I understand that the map requires the dtd to be present in the application folder. But, can I change some setting not to look up this file.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE MessageContainer SYSTEM "abc.dtd">

    Sorry Arvind. Not able to understand your question.
    The problem we are facing is, when the input xml file contains DocType declaration with reference to a dtd, we get an error stating the dtd is not found in the j2ee application folder.
    It works fine if the dtd is saved in the location. Also, it works fine if the DocType declaration is removed from the xml file. However, we are exploring an option where declaration is used but dtd is not available.
    Is there any way to achieve this?
    Thanks!

  • Disabling dtd validation

    I know it sounds odd.. but I need my appserver to run offline. basically I am creating a stand alone server and application installation that one of our marketing guys can take on the road on a laptop and demo to people where there is no internet.
    you know.. localhost style ;-)
    One problem.. when there is no internet, DTD validation for sun and oracle wesite DTDs all fail. Removing all dtd references or making them local would take as long as it would take me to write a script to do it... I am hoping there is just a setting in the application server that I can set to disable dtd validation. The whole app is done being developed.. I don't need my xml validated anymore! I need to be able to run without the intarwebnets!
    please help!

    Haven't worked with this but possibly this method of "deactivation" is not valid in 11gR2? Have you cross checked that with Oracle support?

  • DOM Parser Configuration...how to switch off DTD validation?

    Hi all,
    I am developing some implementation code in Java using JBuilder2005, in which DOM3 parser is also being utilised. Now the question is how to switch off DTD validation (seems its default mode is 'on') so that no validation will be carried out at all even DTD declaration statement is presented in an input XML document?
    Many thanks in advance
    Frank

    First of all, thank you so much for responding, DrClap. =)
    setValidating(false) of the DocumentBuilderFactory instance, factory, does not work as expected; it still stubbornly try to seek the external DTD file and fires 'IOException' error in case of no such a DTD.
    To follow up the EntityResolver approach, I searched online for almost the whole afternoon but still could not figure out how to do it exactly. In particular, I found http://www.jdom.org/docs/faq.html#a0350, which tells a way doing it, but I got 'StringBufferInputStream is deprecated' error. Then I changed to
    new InputStream(new ByteArrayInputStream("".getBytes()))adapted from http://forum.java.sun.com/thread.jspa?threadID=572919&messageID=2842185. But another error occurs: 'java.io.InputStream is abstract; cannot be instantiated'. Furthermore, I have looked at many docs(tutorials, APIs...) on parser configuration, usage of EntityResolver/setEntityResolver()...but they turned out not helpful. Could you please give out more details on how to do this using EntityResolver?? Many many thanks...

  • How to disable XML´s DTD validation in Weblogic10?

    Hello folks, we are trying to upgrade our server to Weblogic10, but it´s XML parser is validating XML´s DTD and ´cause we are behind a firewall we receive a error like:
    Tried all: ´6´ address, but could not connect over HTTP to server: 'www.w3.org', port: '80'
    Does anyone here known how to disable DTD validation in WL10?
    Regards,
    lottalava

    Well you can create non validating parser programatically .
    http://edocs.bea.com/wls/docs100/xml/programming.html#wp1069856
    i.e.
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setValidating(false);
    Hope this helps.

  • DTD Validation in Flex?

    Hello,
    Does Flex/Flash Builder 4 have a way to validate XML files using DTD?
    Thanks!

    After spending hours, I realized that the DTD path should start with file:// like
    if(systemId != null ){
                    systemId = systemId.replace("\\", "/");
                    //systemId = systemId.replaceAll("/{4}", "//");
                    if(systemId.startsWith("//")){
                         systemId = "file://"+systemId;
                   is = new InputSource(systemId);
               }This solved my earlier connection timed out problem.
    But still I am not sure why Linux does not understand dtd path without file://// and gives connection timed out error.

  • Button action bypass validation without using Immediate=true

    I have a Form in a page, and a "Query" button to popup a dialog for user to search some information, and help user to fill-in some fields.
    I want the "Query" button to ignoral all the validations in the Form (e.g.: required fields). I tried to set the Immedate for the button, but I found I cannot set any inputText value inside ReturnListener event-handler with Immedate is true.
    Is there anyway to have a button to action, and bypass all the validation without using Immediate=true?
    Thanks,
    Samson Fu

    Hi,
    if you are on JDeveloper 11g, have a look at the skipValidation property on the ADF binding and read: http://oracle.com/technology/products/jdev/tips/fnimphius/ppr_subform/index.html
    You can implement a similar approach
    Frank

  • How do i check to see if a code is valid without redeeming

    I have a couple movie codes and I want to see if they are still valid without redeeming them. How do I go about this?

    Actually, I just found a way to verify if a code is redeemed or not without actually redeeming it. Thanks for the support though.

  • Turn off DTD validation

    I am using the Xerces DOMParser that ships with WebLogic 6.0 (sp1). Does
    anyone know how to turn of DTD validation when parsing a file?
    Thanks in advance.

    in SAX it's the setFeature() method. I assume there's something similar for
    DOM because the Xerces DOM "parser" sits on top of SAX
    "Tony Hardee" <[email protected]> wrote in message
    news:[email protected]..
    I am using the Xerces DOMParser that ships with WebLogic 6.0 (sp1). Does
    anyone know how to turn of DTD validation when parsing a file?
    Thanks in advance.

  • DTD Validator

    Is there a DTD validator available for download? Also, is there
    a converted to BNF available?
    null

    I am not sure what you mean by "DTD Validator". If you mean
    chcking that a DTD is well-formed and has access to its entities
    then our XML Parser will do the job. As to conversion to BNF, we
    have nothing in this area until our XSL Processor becomes
    available.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Rob Jaeger (guest) wrote:
    : Is there a DTD validator available for download? Also, is
    there
    : a converted to BNF available?
    null

  • Creation of XML !DOCTYPE DTD Validation line

    Hello all!
    I've been working in the creation of an XML File via Abap Objects.
    <b>if_ixml</b>          For Document Header
    <b>if_ixml_document</b> For Document Header
    <b>if_ixml_element</b>  For Nodes and their Child Nodes
    I have already developed the code for creating the XML File.
    I think I have it completed, but I don't know how to insert the line that starts with <!DOCTYPE>.
    This line validates all the DOM tree structure against a DTD File.
    I've been searching for an example of how to do it, but I dind't find anything
    Wich is the proper Class, object or method that I have to implement for this topic?
    The Line I have to post on the XML file is one like this:
    <!DOCTYPE e-billing-payable PUBLIC "-//BxxxxFxxxxx.com//DTD Ebilling Enterprise to Bank 1.0//EN" "https://hb.xxx.com.ar/cobranzasonline/ebillingE2B.dtd">
    Thanks in advance,
    Claudio.

    Thanks Sandra, I was succesfull in getting the doc type but here is the format that I need
    <!DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA Feeds//EN" "gsafeed.dtd">
    If I try to use entity declaration , it dosen't let me without passing the SYSTEM paramater. Is there any method within if_ixml_document_type or outside, that would help me pass the attributes to get in the below format.
    <!DOCTYPE rootElement PUBLIC "PublicIdentifier" "URIreference">
    Thanks
    Ganesh.S

  • Ignoring whitespaces without DTD validation

    Hi!
    I've been having some problems parsing an XML file with DOM, because I get text Nodes for each "new line" symbol in the file, and I want these to be ignored, so I tried to put the "setIgnoringElementContentWhitespace" of the DocumentBuilderFactory to true.
    The problem is that this property requires the parser to be in validating mode, and I don't have the DTD of the xml file... so I'd like it to be non validating.
    Can it be done?

    Ok, then... a DTD is needed to make the parser know when the whitespaces are ignorable, isn't it?
    I wrote a simple DTD and by-passed the problem. It works know.
    Thx for reading

  • HOW TO KNOW VALID XML WITH DTD ? WITHOUT PARSING  ?

    i am creating the xml file
    i need to validate the xml with DTD to confirm is it valid or not ?
    with out parsing...
    could you tell me how ?
    Durga

    without parsing u cant do it..

Maybe you are looking for

  • Solved Arch won't start

    When I try to start Arch Linux, it goes through normally until it gets to : : Checking Filesystems. Then it displays the following error: /dev/sda3 contains a file system with errors. check forced. /dev/sda3: Inodes that were part of a corrupted orph

  • Problems installing Crystal Reports 2008 Server on Windows Server 2008 serv

    I attempted to install the Crystal Reports 2008 product on one of our Windows Server 2008 servers. After installing disk 1 Crystal Reports 2008 Server attempts to open up in IE...... but opens up to a blank page http://bmlfileserver:8080/CmcApp/ anyo

  • Publisher to pdf - printing issues

    Hi All I have a double sided trifold publisher file that I am having issues with  lines on the pix - converting to PDF sorts this - however when printing the pdf file the alignment of objects centred on the trifold pages changes and the end result is

  • Change Documents : Enabling

    Hi, I have a table which is a part of Change documents Object in SCDO object. but none of the fields for this table is enabled for change documents (the tab further characterisitcs of the data element has a field Change Document which is disbaled). W

  • Extra level of security in ABAP for sensitive custom tcodes

    Hi All, Is it a best practice to include this extra level of authority check in custom programs which are deemed as sensitive ? CALL FUNCTION 'AUTHORITY_CHECK_TCODE' So trying to execute the underlying program for a tcode with SE38/SA38 would still p