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>

Similar Messages

  • Can DTD schema for a XML file be a data source to the Crystal Reports?

    Hi All,
    We are trying to generate a crystal report having XML file as a source. And we want to use the DTD schema for the source XML file.
    Please suggest whether DTD schema can be used for crystal reports or not.
    Thanks
    Sriram

    Hi Sriram,
    I think it should work.
    1) Use this pdf for your reference
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90faaea7-8e1e-2b10-e6a7-ea82e11d9e8b ]
    2)if in case it does not help you can convert existing DTD to XSD using this online converter
    [http://www.hitsw.com/xml_utilites/]
    and  then use for generating report from XML file.
    Regards,
    Jeetsinh Parmar.

  • Specifying Schema Location in XML file and not in the Java code

    I have a repository of schema xsd files. When I receive my xml file, I need to validate it against the specified schema. The xml file would declare the schema location, using the following syntax:
    <CERD:CERD xsi:schemaLocation = "..\CERD.xsd" xmlns:CERD = "CERD.xsd" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
    Is it really necessary to define the schema location again in the JAVA code? Why set the schemaLocation in the xml file at all then?
    Does anybody have any examples where the schema location is not set in the JAVA code? I am using Java 1.6, and at this point in time I only need to validate. Any help would be appreciated.

    Thank you very much for your quick reply. I have made some progress but I am still stumped.
    In my code I am doing this:
    SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = factory.newSchema();
    Validator validator = schema.newValidator();
    validator.validate(XML_SOURCE);
    I find this works if my schema does not have a target namespace. I have downloaded the following simple example from the internet that uses a target namespace and it fails:
    library1.xsd:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://example.org/prod"
    xmlns:prod="http://example.org/prod">
    <xsd:element name="product" type="prod:ProductType"/>
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="number" type="xsd:integer"/>
    <xsd:element name="size" type="prod:SizeType"/>
    </xsd:sequence>
    <xsd:attribute name="effDate" type="xsd:date"/>
    </xsd:complexType>
    <xsd:simpleType name="SizeType">
    <xsd:restriction base="xsd:integer">
    <xsd:minInclusive value="2"/>
    <xsd:maxInclusive value="18"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    <prod:product xmlns:prod="http://example.org/prod"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="library1.xsd"
    effDate="2001-04-02">
    <number>557</number>
    <size>10</size>
    </prod:product>
    I get the following SAXParseException when I validate:
    [line 4, col 36|
    cvc-elt.1: Cannot find the declaration of element 'prod:product'.
    Am I doing something wrong with the namespace declaration?
    Edited by: alfredamorrissey on Oct 31, 2007 6:34 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

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

  • Load Multiple Tables (schemas) from same XML file

    Hi,
    This is first time i am working XML files.
    I have one XML file with two tables (schema). I need to load those two tables into two different Target tables.
    This is the startegy to choose tables.
    <Entry type="full"> --Table 1
    <Entry type="short">--Table 2
    I am try to find the tables like this using condition split (Type == "Full" ) but tables are not splitting as expected, is am i going with wrong approach??
    Can anyone suggest me to process multiples tables from same XML file??

    Hi Naveen,
    After the issue in my environment, the package works well that the data in the XML file load to two destination tables based on one column values. The screenshot is for your reference:
    To troubleshoot this issue, could you please check the values in the type column? Verify the values have exactly the same characters, case sensitivity. It seems that you haven’t write correct values in the Conditional Split Transformation. They should be like
    below:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
     If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • RELAX NG or Schematron schemas for Pages XML file format?

    Hey, I have been following with interest for over a year - more like two years - the whole "where are the XML schemas" for Keynote 1, and then Pages and Keynote 2.
    Apparently there is some difficulty obtaining them and I would guess that means defining them. Because if Apple had their hands on them, they would be out - and up to date - by now.
    XML Schema (.xsd) files are pretty painful to generate. There is a much simpler and and yet even more powerful schema format called "Relax NG". Assuming someone knows what the grammar is that Pages will willingly/successfully slurp up - they could probably create a .rnc file from scratch pretty quickly. The learning curve is pretty short for basic stuff and the amount of typing required is at least 40% less than when you create a .xsd file.
    Some things do not lend themselves to grammar based schemas like XSD, RNG, or RNC.
    Instead, a rule based schema language works better. Schematron is very good for this. The suffix for this file type is ".sch". The web site is easy to get to - just type schematron in your web browser's address field and press enter. Specs are all there.
    There is a program called Examplotron that creates a Schematron schema for you, given an XML file that is a sample. Of course, making rules from one example is not the same as knowing all the rules. The more different kinds of stuff you have in the file though, the better your chances are of getting a decent start going. Examplotron lives on the web at examplotron.org in case you are curious.
    OxygenXML is a very, very good XML editor and schema development environment. I have used it and a bunch of others. It is my favorite, by far.
    Someone at Apple should get on this. If it is too hard to create an XML Schema file - then please, please - try to create an RNG, RNC, or SCH file.
    If Apple cannot do it, then perhaps the user community could take a crack at it. However, it is a little bit like trying to document the laws of a country by watching what the government people do, what people do who do not get arrested, and what people do who do get arrested.
    You are not certain to see an example of every law being broken - for starters, so you will miss some. (One hopes you will not see every law that exists broken!)
    You are also not going to be able to tell what laws have influenced behavior that is lawful.
    So, for both reasons, you might unwittingly "break the laws" of this hypothetical land. In that case, you might be executed, fined, imprisoned, or as is the case still in some countries - have your hand chopped off!
    In the case of feeding a file based on mistaken assuptions to Pages, it certainly will not do what you want it do do. In theory, it might even crash, lose some data, pop up an error - or worse maybe not pop up an error, or corrupt its internal structures and become unstable. Or seem to work but fail to write the whole file out again. Or write out something that it cannot read in again - or does not reconstitute into the document that you used to have.
    Granted, there is a brute force technique that can be employed. You can write an AppleScript that gets pages to create a document that exercises every possible style and feature and logical ordering and nesting of things.
    Then you can study the XML that generates, or even feed to to Examplotron or a DTD generator.
    Doing so would probably be a way to get a good start going.
    Without any schema, there is no way to know if a complex program-generated Pages document will work right with pages.
    Granted, such program-generated documents can be generated with Applescripts. But if one already has some XML that one wants to blend in, for example - then it would be better to do it with XSLT. Or Java. Or whatever.
    Unfortunately, you really have to know what XML is legal in pages - and you have to know the grammar or rules for what Pages expects.
    So, any XSD coming from Apple in the near future - or any interest at Apple in completing a .rnc or .rng schema if it gets mostly done by customer(s) and then handed off to Apple to finish?

    XML converter (an add on to Inbound Refinery) could be used to display the contents with your XSLT choices but analyzing the file to prevent checkin would take data validation that would be custom. The CS does not care the file format or file type for checkin. Others have looked for analysis of file extension to stop checkin of certain extensions. This has been custom. I think there may be enhancement requests from customers for this kind of validation for the CS but it does not exist in the core yet.

  • Creating schema from an XML file in Java

    I know that there are a lot of tools out that that do this, but I need some special conversion done.
    Is there any source code out there that shows you how to take in an XML file and generate schema for it using Java? The only thing I found used C# and various Microsoft XML classes that don't either exist or do different things in Java.
    Thanks!

    Refer "trang" in http://hacks.oreilly.com/pub/h/2106. The jar will have to be present in Classpath as well.
    But it is always better to first define schema rather than generating constraints(schema) based on a XML instance. A generated schema may not have all the constraints that your application might need for enforcement.

  • Help: DTD only partially validating XML file

    Following are a small XML file I wrote and its accompagning DTD:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE userSettings SYSTEM "userSettings.dtd">
    <userSettings>
    <pref name = "language" type = "string" value="EN" />
    <pref name = "defaultfont" type = "string" value = "Arial" />
    <pref name = "defaultPageWidth" type = "number" value = "595" />
    <pref name = "defaultPageHeight" type = "number" value = "841" />
    </userSettings>DTD:
    <!ELEMENT userSettings (pref+)>
    <!ELEMENT pref EMPTY>
    <!ATTLIST pref
              name     CDATA          #REQUIRED
              type     (string | number)     #REQUIRED
              value     CDATA          #REQUIRED
    >So the attribute "type" of the element "pref" can only be either a number or a string. But if i write "sting" for example, the DTD does not issue an error. I know the DTD is working since changing the root element for instance does generate errors.
    Anyone has a clue to why is my DTD only partially validating my XML file?

    Hello!
    This is a simple example in Sun jdk 1.4.2.
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.parsers.SAXParser;
    import java.io.File;
    public class DTDValidator extends DefaultHandler {
        public static void main(String[] args) {
            try {
                SAXParserFactory factory = SAXParserFactory.newInstance();
                factory.setValidating(true);
                SAXParser parser = factory.newSAXParser();
                DTDValidator myHandler = new DTDValidator();
                File file = new File("my.xml");
                parser.parse(file, myHandler);
            } catch (Exception e) {
                e.printStackTrace();
        public void error(SAXParseException e) throws SAXException {
            super.error(e);
            System.out.println(e.getMessage());
        public void fatalError(SAXParseException e) throws SAXException {
            super.fatalError(e);
            System.out.println(e.getMessage());
    }Result:
    Value "sting" is not one of the enumerated values for this attribute.

  • Where can I find the schema for config.xml file of jax-rpc

    For the xrpcc tool I need to create a config.xml file, does any body know where can I find the schema for it?

    http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXRPCxrpcc.html and all your questions will be answered... except maybe why aren't these pages linked from the main index anymore? (they were when 1.0 of the tutorial was released, but then there were no docs for wscompile or wsdeploy. The JAX-RPC release notes fixed the latter, but around 1.0_01 they broke the former.)

  • ODI Error while XML file to DB insertion scenario

    I am trying to excute a scenario where it reads the XML file and inserts into the database.I am getting the below error, but I do have the complete write permission on the folders where the XML and XSD files reside.
    Is this error points to verify the user permission in database side?Please help.
    Caused By: java.sql.SQLException: ODI-40844: Could not generate the DTD because the file could not be created. Verify that you have write permission in the directory.
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchema.generateDTD(SnpsXmlSchema.java:853)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchema.<init>(SnpsXmlSchema.java:483)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchemaManager.createNewSchema(SnpsXmlSchemaManager.java:295)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchemaManager.getSchemaFromProperties(SnpsXmlSchemaManager.java:273)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlConnection.internalExecute(SnpsXmlConnection.java:617)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlPreparedStatement.execute(SnpsXmlPreparedStatement.java:46)
         at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:166)
         at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)
         at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)
         at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
    Edited by: user8845111 on Nov 30, 2012 8:47 AM

    Hi,
    What is you environment ?
    Windows ? Linux ?
    Maybe these posts can help you :
    Re: ODI 11g XML reverse engineer with remote agent problem
    XML file in Unix Server

  • Can I validate an XML file using an external DTD

    Hi,
    I'm trying to use an external DTD to validate an XML
    file (which does not refer to this DTD). The java docs that ship
    with the XML parser aren't clear on how exactly to do this (or
    whether it can be done). I'd appreciate any advice on how I
    should perform this operation.
    Here's what I'm doing right now.
    1) The Java file
    import oracle.xml.parser.v2.*;
    public class ParseWithExternalDTD
    public static void main(String args[]) throws Exception
    DOMParser dp=new DOMParser();
    dp.parseDTD
    ("file:d:/jdk1.2/sample/test/family.DTD","family");
    DTD dtd=dp.getDoctype();
    dp.setDoctype(dtd);
    dp.parse("file:d:/jdk1.2/sample/test/family.xml");
    System.out.println("Finished with no errors!");
    2) The family.DTD file
    <!ELEMENT family (member*)>
    <!ATTLIST family lastname CDATA #REQUIRED>
    <!ELEMENT member (#PCDATA)>
    <!ATTLIST member memberid ID #REQUIRED>
    <!ATTLIST member dad IDREF #IMPLIED>
    <!ATTLIST member mom IDREF #IMPLIED>
    3) The family.xml file
    <?xml version="1.0" standalone="no"?>
    <family lastname="Smith">
    <TagToFoilParserValidation>
    </TagToFoilParserValidation>
    <member memberid="m1">Sarah</member>
    <member memberid="m2">Bob</member>
    <member memberid="m3" mom="m1" dad="m2">Joanne</member>
    <member memberid="m4" mom="m1" dad="m2">Jim</member>
    </family>
    4) The output
    Finished with no errors!
    As you can see, the DOMParser failed to validate the family.xml
    file against the family dtd otherwise, it would have reported a
    validation error when it came across the
    TagToFoilParserValidation.
    Any insight as to what I'm doing wrong would be much appreciated.
    Sincerely,
    Keki
    Project Iona
    Manufacturing Applications
    Oracle Corporation
    The views and opinions expressed here are
    my own and do not reflect the views and
    opinions of Oracle Corporation
    null

    Keki Burjorjee (Oracle) (guest) wrote:
    : 2 further questions related to this issue.
    : 1) Say I am using XSLT to transform A.xml into B.xml, and I
    : want to embed a reference to B.dtd within the B.xml file. Is
    : there an XSLT command which will allow me to do this?
    : 2) Is it possible for your team to give me a mechanism whereby
    I
    : can preset the xml parser to validate the next xml file (or
    : inputstream) it receives against a particular DTD? This scheme
    : does not require the dtd to be present within the XML file
    : Thanks,
    : - Keki
    : Oracle XML Team wrote:
    : : What you are doing wrong is not including a reference to the
    : : applicable DTD in your XML document. Without it there is no
    : way
    : : that the parser knows what to validate against. Including
    the
    : : reference is the XML standard way of specifying an external
    : : DTD. Otherwise you need to embed the DTD in your XML
    Document.
    : : Oracle XML Team
    : : http://technet.oracle.com
    : : Oracle Technology Network
    : : Keki Burjorjee (guest) wrote:
    : : : Hi,
    : : : I'm trying to use an external DTD to validate an XML
    : : : file (which does not refer to this DTD). The java docs that
    : : ship
    : : : with the XML parser aren't clear on how exactly to do this
    : (or
    : : : whether it can be done). I'd appreciate any advice on how I
    : : : should perform this operation.
    : : : Here's what I'm doing right now.
    : : : 1) The Java file
    : : : import oracle.xml.parser.v2.*;
    : : : public class ParseWithExternalDTD
    : : : public static void main(String args[]) throws Exception
    : : : DOMParser dp=new DOMParser();
    : : : dp.parseDTD
    : : : ("file:d:/jdk1.2/sample/test/family.DTD","family");
    : : : DTD dtd=dp.getDoctype();
    : : : dp.setDoctype(dtd);
    : : : dp.parse("file:d:/jdk1.2/sample/test/family.xml");
    : : : System.out.println("Finished with no errors!");
    : : : 2) The family.DTD file
    : : : <!ELEMENT family (member*)>
    : : : <!ATTLIST family lastname CDATA #REQUIRED>
    : : : <!ELEMENT member (#PCDATA)>
    : : : <!ATTLIST member memberid ID #REQUIRED>
    : : : <!ATTLIST member dad IDREF #IMPLIED>
    : : : <!ATTLIST member mom IDREF #IMPLIED>
    : : : 3) The family.xml file
    : : : <?xml version="1.0" standalone="no"?>
    : : : <family lastname="Smith">
    : : : <TagToFoilParserValidation>
    : : : </TagToFoilParserValidation>
    : : : <member memberid="m1">Sarah</member>
    : : : <member memberid="m2">Bob</member>
    : : : <member memberid="m3" mom="m1" dad="m2">Joanne</member>
    : : : <member memberid="m4" mom="m1" dad="m2">Jim</member>
    : : : </family>
    : : : 4) The output
    : : : Finished with no errors!
    : : : As you can see, the DOMParser failed to validate the
    : : family.xml
    : : : file against the family dtd otherwise, it would have
    : reported
    : : a
    : : : validation error when it came across the
    : : : TagToFoilParserValidation.
    : : : Any insight as to what I'm doing wrong would be much
    : : appreciated.
    : : : Sincerely,
    : : : Keki
    : : : Project Iona
    : : : Manufacturing Applications
    : : : Oracle Corporation
    : : : The views and opinions expressed here are
    : : : my own and do not reflect the views and
    : : : opinions of Oracle Corporation
    1) No XSLT commands exist that allow you to embed a DTD while
    doing the transformation.
    2) You can use the setDocType() method in the parser, to set a
    DTD based on which the XML document will be validated. The
    parseDTD() method allows you to parse a DTD file separately and
    get a DTD object. Here is a sample code :
    DOMParser domparser = new DOMParser();
    domparser.setValidationMode(true);
    // parse the DTD file
    domparser.parseDTD(new FileReader(dtdfile));
    DTD dtd = domparser.getDocType();
    // Parse XML file - XML file will be validated based on the DTD.
    domparser.setDocType(dtd);
    domparser.parse(new FileReader(xmlfile));
    Document doc = domparser.getDocument();
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

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

  • XML SCHEMA registration for XML TYPE (storing XML files in Oracle 10g)

    I have created the XML Schema for the XML file stored in Oracle 10g and also added this Schema into the database. I have related that schema with the column in the table which contains the XML file. When i execute the query to fetch the data from the stored file i am getting a blank resultset. Is registering the XML Schema is necessary, if yes then please let me know the process of doing it. I have tried following steps to register Schema, but it is not working
    Step1:
    DECLARE
    v_return BOOLEAN;
    BEGIN
    v_return := dbms_xdb.createFolder('/home/');
    v_return := dbms_xdb.createFolder('/home/DEV/');
    v_return := dbms_xdb.createFolder('/home/DEV/xsd/');
    v_return := dbms_xdb.createFolder('/home/DEV/messages/');
    v_return := dbms_xdb.createFolder('/home/DEV/employees/');
    COMMIT;
    END;
    STEP 2:
    Connecting To XML DB
    Step3:
    Register XML schema
    I am failing to execute step number 2 and hence not able to register the schema also.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by sudeepk:
    If a java exception is thrown probably during ur install u might have forgotten
    grant javauserpriv to scott;
    grant javasyspriv to scott;
    Thanks
    [email protected]
    <HR></BLOCKQUOTE>
    Thank you!!!

  • Error in xml file validation to its relevant xml schema

    Hi All,
    I have 3 xml schema files files from which I generated a XML file using PLSQL.I am getting this error when I am trying to validate xml file to the schema:
    *'WMWROOT' NOT DECLARED*.Can anyone help me with this,I am including the main schema file and also the XML generated.
    XML Schem file:
    Itemdownload.xsd:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="ItemDownload" targetNamespace="http://www.manh.com/ILSNET/Interface" elementFormDefault="qualified"
         xmlns="http://www.manh.com/ILSNET/Interface" xmlns:xs="http://www.w3.org/2001/XMLSchema" version ="2007">
         <xs:include schemaLocation="Item.xsd" />
    <xs:element name="WMWROOT" nillable="true" type="WMWROOT" />
    <xs:complexType name="WMWROOT">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1" name="WMWDATA" type="WMWDATA" />
    </xs:sequence>
    </xs:complexType>
    <xs:element name="WMWDATA" nillable="true" type="WMWDATA"/>
    <xs:complexType name="WMWDATA">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="1" name="Items" type="ItemList" />
    </xs:sequence>
    </xs:complexType>
    <xs:element name="Items" nillable="false" type="ItemList" />
    <xs:complexType name="ItemList">
    <xs:sequence>
    <xs:element minOccurs="1" maxOccurs="unbounded" name="Item" nillable="true" type="Item" />
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    The generated xml file is:
    <?xml version="1.0" ?>
    <WMWROOT>
    <WMWDATA>
    <Items>
    <Item><Action>Save</Action><UserDef8>10074</UserDef8><Active>Y</Active><AvailableOnWeb>N</AvailableOnWeb><Company>OU: ResMed Corp</Company><Cost>285.93</Cost><Desc>HP DESKJET PRINTER (EMBLA)</Desc><HarmCode><UserDef8>10074</UserDef8></HarmCode><Item>R145-794</Item><InventoryTracking>Y</InventoryTracking><LongDesc>HP DESKJET PRINTER (EMBLA)</LongDesc><LotControlled>Y</LotControlled><SerialNumTrackOutbound>7</SerialNumTrackOutbound><StorageTemplate><Template>Each</Template></StorageTemplate><XRefs><XRef><XRefItem></XRefItem></XRef></XRefs></Item>
    <Item><Action>Save</Action><UserDef8>80862</UserDef8><Active>Y</Active><AvailableOnWeb>N</AvailableOnWeb><Company>OU: ResMed Corp</Company><Cost>54.27</Cost><Desc>Mirage Micro Mask MED&amp;LG-Internet Pkg</Desc><HarmCode><UserDef8>80862</UserDef8></HarmCode><Item>16359</Item><InventoryTracking>Y</InventoryTracking><LongDesc>Mirage Micro Mask MED&amp;LG-Internet Pkg</LongDesc><LotControlled>Y</LotControlled><SerialNumTrackOutbound>N</SerialNumTrackOutbound><StorageTemplate><Template>Each</Template></StorageTemplate><XRefs><XRef><XRefItem>619498163597</XRefItem></XRef></XRefs></Item>
    </Items>
    </WMWDATA>
    </WMWROOT>
    I can provide you with the other 2 dependent schemas if needed.Please reply me!!

    Hey,
    As you said I tried keeping the namespace in xml file and it worked for a strange reason I am getting the same error again,I am not able to figure it why!!
    The error is:
    SAMPLEITEMDLFILE.xml:2,139: no declaration found for element 'WMWROOT'
    The XML document SAMPLEITEMDLFILE.xml is NOT valid (1 errors)
    This is the part of PL/SQL code thru which I am generating the xml:
    UTL_FILE.put_line (l_out_file, '<?xml version="1.0" ?>');
    UTL_FILE.put_line (l_out_file, '<WMWROOT');
    UTL_FILE.put_line (l_out_file, 'xmlns="http://www.manh.com/ILSNET/Interface"> ');
    UTL_FILE.put_line (l_out_file, '<WMWDATA>');
    UTL_FILE.put_line (l_out_file, '<Items>');
    I am validating it in stylus studio tool.
    Can you please help me thru this?

  • To read XML file with DTD in SSIS

    Hi,
    My SISS package needs to read .mak file and store it in a sql tables.
    I am receiving xml file content in mak file extension with DTD. So I couldn't read through XML source shows error DTD is prohibited in this document. After removing DTD by manually, the xml file has multiple outputs.
    Please guide me how to remove DTD by coding and also I don't have xsd and xsl file for this only mak file.
    Thanks.

    Thanks Visakh for your answer.
    I have tried in XML task which described in the thread. But I couldn't remove DTD file, I am getting following error,
    [XML Task] Error: An error occurred with the following error message: "Could not find a part of the path 'C:\Program Files (x86)\FAST\Builder\bin\makefile.dtd'.".
    As I said before I am receiving in .mak file extension. The beginning of file content is like below,
    <?xml version='1.0'?>
    <!DOCTYPE makefile SYSTEM "file:///C:/ProgramFiles
    (x86)/FAST/Builder/bin/makefile.dtd"[
    <!ENTITY % default-content-type "'text/html'">
    <!ENTITY prjdir "G:\cdrom\Employees_2014_02">
    <!ENTITY imgdir "G:\images\forms\gifs">
    <!ENTITY foddir "G:\SOFT\FORMS CD\Feb14">
    <!ENTITY ccdir "Y:\Content">
    ]>
    <makefile>
    &fsysdse;
    <content-collection id="b1" title="Employers and Employees" filename="&ccdir;\Employees_2014_02.nfo" password=""> ....
    After replace all variable (prjdir,imgdir,fodder,ccdir) into values specified in the entity tag, I removed above underlined part - so the xml file is ready without DTD part and able to use in
    XML source. I have received 6 outputs from XML source.
    My question is how to do this manual work in SSIS? It’s not only one file, so many files needs to updated SQL tables automatically so everything should be done by coding.
    Please guide me in which way I can achieve this?
    If you want to do this in SSIS
    one way is to use Script Task to parse the file and remove the DTD part.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • OADB_Creation of a new derived chart of depreciation_Message  AC166

    Hello, I try to create a new derived  depreciation area. This one contains an another derived  depreciation area in its formula. No postings have required in this new depreciation area When I try to enter, the following message displays: Message  AC1

  • How to determine the JDK version required to use a jar?

    Hi all. I am using a hosted server that uses JDK 1.4.2 and I cannot upgrade the VM. I have been finding it extremely difficult to install web applications on this server since I find that after installing the app, the web server complains the bytecod

  • Flat file message is not recognized.

    I have been pulling my hair out for days now.  I have an ANSI x12 214 v4010 document that validates against the xsd file in visual studio when I remove the Interchange headers I add the interchange headers back and deploy for it to pick up the file a

  • Beryl 0.2.0 + KDE 3.5.6: No new windows appear

    I am using KDE 3.5.6 (currently with the KWin window manager, but I'm hoping to use Beryl instead). When I run startx, everything runs fine. I then open a Konsole window and run beryl-manager, and the Beryl window manager takes over. Moving windows (

  • Home page opening with Login page

    Hi, Today we are facing a peculiar case, when we login to Unifier application. On successful login, the home is displayed with login page again. Please let me know hw to resolve this. Regards, Deepak