Regarding validating XML against DTD

hello,
In my project I am receiving xml via HTTP post request
and this XML needs to be validated against a DTD in a remote server.
e.g. assume the xml to be
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE PUSH SYSTEM "http:\\whatever:xx\whatever\sms.dtd">
<PUSH ICP="Partenaire" ADM="UtilisateurChezPartenaire" VERSION="1.0">
</PUSH>
the java code uses Xerces parser
      DOMParser parser = new DOMParser();
      parser.setFeature("http://xml.org/sax/features/validation", true);
      parser.setProperty(
                         "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                         "http:\\whatever:xx\whatever\sms.dtd"");
      parser.parse("c://localcopy/sms.xml");this Works fine.
But in some case I receive xml file without any !DOCTYPE declaration
(but is still needs to be validated against the same DTD as its mentioned in the business rules)
in such case how can the XML be validated against the DTD.
am I extected to add the
<!DOCTYPE PUSH SYSTEM "http:\\whatever:xx\whatever\sms.dtd">
to every XML via some XSLT script or is there a direct way of
validating a xml that has no DOCTYPE reference to a DTD
(the assumption is the DTD location is known beforehand)

ok, i managed to solve the problem my self, using Transformer makes the job easier.
here is the code for anyone who might run into the same problem.#
     public void whatEver(){
          try{
               DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
               DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
               Document xmlDocument = dBuilder.parse(new FileInputStream("c://a.xml"));
               DOMSource source = new DOMSource(xmlDocument);
               //StringWriter writer = new StringWriter();
               StreamResult result = new StreamResult("c://a.xml");
               TransformerFactory tf = TransformerFactory.newInstance();
               Transformer transformer = tf.newTransformer();
               transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "./transformations/Push_Gateway.dtd");
               //TransformerFactory transformerFactory = TransformerFactory.newInstance();
               //Transformer newtransformer = transformerFactory.newTransformer();
               transformer.transform(source, result);
          catch(Exception e){
               e.printStackTrace();
     }the above code reads the a.xml file and adds/removes the DOCTYPE as specified in the transformer.setOutputProperty method and the same xml file is updated, this way different DTD could be referenced by the same xml and validated. this saves the process of adding/removing DOCTYPE via xslt.

Similar Messages

  • Validating XML Against DTD

    I'm relatively new to Java and I was just wondering what is the most effective way of comparing an XML document to its DTD to ensure the document is valid.
    Any advice would be appreciated.

    Thanks for the example but looks like SUN code is buggy when compiled?
    The method parse(InputStream, HandlerBase) in the type SAXParser is not applicable for the arguments (File, DefaultHandler)

  • Error in validating XML against schema

    Hi am getting some critical errors while Validating XML against schema
    error is:
    cvc-elt.1: Cannot find the declaration of element 'position' , here <position> is my root element.
    my code is as follows:
    package com.glemser.xmLabeling.library.component.spl;
    import com.documentum.com.DfClientX;
    import com.documentum.com.IDfClientX;
    import com.documentum.fc.client.IDfClient;
    import com.documentum.fc.client.IDfSession;
    import com.documentum.fc.client.IDfSessionManager;
    import com.glemser.common.helper.OperationHelper;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParserFactory;
    import java.io.CharArrayWriter;
    import java.io.IOException;
    import java.io.InputStream;
    public class Test {
    static IDfSession m_session;
    public static void main(String[] args) {
    try {
         new Test().validate();
    } catch (Exception e) {
    e.printStackTrace();
    private XMLReader xmlReader;
    private DefaultHandler handler; // Defines the handler for this parser
    private boolean valid = true;
    public void validate() {
    try {
    SetXML setXML = new SetXML();
    OperationHelper operation = new OperationHelper();
    String splObjPath = "C://Documents and Settings/dparikh/My Documents/xmLabelingStage/Test.xml";//operation.executeExportOperation(m_session, new DfId(m_objectId), true);
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(false);
    spf.setValidating(true);
    spf.setFeature("http://xml.org/sax/features/validation", true);
    spf.setFeature("http://apache.org/xml/features/validation/schema", true);
    spf.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    if (spf.isValidating()) {
    System.out.println("The parser is validating");
    javax.xml.parsers.SAXParser sp = spf.newSAXParser();
    sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", "file://C:/Documents and Settings/dparikh/My Documents/xmLabelingStage/Test.xsd");
    System.out.println("The parser is validating1");
    //Create XMLReader
    xmlReader = sp.getXMLReader();
    xmlReader.setFeature("http://apache.org/xml/features/validation/schema", true);
    xmlReader.setEntityResolver(new SchemaLoader());
    ContentHandler cHandler = new MyDefaultHandler();
    ErrorHandler eHandler = new MyDefaultHandler();
    xmlReader.setContentHandler(cHandler);
    xmlReader.setErrorHandler(eHandler);
    System.out.println("The parser is validating2");
    parseDocument(splObjPath);
    } catch (SAXException se) {
    se.printStackTrace();
    } catch (ParserConfigurationException e) {
    e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    public void parseDocument(String xmlFile) {
    try {
    xmlReader.parse(xmlFile);
    if (valid) {
    System.out.println("Document is valid!");
    } catch (SAXException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    } catch (Exception e) {
    e.printStackTrace();
    class MyDefaultHandler extends DefaultHandler {
    private CharArrayWriter buff = new CharArrayWriter();
    private String errMessage = "";
    /* With a handler class, just override the methods you need to use
    // Start Error Handler code here
    public void warning(SAXParseException e) {
    System.out.println("Warning Line " + e.getLineNumber() + ": " + e.getMessage() + "\n");
    public void error(SAXParseException e) {
    errMessage = new String("Error Line " + e.getLineNumber() + ": " + e.getMessage() + "\n");
    System.out.println(errMessage);
    valid = false;
    public void fatalError(SAXParseException e) {
    errMessage = new String("Error Line " + e.getLineNumber() + ": " + e.getMessage() + "\n");
    System.out.println(errMessage);
    valid = false;
    public class SchemaLoader implements EntityResolver {
    public static final String FILE_SCHEME = "file://";
    public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
    if (systemId.startsWith(FILE_SCHEME)) {
    String filename = systemId.substring(FILE_SCHEME.length());
    InputStream stream = SchemaLoader.class.getClassLoader().getResourceAsStream(filename);
    return new InputSource(stream);
    } else {
    return null;
    My XML and XSD are as below:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="position" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="position_number" type="xsd:string"/>
    <xsd:element name="position_title" type="xsd:string"/>
    <xsd:element name="report_to_position" type="xsd:string"/>
    <xsd:element name="incumbent" type="xsd:string"/>
    <xsd:element name="operation" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    <position xsi:schemaLocation="Test.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <position_number>12345</position_number>
    <position_title>Sr. Engr</position_title>
    <report_to_position>23456</report_to_position>
    <incumbent>23456</incumbent>
    <operation>INSERT</operation>
    </position
    Please help me out

    --> Could not find cached enumeration value Custom.CI.Enum.PeripheralDevice.Printer for property Type, class BMC.Custom.CI.PeripheralDevice in enumeration cache.
    You must specify either the Name or Guid of an enumeration of type Custom.CI.Enum.PeripheralDevice.Type.
    Be sure that you are specifying the Name property of the enumeration value you want to set, and not the DisplayName; the Internal Name is something like "IncidentCategoryEnum.Category" for out of the box enumerations, or ENUM.210ADA2282FDABC3210ADA2282FDABC
    for enumerations created in the console.
    you can check this by finding the enumeration in the XML or by using the the
    SMLets commandlet
    Get-SCSMEnumeration | ?{$_.DisplayName –eq “Printer”}
    and then checking your value with
    Get-SCSMEnumeration -Name "ENUM.210ADA2282FDABC3210ADA2282FDABC"
    and see if you get the right displayname back

  • Does XDB supports validating xml against multiple schemas?

    The XMLType has some methods for validating an xml documents against a schema, e.g., SCHEMAVALIDATE, etc.. does XDB support validating xml against multiple schemas (Just like what JAXP or Xerces have done)? Or what's the current situation about this issue? thanks.

    did you try using the import schema element instead of the include elemnt?

  • Validating XML against XSD

    Hi,
    I would like to validate XML against XSD using SAX parser. Can any one help, where I can get information. I could get some information of XML validation against DTD. But could not get much information for XSD validation.
    Which parser is good for validation against XSD? or shall I continue with SAX Parser?
    Kumaravel

    I use the "Summer 02 XML Pack" provided here at Sun, which is based on Xerces2 by Apache (http://xml.apache.org/xerces2-j/index.html). Actually with that, validation against schemas is pretty much like validation against DTDs, as long as the schema is referenced in your XML file and you switch on schema validation in the parser like
    reader.setFeature("http://xml.org/sax/features/validation", true);
    reader.setFeature("http://apache.org/xml/features/validation/schema", true);Xerces2 works both with DOM and SAX (I use SAX). You should browse Apache's website a bit. There's not too much information, but I guess it's enough to get started.

  • Validating XML against an XML Schema using PL/SQL

    Hello everyone,
    I've a strange problem.
    I'm trying to validate an XMLTYPE variable against an XSD schema using the XMLisValid function.
    The XML I was trying to validate was returning false (0) when using this method.
    However, when I register the XSD against a column in a table and then insert this XMLTYPE into that column, I do not get any errors. If I change the XSD to ensure failure when using this method, I do get an error, so it is registered and working.
    I have then created a very basic XSD and both methods work when validating the XML against this. So obviously the more complicated XSD I want to validate against is making a difference, but I would expect them to either both fail or both pass, not one fail and one pass.
    Does anyone know why they'd be returning different results?
    Thanks in advance for your help.
    Robin
    examples of what I'm using:
    XML to validate:
    <centres>
    <add>
    <centre>
    <centreName>Name 1</centreName>
    <centreRef>45678</centreRef>
    </centre>
    </add>
    </centres>
    Simple XSD:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="centres" type="centresType"/>
    <xs:complexType name="addType">
    <xs:sequence>
    <xs:element type="xs:string" name="centreName"/>
    <xs:element type="xs:short" name="centreRef"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="centresType">
    <xs:sequence>
    <xs:element type="addType" name="add" maxOccurs="3" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    Complicated XSD:
    <?xml version="1.0" encoding="utf-8" ?>
    <!--Created with Liquid XML Studio - 30 Day Trial Edition 7.1.6.1440 (http://www.liquid-technologies.com)-->
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="centres">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="remove">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="centreRef">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="add">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="centre">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="centreName">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="centreRef">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element minOccurs="0" maxOccurs="1" name="qualifications">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="qualRef">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="modifyQualAssociations">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="remove">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="r">
    <xs:complexType>
    <xs:attribute name="centreRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="qualRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="add">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1000" name="a">
    <xs:complexType>
    <xs:attribute name="centreRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="qualRef" use="required">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1" />
    <xs:maxLength value="100" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    Steps to validate XML data against a schema in Oracle:
    1. Register your XSD in the database.
    begin
    dbms_xmlschema.registerschema(
    SchemaUrl,
    SchemaDoc,
    local => TRUE/FALSE);
    end;
    2. For validating your XML document against your registered schema, here is a sample pl/sql block.
    declare
    v_xml xmltype;
    begin
    v_xml := your_xml_document;
    v_xml.schemaValidate();
    end;
    Hope this helps :)

  • Getting an Out of memory exception while validating XML against XSD

    Hello friends,
    I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            saxParserFactory.setValidating(true);
              SAXParser saxParser = saxParserFactory.newSAXParser();
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
             saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
    Thanks.

    Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory

  • Question about validating xml against schema

    Hi,
    I am new to JAXP. I try to validating a xml against a schema. I wrote following code:
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespace(true);
    spf.setValidating(true);
    SAXParser sp = spf.newSAXParser();
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaSource",
    "mySchema.xsd") ;
    sp.parse(<XML Document>, <ContentHandler);
    but when compile, it has error: can't resolve ""http://java.sun.com/xml/properties/jaxp/schemaLanguage", and
    "http://java.sun.com/xml/properties/jaxp/schemaSource".
    It seems it didn't support above two property.
    I saw some code in forum is:
    fact.setFeature("http://xml.org/sax/features/validation", true);
    fact.setFeature("http://apache.org/xml/features/validation/schema",true);
    fact.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    SAXParser sp = fact.newSAXParser();
    sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemas);
    Why sun tutorial use property:http://java.sun.com/xml/properties/jaxp/schemaLanguage
    and someone use:http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation
    where to get information about setting properties for SAXParserFactory?
    Thanks

    In the past, ColdFusion's XML validation mechanism seems to have had issues with schemas that contain imports, e.g., http://forums.adobe.com/message/155906. Have these issues still not been resolved?
    Do you not think that perhaps you're answering your own question here?
    I don't see an issue about this on the bug tracker.  It might be an idea if you can get a simple, stand-alone repro case together and raise an issue (and post the reference back here and against that other thread so people know to vote for it).  If you post the repro case here too, it would be helpful.
    Adam

  • Issue in Store XML into Schema generated tables and Validation XML against registered schema.

    Hello friends,
    I am facing some problem when store xml into generated tables from registered schema.
    This is my Schema
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.abc.inf.in/test" targetNamespace="http://www.abc.inf.in/test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="abc.xsd"/>
      <xs:element name="project" type="student">
      <xs:annotation>
      <xs:documentation> This is a Documentation</xs:documentation>
      </xs:annotation>
      </xs:element>
    </xs:schema>
    -- This is my xml document
    <project versao="2.00" xmlns="http://www.abc.inf.in/test">
      <test xmlns="http://www.abc.inf.in/test">
      <intest version="2.00" Id="testabc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  >
      <ide>
      <cUF>35</cUF>
      <cNF>59386422</cNF>
      <natOp>this is post</natOp>
      <indPag>1</indPag>
      <mod>55</mod>
      <serie>1</serie>
      </ide>............
    Not giving full because it's too long.
    1. I Successfully registered Schema into database
    2. Then i generate table from registered Schema
    2. In my java code i validated XML document against Schema and it's successfully validate.
    3. But when i stored this XML into this generated table it's give me error
       Like :
    INSERT INTO XMLTABLE
    VALUES
    (XMLTYPE(bfilename('MYDIR','testabc.xml'),NLS_CHARSET_ID('AL32UTF8')))
    Error report:
    SQL Error: ORA-31061: XDB error: XML event error
    ORA-19202: Error occurred in XML processing
    LSX-00333: literal "94032000" is not valid with respect to the pattern
    And i have to store this xml into this tables so what i have to do ?

    Thanks for your reply odie_63.
    I got this my error solution. My XML document is not well structured based on my registered XML Schema.
    Means In My XML Document there are some invalid value and that not match my schema pattern so it's gives this error
    SQL Error: ORA-31061: XDB error: XML event error
    ORA-19202: Error occurred in XML processing
    LSX-00333: literal "94032000" is not valid with respect to the pattern
    For Solution we have two ways
    1. I have changed this literal "94032000" value in my xml file then save it.
    2.
    - We have to delete this schema then
    - we have to change Schema pattern for particular element
    like :--
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve"/>
      <xs:pattern value="[0-9]{3}"/>
    </xs:restriction>
    - then store xml into database it works..
    Thanks.

  • 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..

  • Error while Validating xml against a schema using jaxp

    Hi All,
    Following code validates xml against a schema using JAXP .It gives SAXNotRecognizedException error when you run the program.
    static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    SAXParserFactory myFactory = SAXParserFactory.newInstance();
    myFactory.setNamespaceAware(true);
    myFactory.setValidating(true);
    javax.xml.parsers.SAXParser parser;
    String filename = "C:/Note.xml";
    File xmlFile = new File(filename);
    try
         DefaultHandler handler = new DefaultHandler();
         parser = myFactory.newSAXParser();
         parser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
         parser.parse(xmlFile, handler);
    catch (ParserConfigurationException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    catch (SAXException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    catch (IOException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
    Error Details :
    org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
         at org.apache.xerces.framework.XMLParser.setProperty(XMLParser.java:1682)
         at org.apache.xerces.parsers.SAXParser.setProperty(SAXParser.java:770)
         at org.apache.xerces.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:183)
    How do i fix the above mentioned problem ?
    Thanks in Advance.
    Ansh

    Validate with the JAXP DOMParser instead of the JAXP SAXParser.
    To validate with a SAXParser use the xerces SAXParser.
    thanks,
    Deepak

  • Validating xml with dtd

    Hi,
             I have found a piece of code through google, to validate an xml file with an external dtd file. which is
               function validateDocument()
                    xmlDocumentObject = new ActiveXObject("microsoft.XMLDOM")
                    xmlDocumentObject.onreadystatechange = changeHandler
                    xmlDocumentObject.load('C:\\My.xml')
                function changeHandler()
               and for that we need to a import i.e  #import "C:\WINDOWS\system32\msxml4.dll"
              here when i try to import "msxml4.dll" in Acrobat javascript (js) file, it is giving error, application exits.
               How can i import dll in Acrobat javascript to get some functionality, or if not
              What someother way to achieve this(To validate xml with dtd file).
             This is totally making me crazy, please someone help me on this issue.
    thanks in advance.

    thanks Leonard,
             But my problem is i have an xml(i created that using acrobat javascript)and a dtd file, i want validate xml file with that dtd, using acrobat or some other way.  How can i validate xml with dtd, please help me.

  • Validating XML against an external DTD

    I've three questions concerning the validation of an XML file on Checkin:
    1. Can the SimpleXMLParser validate an XML file against an external (internal) DTD.
    2. How do I have to construct the !DOCTYPE Reference in my XML file for the parser to find my external DTD
    3. Do I need to have a iFS type definition for my file to get it validated
    null

    Yes, DTD Validation is supported for 1.1
    but its not supported on a Per document basis
    or a per protocol basis.
    There is a System wide Property called
    IfsDefaultDTDValidation which if set to true
    will turn on validation for the entire
    system (all protocols)
    In addition, there is also support for a validate option to be passed to the parser
    (which is currently not exposed for 1.1 through the protocols) but a Custom Parser
    or application can set the validate mode on.
    The validate option setting takes preference
    over the IfsDefaultDTDValidation setting
    null

  • Validate XML against DTD using PLSQL

    Hi Friends,
    I have an xml file and also a DTD, now I need to parse and validate this XML file against the DTD.
    Please can anyone suggest me some examples or ways to do this.
    NOTE: Only with Oracle not Java.
    Regards,
    Marlon.

    Hi, I'm not an expert but I've been reading a lot and I found this and it works. I'll hope it is useful.(Oracle 10)
    declare
    -- Local variables here
    res BOOLEAN;
    tempXML XMLType;
    xmlDoc XMLType;
    xmlSchema XMLType;
    schemaURL varchar2(256) := 'testcase.xsd';
    schemaPath varchar2(256) := '/public/testcase.xsd';
    begin
    dbms_xmlSchema.deleteSchema(schemaURL,4);
    -- Test statements here
    xmlSchema := xmlType(
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb"
    elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="root" xdb:defaultTable="ROOT_TABLE">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="child1"/>
    <xs:element name="child2"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    dbms_xmlschema.registerSchema(schemaURL,
    xmlSchema , --xdbURIType(schemaPath).getClob(),
    TRUE,TRUE,FALSE,TRUE
    xmlDoc:=xmltype('<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="' || schemaURL || '"><child1>foo</child1><child2>bar</child2></root>');
    dbms_output.put_line(xmlDoc.getStringVal());
    xmlDoc.schemaValidate();
    END;

  • Validating XML with DTD ..... Urgent

    Hi all,
    I am using java 1.4
    I have to validate the XML file with the external DTD.
    Can anyone give me the code for that.
    DTD should be external.
    Thanks,
    Vinayak.

    Hello Vinayak,
    I'm kind of new to this but I thinik I saw what you're looking for in a program called Echo05 or Echo07 in chapter 5 of http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html.
    I think I was working on it Friday and basically you have to have your own DTD then when Echo echo's the output it will throw errors with vaugue messages about how messed up your DTD is.
    Regards,
    Bill

Maybe you are looking for

  • How to use a Global database link

    i try to create a global database link through two databases MZFB et MZF14952. the MZFB database is installed under the machine MZFXPDESK the MZF14952 database is installed under another machine SUPPORT1 i execute this code CREATE DATABASE LINK dbl_1

  • Select * from table not working with Oracle OBDC driver

    Hello, In our web development we have been using the MS ODBC for Oracle driver to connect to our Oracle db. We decided to try the Oracle ODBC driver because it supports the commandTimeout property in ASP which the MS driver does not. The problem I'm

  • Slideshow elements are triggering next page in menu going nuts any ideas anyone

    slideshow heavy site is driving me nuts. Every element in slide show is triggering next page in top menu. Don't know what to do, deadline looming. any thoughts

  • Accents donu00B4t appear in mail form (Mailing Campaigns)

    Hi Gurus, When we execute mailing campaigns there are some not common characters that don´t appear. These are characters with accent, €, ..., ñ, ... guía and the result in the customer mail is gua € and appears # ... and appears # ñ and appears nothi

  • Default customer order block

    Hi experts, When creating customer master, how to default order block to customers? For e.g., when saving a new customer, order block is set in customer master automatcally. Pls help. Thx.