XSD/DTD Reference in XML ISSUE

Hi,
What I am trying to do. Lets say that I have an XML file on a machine locally, and I want to
parse that XML file and validate it against a XSD that is determined dynamically or
at runtime. What I am saying is that I have an XML file that may or may
not have a schema reference inside its top root node, but either way what I am looking to do is
to take this loaded XML file and set an XSD reference and then validate the XML file
against that XSD file ?
Even if I don't have to set the XSD reference within the XML file itself, I still need to validate it against
a XSD that will be choosen at runtime.
Any ideas out there ?
Thanks,
Wesley C. Maness
[email protected]

Thanks, for that but here is a continuation of the problem...
</MISSION_MODE_FRAME>
</MISSION_MODE>
Error while loading mission mode MissionModeComposer.xml:
no protocol: <?xml version="1.0" encoding="UTF-8"?>
<!--
        XML file used in loading Composer as a mode.
--><MISSION_MODE name="MissionModeComposer" resolution="1600x1200" swap="off" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\CMMU
\SRC\data\modes\MM_XSD.xsd">
  <MISSION_MODE_FRAME className="missionMode.renderer.ChartFrameRenderer" height="590" main="true" scalable="true" title="MissionModeComposer" width="650" x="540" y="406"
>
  <MISSION_MODE_VWS className="missionMode.renderer.ChartPanelVWSRenderer" height="0" name="chartPanel" swap="true" swapHandleColor="" width="0" x="566" y="566">
    <MISSION_MODE_COMPONENT Default="true" componentClassName="chartPanel" description="hey" maintainDisplayState="false" rendererClassName="null" resize="false" showImme
diately="true">
    </MISSION_MODE_COMPONENT>
  </MISSION_MODE_VWS>What would cause the error seen above ?
Wesley

Similar Messages

  • Adding DTD reference in xml

    hi,
          This way i am creating xml,
            var cAcrobat += "<Root>";
            cAcrobat += "<Sample>" + "Something" + "</Sample>";
            cAcrobat += "</Root>";
            this.createDataObject("Acrobat.xml", cAcrobat);
            var Acrobat = this.getDataObjectContents("Acrobat.xml");
            cAcrobat = util.stringFromStream(Acrobat,  "utf-8");
            var myXML = XMLData.parse(cAcrobat, false);
            var cAcrobat = myXML.saveXML('pretty');
            var Acrobat = util.streamFromString(cAcrobat, "utf-8");
            this.setDataObjectContents("Acrobat.xml", Acrobat);
    and as a result it is creating an xml file as an attachment to pdf,  as follows,
      <?xml version="1.0" encoding="UTF-8" ?>
    - <xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
    - <Root>
      <Sample>Something</Sample>
      </Root>
      </xfa:data>
    but i want to add DTD reference to xml file before the Root node  and after adding it should create xml like this,
    <?xml version="1.0" encoding="UTF-8" ?>
    "<!DOCTYPE  Some-application SYSTEM 'file:C:/SomeFolder/Test.dtd'>";
    - <xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
    - <Root>
      <Sample>Something</Sample>
      </Root>
      </xfa:data>
    please tell me how to add this dtd reference in xml file, and whater i am doing above is correct or not?
    please tell me how to add dtd reference in xml file.

    I already created xml file as an attachment to pdf as explained in my 1st post.  now my problem is
    How to add DTD syntax line into XML using acrobat java script or E4X objects(?). like the one below
    <DOCTYPE SomeApp:MyformData SYSTEM "C:/myreference.dtd">

  • Dom can't parse dtd reference in xml file

    Hi all,
    I am trying to parse a xml file (hibernate mapping file *.hbm.xml) using DOM. But itis getting timeout errorwhile parsing due to the external dtd reference in the xml file.
    <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >I understand that the program is trying to access the document and is not being able to do so. But I don't have any clue to solve this problem. I don't want to remove the reference from the xml file.
    The following method is trying to parse the xml file:
    public void parseXML(String file) {
            factory = DocumentBuilderFactory.newInstance();
            System.out.println(file);
             try {
                 builder = factory.newDocumentBuilder();
                 document = builder.parse(file);
                 Element docEle = document.getDocumentElement();
                 NodeList n1 = docEle.getElementsByTagName("class");
                for(int i = 0; i < n1.getLength(); i++) {
                       Element e1 = (Element) n1.item(i);
                       String nm = e1.getAttribute("name");
                     System.out.println(nm);
            } catch(Exception e) {
                throw new RuntimeException(e);
        }Please help me on this....I am at no end....Please let me know if there is any method so that the parser will overlook this reference and will parse the xml file....or any other sort of solution....
    Thanks in advance...
    Anir

    Can you provide a working sample?  Upload to Onedrive and share it with us.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Overriding the DTD reference in XML

    Hi
    I have an xml file which references a dtd within the DOCType tag. The problem I have is that currently the reference is as follows:
    file:///D:/castor/castor-0.9.3.21/castor-0.9.3.21/doc/mapping.dtd
    which makes it specific to my machine. This file along with many others is packaged into a jar and deployed on a application server. Does anyone know how to make the dtd referrence more generic. i.e how can i reference a dtd which is in the jar file which is deployed to the server.
    Currently i think weblogic does this in the deployment descriptors because it references a dtd on the web but gets one locally.
    Has anybody got any ideas
    All helpis greatly appreciated
    Thanks

    i dunno if there is a generic way of writing a SYSTEM uri that would look into a jar, so:
    * using DOM, I would create my own EntityResolver that would point the parser to the DTD located in the jar.
    * using SAX, I would do the same in the resolveEntity() method of my handler.

  • DTD + Schema reference in xml file to be inserted

    Hi,
    I am pasting sample code where I want to have schema + DTD reference. Schema file is used for validating the file and DTD is needed for entity resolution.
    <?xml version="1.0" ?>
    <!DOCTYPE html [
    <!ENTITY reg    "®">
    ]>
    <html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    </head>
    <!-- class="header" -->
    <body>
    Hi all. Register symbol should be displayed now &reg;
    </body>
    </html>I have already registered http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd schema with the DB. But, when I try to insert this xml data in the DB, I'm getting the following error.
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00104: Warning: element "html" is not declared in the DTD
    Error at line 5
    ORA-06512: at "SYS.XMLTYPE", line 296
    ORA-06512: at line 1
    31011. 00000 -  "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.Anyone please help me in resolving this issue..
    Thanks in advance,
    Divya.
    Edited by: user11853430 on Nov 28, 2010 8:45 PM

    Thanks for the information. I assume you are intending using Schema Based Binary XML storage. Attempting to use Object Realtional storage for XHTML is not something we would recommend. I am checking with development to see if we have a way of using the DTD just for entity resolution. In the mean time the only other solution I can think of it to include the full or partial DTD for XHTML in addition to the entity defintion..
    I tried this, but it doesn't seem to work
    SQL> select XMLTYPE(
      2  '<?xml version="1.0" ?>
      3  <!DOCTYPE html [
      4  <!ENTITY reg    "r">
      5  <!ELEMENT html ANY>
      6  ]>
      7  <html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd">
      8    <head>
      9      <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
    10      <meta http-equiv="Content-Style-Type" content="text/css" />
    11      <meta http-equiv="Content-Script-Type" content="text/javascript" />
    12    </head>
    13
    14  <!-- class="header" -->
    15    <body>
    16      Hi all. Register symbol should be displayed now &reg;
    17     </body>
    18  </html>') from dual
    19  /
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00106: Warning: attribute "xmlns:xsi" of element "html" is undefined
    Error at line 6
    ORA-06512: at "SYS.XMLTYPE", line 310
    ORA-06512: at line 1
    no rows selectedWhat you want is the DTD equivilant of
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="html" type="xs:anyType">
              <xs:annotation>
                   <xs:documentation>Comment describing your root element</xs:documentation>
              </xs:annotation>
         </xs:element>
    </xs:schema>I also tried making the xhtml-strict DTD available... but that did not appear to work
    First load the DTD and ENT files into the repository.
    C:\xdb\examples\DTD>sqlplus /nolog @loadDTD %CD%
    SQL*Plus: Release 11.2.0.2.0 Production on Sat Nov 27 10:55:32 2010
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    SQL> spool loadDTD.log
    SQL> --
    SQL> connect system/oracle
    Connected.
    SQL> --
    SQL> create or replace directory XMLDIR as '&1'
      2  /
    old   1: create or replace directory XMLDIR as '&1'
    new   1: create or replace directory XMLDIR as 'C:\xdb\examples\DTD'
    Directory created.
    SQL> --
    SQL> declare
      2    V_RESULT             BOOLEAN;
      3    V_DTD_FOLDER         VARCHAR2(700) := '/sys/DTD';
      4    V_DTD_TRANSITIONAL   VARCHAR2(700) := '/sys/DTD/xhtml1-transitional.dtd';
      5    V_DTD_STRICT         VARCHAR2(700) := '/sys/DTD/xhtml1-strict.dtd';
      6    V_DTD_STRICT_REG     VARCHAR2(700) := '/sys/DTD/xhtml1-strict+reg.dtd';
      7    V_ENT_LAT1           VARCHAR2(700) := '/sys/DTD/xhtml-lat1.ent';
      8    V_ENT_SYMBOL         VARCHAR2(700) := '/sys/DTD/xhtml-symbol.ent';
      9    V_ENT_SPECIAL        VARCHAR2(700) := '/sys/DTD/xhtml-special.ent';
    10  begin
    11    if (not DBMS_XDB.existsResource(V_DTD_FOLDER)) then
    12      V_RESULT := DBMS_XDB.createFolder(V_DTD_FOLDER);
    13    end if;
    14    if (not DBMS_XDB.existsResource(V_DTD_TRANSITIONAL)) then
    15      V_RESULT := DBMS_XDB.createResource(V_DTD_TRANSITIONAL,bfilename('XMLDI
    R','xhtml1-transitional.dtd'));
    16    end if;
    17    if (not DBMS_XDB.existsResource(V_DTD_STRICT)) then
    18      V_RESULT := DBMS_XDB.createResource(V_DTD_STRICT,bfilename('XMLDIR','xh
    tml1-strict.dtd'));
    19    end if;
    20    if (not DBMS_XDB.existsResource(V_DTD_STRICT_REG)) then
    21      V_RESULT := DBMS_XDB.createResource(V_DTD_STRICT_REG,bfilename('XMLDIR'
    ,'xhtml1-strict+reg.dtd'));
    22    end if;
    23    if (not DBMS_XDB.existsResource(V_ENT_LAT1)) then
    24      V_RESULT := DBMS_XDB.createResource(V_ENT_LAT1,bfilename('XMLDIR','xhtm
    l-lat1.ent'));
    25    end if;
    26    if (not DBMS_XDB.existsResource(V_ENT_SYMBOL)) then
    27      V_RESULT := DBMS_XDB.createResource(V_ENT_SYMBOL,bfilename('XMLDIR','xh
    tml-symbol.ent'));
    28    end if;
    29    if (not DBMS_XDB.existsResource(V_ENT_SPECIAL)) then
    30      V_RESULT := DBMS_XDB.createResource(V_ENT_SPECIAL,bfilename('XMLDIR','x
    html-special.ent'));
    31    end if;
    32    commit;
    33  end;
    34  /
    PL/SQL procedure successfully completed.
    SQL> select ANY_PATH
      2    from RESOURCE_VIEW
      3   where under_path(RES,'/sys/DTD') = 1
      4  /
    ANY_PATH
    /sys/DTD/xhtml-lat1.ent
    /sys/DTD/xhtml-special.ent
    /sys/DTD/xhtml-symbol.ent
    /sys/DTD/xhtml1-special.ent
    /sys/DTD/xhtml1-strict+reg.dtd
    /sys/DTD/xhtml1-strict.dtd
    /sys/DTD/xhtml1-symbol.ent
    /sys/DTD/xhtml1-transitional.dtd
    8 rows selected.
    SQL> quit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64
    bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    C:\xdb\examples\DTD>However even after adding the references to the XML document
    SQL> select XMLTYPE(
      2  '<?xml version="1.0" ?>
      3  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      4          "/sys/DTD/xhtml1-strict+reg.dtd">
      5  <html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd">
      6    <head>
      7      <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
      8      <meta http-equiv="Content-Style-Type" content="text/css" />
      9      <meta http-equiv="Content-Script-Type" content="text/javascript" />
    10    </head>
    11
    12  <!-- class="header" -->
    13    <body>
    14      Hi all. Register symbol should be displayed now &reg;
    15     </body>
    16  </html>') from dual
    17  /
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 402 (U+0192)
    Error at line 3
    Error at line 34
    Error at line 25
    ORA-06512: at "SYS.XMLTYPE", line 310
    ORA-06512: at line 1
    no rows selected
    SQL>

  • How to parse XML against XSD,DTD, etc.. locally (no internet connection) ?

    i've searched on how to parse xml against xsd,dtd,etc.. without the needs of internet connection..
    but unfortunately, only the xsd file can be set locally and still there needs the internet connection for the other features, properties.
    XML: GML file input from gui
    XSD: input from gui
    javax.xml
    package demo;
    import java.io.File;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.xml.XMLConstants;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.SAXException;
    public class Sample1WithJavaxXML {
         public static void main(String[] args) {
              URL schemaFile = null;
              try {
                   //schemaFile = new URL("http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd");
                   File file0 = new File("AppSchema-C01-v1_0.xsd");
                   schemaFile = new URL(file0.toURI().toString());
              } catch (MalformedURLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              //Source xmlFile = new StreamSource(new File("web.xml"));
              Source xmlFile = new StreamSource(new File("C01.xml"));
              SchemaFactory schemaFactory = SchemaFactory
                  .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              //File file1 = new File("XMLSchema.dtd");
              //SchemaFactory schemaFactory = SchemaFactory
                   //.newInstance("javax.xml.validation.SchemaFactory:XMLSchema.dtd");
              Schema schema = null;
              try {
                   schema = schemaFactory.newSchema(schemaFile);
              } catch (SAXException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              Validator validator = schema.newValidator();
              try {
                validator.validate(xmlFile);
                System.out.println(xmlFile.getSystemId() + " is valid");
              } catch (SAXException e) {
                System.out.println(xmlFile.getSystemId() + " is NOT valid");
                System.out.println("Reason: " + e.getLocalizedMessage());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Xerces
    package demo;
    import java.io.File;
    import java.util.Date;
    import org.apache.xerces.parsers.DOMParser;
    public class SchemaTest {
         private String xmlFile = "";
         private String xsdFile = "";
         public SchemaTest(String xmlFile, String xsdFile) {
              this.xmlFile = xmlFile;
              this.xsdFile = xsdFile;
         public static void main (String args[]) {
              File file0 = new File("AppSchema-C01-v1_0.xsd");
              String xsd = file0.toURI().toString();
              SchemaTest testXml = new SchemaTest("C01.xml",xsd);
              testXml.process();
         public void process() {
              File docFile = new File(xmlFile);
              DOMParser parser = new DOMParser();
              try {
                   parser.setFeature("http://xml.org/sax/features/validation", true);
                   parser.setFeature("http://apache.org/xml/features/validation/schema", true);
                   parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                             xsdFile);
                   ErrorChecker errors = new ErrorChecker();
                   parser.setErrorHandler(errors);
                   System.out.println(new Date().toString() + " START");
                   parser.parse(docFile.toString());
              } catch (Exception e) {
                   System.out.print("Problem parsing the file.");
                   System.out.println("Error: " + e);
                   System.out.println(new Date().toString() + " ERROR");
                   return;
              System.out.println(new Date().toString() + " END");
    }

    Thanks a lot Sir DrClap..
    I tried to use and implement the org.w3c.dom.ls.LSResourceResolver Interface which is based on the SAX2 EntityResolver.
    please give comments the way I implement it. Here's the code:
    LSResourceResolver Implementation
    import org.w3c.dom.ls.LSInput;
    import org.w3c.dom.ls.LSResourceResolver;
    import abc.xml.XsdConstant.Path.DTD;
    import abc.xml.XsdConstant.Path.XSD;
    public class LSResourceResolverImpl implements LSResourceResolver {
         public LSResourceResolverImpl() {
          * {@inheritDoc}
         @Override
         public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
              ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              LSInput input = new LSInputImpl(publicId, systemId, baseURI);
              if ("http://www.w3.org/2001/xml.xsd".equals(systemId)) {
                   input.setByteStream(classLoader.getResourceAsStream(XSD.XML));
              } else if (XsdConstant.PUBLIC_ID_XMLSCHEMA.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.XML_SCHEMA));
              } else if (XsdConstant.PUBLIC_ID_DATATYPES.equals(publicId)) {
                   input.setByteStream(classLoader.getResourceAsStream(DTD.DATATYPES));
              return input;
    }I also implement org.w3c.dom.ls.LSInput
    import java.io.InputStream;
    import java.io.Reader;
    import org.w3c.dom.ls.LSInput;
    public class LSInputImpl implements LSInput {
         private String publicId;
         private String systemId;
         private String baseURI;
         private InputStream byteStream;
         private String stringData;
         public LSInputImpl(String publicId, String systemId, String baseURI) {
              super();
              this.publicId = publicId;
              this.systemId = systemId;
              this.baseURI = baseURI;
         //getters & setters
    }Then, here's the usage/application:
    I create XMLChecker class (SchemaFactory implementation is Xerces)
    import java.io.File;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.XMLConstants;
    import javax.xml.stream.FactoryConfigurationError;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import abc.xml.XsdConstant.Path.XSD;
    public class XMLChecker {
         private ErrorMessage errorMessage = new ErrorMessage();
         public boolean validate(String filePath){
              final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
              List<Source> schemas = new ArrayList<Source>();
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XML_SCHEMA)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream(XSD.XLINKS)));
              schemas.add(new StreamSource(classLoader.getResourceAsStream("abc/xml/AppSchema.xsd")));
              SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              schemaFactory.setResourceResolver(new LSResourceResolverImpl());
              try {
                   Schema schema = schemaFactory.newSchema(schemas.toArray(new Source[schemas.size()]));
                   Validator validator = schema.newValidator();
                   validator.setErrorHandler(new ErrorHandler() {
                        @Override
                        public void error(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void fatalError(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                        @Override
                        public void warning(SAXParseException e) throws SAXException {
                             errorMessage.setErrorMessage(e.getMessage());
                             errorMessage.setLineNumber(e.getLineNumber());
                             errorMessage.setColumnNumber(e.getLineNumber());
                             throw e;
                   StreamSource source = new StreamSource(new File(filePath));
                   validator.validate(source);
              } catch (SAXParseException e) {
                   return false;
              } catch (SAXException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (FactoryConfigurationError e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              } catch (IOException e) {
                   errorMessage.setErrorMessage(e.getMessage());
                   return false;
              return true;
         public ErrorMessage getErrorMessage() {
              return errorMessage;
    }Edited by: erossy on Aug 31, 2010 1:56 AM

  • XSDs/DTDs for BI reports xml

    In Oracle BI Answers, in the Advanced tab, it’ possible to see / define the XML (saw:criteria, saw:columns, saw:views etc).
    The saw:report root node defines two Siebel XML namespace :
    xmlns:saw=”com.siebel.analytics.web/report/v1″
    xmlns:sawx=”com.siebel.analytics.web/expression/v1″
    Do you, by any chance, have a clue where those schemas are documented or where can one find the XSDs/DTDs?
    Thx
    Suneesh

    Please post the details of the application release, database version and OS.
    I am having a situation where the XML Publisher is producing XML output vs. PDF output for a particular report. It is generating PDF output just fine for other reports. Can you please shed some light as to the possible cause(s) for this? I would really appreciate it!What is the difference between this report and other reports?
    Please see old threads for similar discussion -- https://forums.oracle.com/forums/search.jspa?threadID=&q=XML+ANd+Publisher+AND+PDF+AND+Output&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Validate XML document (no DTD reference)

    Hi,
    I have two files: document.xml and rules.dtd. My "document.xml" does not reference "rules.dtd", but I would like to validate basead on this file. Is it possible?
    Is there a method like: boolean isValid(String xmlFile, String dtdFile) ?
    Thanks,
    Andr�

    Add a <!DOCTYPE root_element SYSTEM "dtdFile.dtd"> to the xml document.

  • File Adapter - Native XSD - DTD to XSD

    Hello,
    a. I have to read a data file using file adapters, which is sent in the following pattern (dtd below):
    <?xml version="1.0" encoding="US_ASCII"?>
    <!DOCTYPE message SYSTEM "d3l.dtd">
    <message name="ITEM" type="ItemArray" object="ITEM_BO">
    <struct id="ItemRecord">
         <field name="Process_Flag"><limstring delimiter=";"/></field>
         <field name="Item_Number"><limstring delimiter="|"/></field>
         <field name="Attribute2"><limstring delimiter="|"/></field>
    </struct>
    <limarray id="itarray" contchar="*" endchar="!">
         <typeref type="ItemRecord"/>
    </limarray>
    <struct id="ItemArray">
         <field name="ItemLine"><typeref type="itarray"/></field>
    </struct>
    </message>
    b. whose sample data is as below:
    ;P;|00030||TEST1|*;P;|00040||TEST2|!
    c. I am now in the process of designing my native xsd:
    i. I can either use convert dtd to xsd (or)
    ii. create my own sample schema definition which is similar to the above data structure
    In step (i), I could not convert the dtd to xsd, due to reference to d3l.dtd file.
    If anyone can advise where this d3l.dtd file can be found and where I should place it in 'SOA' it would be really helpful.
    In step (ii), I find that through the wizard I am able to create simple csv file styles, but not able to create the above data structure due to different delimiters (; and |) and also due to delimiter-embedding of data.
    It would be really helpful if someone can advise on how I must proceed with this issue.
    Thanks,
    Santhosh

    Hello Ramana,
    As for step one, the 'd3l.dtd' is a file which all Oracle Interconnect DTDs look up to. I am not able to locate it.
    As for step two, the data file the structure is of the following pattern :
    i. entire data is in single line of the data file..
    ii. first element will be embedded with semi colon
    iii. the other elements inside pipes
    iv. end of record is indicated using *
    v. end of file is indicated using !
    These are the rules based on which the data file is built.
    I don't have much experience in creating xsd (except for simple native xsds that I have created using the native xsd wizard of Jdev-BPEL).
    Using the native XSD wizard that is available with JDev-BPEL, I trust I cannot create complex data structure which is of the above pattern.
    If there is a good tool/method through which I can create the xsd as per the above listed rule structure, please advise.
    Thanks,
    Santhosh

  • DTD for deployment  xml file for providers

    Hi all,
    where can I find the DTD for the deployment file that is to be used in .par file for the custom providers for Portal Server 6.0 and 6.2. ?
    Thanks,
    Klara

    in case you mean portlets then it is:
    portlet.xsd contains reference to http://www.w3.org/2001/xml.xsd.
    in case you mean providers, e.g. smpleMailservice:
    /ps-base/SUNWam/dtd/sms.dtd
    or
    /ps-base/SUNWam/dtd
    with all the named dtd's
    cheers,
    Ulf

  • Ignore DTD reference in message monitoring (SXMB_MONI)

    Hi All,
    My Inbound Message (to be delivered to the target system) needs to have DTD reference as the target system mandates it.
    In the mapping I have added the DTD Reference (<!DOCTYPE .../>).
    Although the target system is happy ,massage monitoring is complaining that the DTD is missing when I want to display the XML message.This is a support issue as the inbound XML message is not diaplayed  in SXMB_MONI.
    Is there any way to work around it - Configuration or putting the DTDs somewhere in XI server.
    Thanks in Advance,
    Bikram

    Rather than add the DTD reference in a message mapping, you could try add it in a Java module attached to the receiver/outbound module-chain of your target communication channel.  This way the DTD line would not get added until after the message has left the integration server.
    Check out the following guide:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
    Let me know how you get on.
    (+ please assign me some forum points if you found this useful).
    Thanks,
    Paul Digance.

  • Make DocumentBuilder.parse ignore DTD references

    Thanks to everyone in advance -
    So this issue looks to be pretty popular, I have found a few solutions, but nothing seems to stop the downloading of dtd files, for instance ones sitting up on w3.org.
    Here are some of the solutions i have found:
    http://stackoverflow.com/questions/155101/make-documentbuilder-parse-ignore-dtd-references
    http://forums.sun.com/thread.jspa?threadID=284209&forumID=34
    When I use this solution:
    myDocumentBuilder.setEntityResolver(new EntityResolver() {
              public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
                     throws SAXException, java.io.IOException
                if (publicId.equals("--myDTDpublicID--"))
                  // this deactivates the open office DTD
                  return new InputSource(new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>".getBytes()));
                else return null;
    });it still continues to download the dtd.
    Any suggestions?
    Thanks,
    Sam

                        MyDocumentBuilder.setEntityResolver(
                             new EntityResolver() {
                                  public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException, java.io.IOException {
                                       if(true){
                                            throw new IOException(publicId +"|"+ systemId);
                                       return null ;
                        );Good eye - It looks like that IOException is never being called - any suggestions?
    Thanks,
    Sam

  • XSDBuilder fails to resolve DTD references

    I am evaluating XDK 9.2.0.5.0 for Java and have encountered a problem
    with XML Schema support.
    I am using XSDBuilder to build an XMLSchema object from several .xsd
    files. The main .xsd file is secext.xsd, and this file imports other
    .xsd files. I assign an EntityResolver to the XSDBuilder so that all
    imported schema files will be read from my local file system, rather
    than being retrieved from the Internet.
    XSDBuilder does call my EntityResolver to resolve the import
    statements in the XML Schema files; however, it fails to call my
    EntityResolver to resolve XMLSchema.dtd reference in the DOCTYPE
    declaration of xml.xsd.
    I am using Oracle XDK version 9.2.0.5.0 on Solaris 8 with Java 1.4. I
    have also tried version 10.1.0.0.0 beta and received the same results.
    Here is the test case:
    Download the following files and save them in /tmp/xsd/.
    http://schemas.xmlsoap.org/ws/2002/04/secext/secext.xsd
    http://www.w3.org/2001/xml.xsd
    http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
    http://www.w3.org/2001/XMLSchema.dtd
    Compile and run OracleSchemaTest.java, passing 'secext.xsd' as the
    command line arg.
    java dfranklin.OracleSchemaTest secext.xsd
    It produces the following output:
    resolveEntity: null, secext.xsd
    resolved to /tmp/xsd/secext.xsd
    resolveEntity: http://schemas.xmlsoap.org/ws/2002/04/secext, http://www.w3.org/2001/xml.xsd
    resolved to /tmp/xsd/xml.xsd
    <Line 2, Column 80>: XML-0112: (Fatal Error) Error opening external DTD 'XMLSchema.dtd'.
    Exception in thread "main" oracle.xml.parser.schema.XSDException: Error opening external DTD 'XMLSchema.dtd'.
    at oracle.xml.parser.schema.XSDBuilder.parseIncludeAndImport(XSDBuilder.java:814)
    at oracle.xml.parser.schema.XSDBuilder.parseTopLevelElem(XSDBuilder.java:662)
    at oracle.xml.parser.schema.XSDBuilder.buildSchema(XSDBuilder.java:486)
    at oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:304)
    at oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:249)
    at dfranklin.OracleSchemaTest.buildXMLSchema(OracleSchemaTest.java:48)
    at dfranklin.OracleSchemaTest.run(OracleSchemaTest.java:29)
    at dfranklin.OracleSchemaTest.main(OracleSchemaTest.java:23)
    The output shows that the EntityResolver is not being called to
    resolve 'XMLSchema.dtd'.
    === begin OracleSchemaTest.java ===
    package dfranklin;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStream;
    import oracle.xml.parser.schema.XMLSchema;
    import oracle.xml.parser.schema.XSDBuilder;
    import oracle.xml.parser.schema.XSDException;
    import oracle.xml.parser.v2.XMLError;
    import org.xml.sax.InputSource;
    public class OracleSchemaTest
    implements org.xml.sax.EntityResolver
    private static String xsdstr;
    private static String basepath = "/tmp/xsd";
    public static void main(String[] args)
    throws Exception
    xsdstr = args[0];
    new OracleSchemaTest().run();
    public void run()
    throws Exception
    XMLSchema xmlSchema = buildXMLSchema(xsdstr);
    System.out.println("xmlSchema=" + xmlSchema);
    public XMLSchema buildXMLSchema(String systemId)
    throws Exception
    XSDBuilder xsdBuilder = new XSDBuilder();
    xsdBuilder.setEntityResolver(this);
    InputStream xsdin = null;
    InputSource insrc = resolveEntity(null, xsdstr);
    if (insrc != null) {
    xsdin = insrc.getByteStream();
    if (xsdin == null) {
    throw new IOException("Can't resolve entity " + xsdstr);
    XMLSchema xmlSchema = (XMLSchema)xsdBuilder.build(xsdin, null);
    return xmlSchema;
    public InputSource resolveEntity(String publicId, String systemId)
    throws
    org.xml.sax.SAXException,
    java.io.IOException
    System.err.println("resolveEntity: " + publicId + ", " + systemId);
    String fn;
    if ("http://www.w3.org/2001/xml.xsd".equals(systemId)) {
    fn = basepath + "/" + "xml.xsd";
    } else if ("http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd".equals(systemId)) {
    fn = basepath + "/" + "xmldsig-core-schema.xsd";
    } else if ("http://www.w3.org/2001/XMLSchema.dtd".equals(systemId)) {
    fn = basepath + "/" + "XMLSchema.dtd";
    } else {
    fn = basepath + "/" + systemId;
    try {
    InputStream in = new FileInputStream(fn);
    System.err.println("resolved to " + fn);
    InputSource insrc = new InputSource(in);
    insrc.setSystemId(systemId);
    return insrc;
    } catch (FileNotFoundException e) {
    return null;
    ==== end OracleSchemaTest.java ===

    I am evaluating XDK 9.2.0.5.0 for Java and have encountered a problem
    with XML Schema support.
    I am using XSDBuilder to build an XMLSchema object from several .xsd
    files. The main .xsd file is secext.xsd, and this file imports other
    .xsd files. I assign an EntityResolver to the XSDBuilder so that all
    imported schema files will be read from my local file system, rather
    than being retrieved from the Internet.
    XSDBuilder does call my EntityResolver to resolve the import
    statements in the XML Schema files; however, it fails to call my
    EntityResolver to resolve XMLSchema.dtd reference in the DOCTYPE
    declaration of xml.xsd.
    I am using Oracle XDK version 9.2.0.5.0 on Solaris 8 with Java 1.4. I
    have also tried version 10.1.0.0.0 beta and received the same results.
    Here is the test case:
    Download the following files and save them in /tmp/xsd/.
    http://schemas.xmlsoap.org/ws/2002/04/secext/secext.xsd
    http://www.w3.org/2001/xml.xsd
    http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
    http://www.w3.org/2001/XMLSchema.dtd
    Compile and run OracleSchemaTest.java, passing 'secext.xsd' as the
    command line arg.
    java dfranklin.OracleSchemaTest secext.xsd
    It produces the following output:
    resolveEntity: null, secext.xsd
    resolved to /tmp/xsd/secext.xsd
    resolveEntity: http://schemas.xmlsoap.org/ws/2002/04/secext, http://www.w3.org/2001/xml.xsd
    resolved to /tmp/xsd/xml.xsd
    <Line 2, Column 80>: XML-0112: (Fatal Error) Error opening external DTD 'XMLSchema.dtd'.
    Exception in thread "main" oracle.xml.parser.schema.XSDException: Error opening external DTD 'XMLSchema.dtd'.
    at oracle.xml.parser.schema.XSDBuilder.parseIncludeAndImport(XSDBuilder.java:814)
    at oracle.xml.parser.schema.XSDBuilder.parseTopLevelElem(XSDBuilder.java:662)
    at oracle.xml.parser.schema.XSDBuilder.buildSchema(XSDBuilder.java:486)
    at oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:304)
    at oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:249)
    at dfranklin.OracleSchemaTest.buildXMLSchema(OracleSchemaTest.java:48)
    at dfranklin.OracleSchemaTest.run(OracleSchemaTest.java:29)
    at dfranklin.OracleSchemaTest.main(OracleSchemaTest.java:23)
    The output shows that the EntityResolver is not being called to
    resolve 'XMLSchema.dtd'.
    === begin OracleSchemaTest.java ===
    package dfranklin;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStream;
    import oracle.xml.parser.schema.XMLSchema;
    import oracle.xml.parser.schema.XSDBuilder;
    import oracle.xml.parser.schema.XSDException;
    import oracle.xml.parser.v2.XMLError;
    import org.xml.sax.InputSource;
    public class OracleSchemaTest
    implements org.xml.sax.EntityResolver
    private static String xsdstr;
    private static String basepath = "/tmp/xsd";
    public static void main(String[] args)
    throws Exception
    xsdstr = args[0];
    new OracleSchemaTest().run();
    public void run()
    throws Exception
    XMLSchema xmlSchema = buildXMLSchema(xsdstr);
    System.out.println("xmlSchema=" + xmlSchema);
    public XMLSchema buildXMLSchema(String systemId)
    throws Exception
    XSDBuilder xsdBuilder = new XSDBuilder();
    xsdBuilder.setEntityResolver(this);
    InputStream xsdin = null;
    InputSource insrc = resolveEntity(null, xsdstr);
    if (insrc != null) {
    xsdin = insrc.getByteStream();
    if (xsdin == null) {
    throw new IOException("Can't resolve entity " + xsdstr);
    XMLSchema xmlSchema = (XMLSchema)xsdBuilder.build(xsdin, null);
    return xmlSchema;
    public InputSource resolveEntity(String publicId, String systemId)
    throws
    org.xml.sax.SAXException,
    java.io.IOException
    System.err.println("resolveEntity: " + publicId + ", " + systemId);
    String fn;
    if ("http://www.w3.org/2001/xml.xsd".equals(systemId)) {
    fn = basepath + "/" + "xml.xsd";
    } else if ("http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd".equals(systemId)) {
    fn = basepath + "/" + "xmldsig-core-schema.xsd";
    } else if ("http://www.w3.org/2001/XMLSchema.dtd".equals(systemId)) {
    fn = basepath + "/" + "XMLSchema.dtd";
    } else {
    fn = basepath + "/" + systemId;
    try {
    InputStream in = new FileInputStream(fn);
    System.err.println("resolved to " + fn);
    InputSource insrc = new InputSource(in);
    insrc.setSystemId(systemId);
    return insrc;
    } catch (FileNotFoundException e) {
    return null;
    ==== end OracleSchemaTest.java ===

  • Multiple xsd's for one xml file

    Hi Experts,
    My scenario is HTTP to IDoc. My client is sending me XML file as input. I have got 4 XSD's from that XML file. I imported them into PI with giving references by using new importing method with refenences. I have got 4 XSD's imported succesfully into PI with the references in external references tab.
    Tha problem is each XSD is creating multiple messages(splitted) in PI. I can't use any one message in mapping becuase no message has full message to map with the output. One message has reference to the other message.
    Please suggest me how to proceed...
    Thanks-
    Ramesh.

    There should be a Main XSD which will refer the other (4) XSDs....right now you seem to be importing the XSDs independently.
    If XSD1 is referring XSD2, XSD2 is referring XSD3 and so on.....then XSD1 will form your Main XSD and then each XSD will have a separate reference to the next XSD.....all the XSDs need to be imported in XI.
    For example, create Data-types DT1, DT2, DT3, DT4 and provide a reference between them....DT2 in DT1, DT3 in DT2, DT4 in DT3....ultimately DT1 will refer all the other strcutures.....I hope this is what you are looking for.

  • Data Integrator import XSD / DTD error

    Hi experts,
    Really need your help here!  I am trying to import an XSD or DTD schema into BODI.  I have both the XSD and DTD which I generated from the XML source file, using Altova XMLSpy.  BODI is allowing me to select the root element, but when I run the import, the memory usage on my PC against the BODI service goes to 1.5Gb, after which the following error is returned:
    Unknown error when importing metadata. (BODI-1112416)
    When I clear this error and try any other operations in the DI Designer I get out of memory errors and I have to close down the application and restart.  I am running a 4Gb RAM, Intel Core Duo, Windows 7 laptop.  I suspect the XSD / DTD structure is simply to large for BODI to parse.  The XSD and DTD is about 500Kb in size and contain over 16000 rows when viewed in a text editor!
    Any suggestions on how to process this XML in BODI will be greatly appreciated.
    Regards,
    Johann

    Hi,
    replace choice with sequence
    <b><xsd:complexType>
         <xsd:choice>
              <xsd:element name = “A” type=”xsd:string” />
              <xsd:element name= B” type=”xsd:string” maxOccurs=”unbounded” />
         </xsd:choice>
    </xsd:complexType></b>
    is handled identical to
    <b><xsd:complexType>
         <xsd:sequence>
              <xsd:element name = “A” type=”xsd:string” minOccurs=”0” />
              <xsd:element name= B” type=”xsd:string”
    minOccurs=”0” maxOccurs=”unbounded” />
         </xsd:sequence>
    </xsd:complexType></b>
    Regards
    Tarun Telang

Maybe you are looking for

  • How do i change the default main page (store)?

    hi, simple question: how do i change the start page in itunes? since some time, itunes starts always with itunes store... i dont like that i would like my library in front... anyone?

  • Pricing condition record text maintenance in multiple language

    Hi friends, While maintaining condition record by VK31 transaction, there are options for multiple language selection. but after saving it appears only in English. Please let me know whether we can maintain text in multiple languages for a pricing co

  • Why doesn't Microsoft support Helvetica and Times?

    All Macintosh computers and other Apple Inc. products come with Helvetica and Times fonts built-in by default, although Windows doesn't. Helvetica is probably, at least to my opinion, the best and finest among all Sans-Serif and other typefaces in th

  • GuidedProcedure - how to move uploaded document into KM?

    Hello Anyone, could you please help me on how to get an uploaded Document into a specific Directory of the KnowledgeManagement? Currently I am trying to create a Process (Guided Procedure) which lets a User upload a Document (Callable Object->Misc->F

  • What is the best tool to use if I want to quickly create and learn SQL?

    I have downloaded and installed: http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html instantclient-sqlplus-win32-10.2.0.3-20061115.zip (722,059 bytes) instantclient-basic-win32-10.2.0.3-20061115.zip (34,469,920 bytes)