Validate xml with DOM - no grammar found

Validation with XmlSpy is OK!
Please help me. My problem is...
==========================================================
// Schema...
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="ParentType">
<xs:sequence>
<xs:element name="parent1" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ChildType">
<xs:complexContent>
<xs:extension base="ParentType">
<xs:sequence>
<xs:element name="child1" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="element" type="ParentType" maxOccurs="2"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
==========================================================
// Xml-file:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://pctoiv/etktoiv/Extending.xsd">
<element xsi:type="ChildType">
<parent1/>
<child1/>
</element>
<element xsi:type="ParentType">
<parent1/>
</element>
</root>
=================================================================
//java code...
String W3C_XML_SCHEMA = "http://www.w3c.org/2001/XMLSchema";
String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
String schemaSource = "http://pctoiv/etktoiv/Extending.xsd";
javax.xml.parsers.DocumentBuilder documentBuilder = null;
org.w3c.dom.Document xmlDoc = null;
javax.xml.parsers.DocumentBuilderFactory docBuildFactory =
javax.xml.parsers.DocumentBuilderFactory.newInstance();
docBuildFactory.setNamespaceAware(true);
docBuildFactory.setValidating(true);
docBuildFactory.setAttribute(JAXP_SCHEMA_SOURCE, W3C_XML_SCHEMA);
docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE, schemaSource);
documentBuilder = docBuildFactory.newDocumentBuilder();
documentBuilder.setErrorHandler(new MyErrorHandler(System.out));
xmlDoc = documentBuilder.parse(new java.io.File("Extending.xml"));
================================================
// And errors...
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document root element "root", must match DOCTYPE root "null".

Validation with XmlSpy is OK!
Please help me. My problem is...
=======================================================
==
// Schema...
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:complexType name="ParentType">
<xs:sequence>
<xs:element name="parent1" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ChildType">
<xs:complexContent>
<xs:extension base="ParentType">
<xs:sequence>
<xs:element name="child1" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="element" type="ParentType"
maxOccurs="2"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
=======================================================
==
// Xml-file:
<?xml version="1.0" encoding="UTF-8"?>
<root
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://pctoiv/etktoiv/Ex
ending.xsd">
<element xsi:type="ChildType">
<parent1/>
<child1/>
</element>
<element xsi:type="ParentType">
<parent1/>
</element>
</root>
=======================================================
=========
//java code...
String W3C_XML_SCHEMA =
"http://www.w3c.org/2001/XMLSchema";
String JAXP_SCHEMA_SOURCE =
"http://java.sun.com/xml/jaxp/properties/schemaSource";
String schemaSource =
"http://pctoiv/etktoiv/Extending.xsd";
javax.xml.parsers.DocumentBuilder documentBuilder =
null;
org.w3c.dom.Document xmlDoc = null;
javax.xml.parsers.DocumentBuilderFactory
docBuildFactory =
javax.xml.parsers.DocumentBuilderFactory.newInstance();
docBuildFactory.setNamespaceAware(true);
docBuildFactory.setValidating(true);
docBuildFactory.setAttribute(JAXP_SCHEMA_SOURCE,
W3C_XML_SCHEMA);
docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE,
schemaSource);
documentBuilder =
docBuildFactory.newDocumentBuilder();
documentBuilder.setErrorHandler(new
MyErrorHandler(System.out));
xmlDoc = documentBuilder.parse(new
java.io.File("Extending.xml"));
================================================
// And errors...
org.xml.sax.SAXParseException: Document is invalid: no
grammar found.
org.xml.sax.SAXParseException: Document root element
"root", must match DOCTYPE root "null".
Try this:
private static final String JAXP_SCHEMA_SOURCE
= "http://java.sun.com/xml/jaxp/properties/schemaSource";
private static final String JAXP_SCHEMA_LANGUAGE
= "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
private static final String W3C_XML_SCHEMA
= "http://www.w3.org/2001/XMLSchema";
docBuildFactory.setNamespaceAware(true);
docBuildFactory.setValidating(true);
docBuildFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); // use LANGUAGE here instead of SOURCE
docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE, schemaSource);
documentBuilder = docBuildFactory.newDocumentBuilder();
Good luck!
Paul Niedenzu

Similar Messages

  • Validate XML with Schema?

    So, according to Adobe...
    quote:
    Dreamweaver CS3 continues to support not only the creation
    and editing of XML and XSL files, but it also allows you to import
    DTDs and schemas and to validate XML documents.
    Does anyone know how to accomplish this task? Adobe's
    documentation on this topic seems be less current than their
    marketing material.
    I mean, I'm assuming from the way this is worded it means
    that you can "import DTDs and schemas and ... validate XML
    documents"
    with said schemas. Or is this just some shifty marketing
    trickery which really means you can import (i.e., open) a DTD or
    schema, and, as a completely unrelated task, you can "validate"
    your XML file - to the extent that Dreamweaver will tell you if you
    forgot to close a tag?

    I tried to move all the xml, class and xsd files in the same folder and it still didn't work...
    And I can't hard coded the xsd file on the document... so the only way is to set the xsd location inside the java codes... here's what I have:
    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";
    static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    File xsdFile = new File("schema.xsd");
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
    saxParser.setProperty(JAXP_SCHEMA_SOURCE, xsdFile);
    Please help... thx.

  • Validate xml with PL/SQL Parser

    Hi,
    i have an xml DTD into a VARCHAR2 variable and an xml document
    into a CLOB, i'd like to know how to validate the xml with my
    DTD using PL/SQL API for xml.
    Sorry for my terrible english (i'm not english) :-)
    Tank you.

    Here's an example:
    set serveroutput on
    DECLARE
      p xmlparser.parser;
      d xmldom.DOMDocument;
      dtd xmldom.DOMDocumentType;
      v varchar2(32700);
      good clob;
      bad clob;
      xml_parse_error exception;
      pragma exception_init(xml_parse_error,-20100);
    BEGIN
      bad   := '<!DOCTYPE Department SYSTEM "test.dtd"><Deprtment/>';
      good  := '<!DOCTYPE Department
    SYSTEM "test.dtd"><Department/>';
      v := '<!ELEMENT Department EMPTY>';
      p := xmlparser.newParser;
      xmlparser.parseDTDBuffer(p,v,'Department');
      xmlparser.setDoctype(p,xmlparser.getDoctype(p));
      xmlparser.setValidationMode(p,TRUE);
      xmlparser.parseClob(p,good);
      xmlparser.parseClob(p,bad);
      xmlparser.freeParser (p);
    EXCEPTION
      WHEN xml_parse_error THEN
         DBMS_OUTPUT.PUT_LINE(sqlerrm);
         xmlparser.freeParser (p);
    END;

  • Validate XML with multiple XML Sechme in the same namespace

    In my program, i use multiple xml schemas to validate against my xml files.
    However, i found the following code do not work because all schemas in the same namespace.
    Does any one have some solutions to validate multiple XML Schemas in the same namespace?
    Thanks~~
    static final String[] schemas = { partyInformationSchema,
    itemInformationSchema,
    exceptionsSchema,
    salesForecastSchema,
    exceptionCriteriaSchema };
    factory.setAttribute(JAXP_SCHEMA_SOURCE, schemas);

    I have used the Object arrsy too, but it didn't work.
    static final Object[] schemas = { partyInformationSchema,
    itemInformationSchema,
    exceptionsSchema,
    salesForecastSchema,
    exceptionCriteriaSchema };

  • Validate xml with complextype schema without root element!

    Hi All!
    I have a problem that. I want to validate a xml data of complextype but the schema i want to validate is[b] not have root element.
    For example:
    The schema like that
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="www.thachpn.test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="www.thachpn.test" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:complexType name="Name">
              <xs:sequence>
                   <xs:element name="FirstName" type="xs:string"/>
                   <xs:element name="LastName" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    and the xml data i want to validate like this
    <?xml version="1.0" encoding="UTF-8"?>
    <Name xmlns="www.thachpn.test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <FirstName>Pham</FirstName>
         <LastName>Thach</LastName>
    </Name>
    My Algorithm is like that:
    I create a complextype object by above schema
    then i create new element with given name and namespace
    after that i use schema of this element to validate xml data.
    I use xmlparserv2 lib of oracle
    But i can not find how to create complextype from schema or create element with have complextype.
    Please help me.
    Thanks a lot!

    <?xml version="1.0" encoding="UTF-8"?>
    Modify the schema.
    Add a root element.
    <xs:schema targetNamespace="www.thachpn.test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="www.thachpn.test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xsd:element name="Name" type="Name"/>
    <xs:complexType name="Name">
    <xs:sequence>
    <xs:element name="FirstName" type="xs:string"/>
    <xs:element name="LastName" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>

  • *URGENT * Parsing nd Searching XML with DOM

    Hi,
    I am Juliana, I am a new grad, a new employee and brand new to XML, I am learning to parse XML with the XML parser for PLSQL.
    Please anyone help me how to parse the following XML string so that I will display all the session and its time schedule, or if possible display only the session that I want to display.
    Thank you very much for any of your help
    Juliana
    <Student> Id="9130099">
    <Class>
    <Session>A-100</Session>
    <Session>A-200</Session>
    <Session>A-300</Session>
    <Session>A-400</Session>
    <session>A-500</Session>
    </Class>
    <Time> At:
    <At>10:30</At>
    <At>12:30</At>
    <At>02:30</At>
    <At>04:30</At>
    <At>05:30</At>
    </time>
    </Student>

    thx for the replay
    1) i thought of using xpath but wanted to know how to do it over DOM
    2) i mean that the 3 <item> have other element inside like that:
    <item>
    <title>Implementing Service-Oriented Architectures (SOA) with the Java EE 5 SDK</title>
      <link>http://java.sun.com/developer/technicalArticles/WebServices/soa3/?feed=JSC</link>
      <description>This article presents concepts and language constructs needed to develop a Service-Oriented Architecture composite application in Java EE 5. It then describes an example application designed to solve a business problem.</description>
      <date />
      </item>and all of them have <title>, <link> etc. I want to get the same values(eg. <title>) from all the 3 <item> and not including the <title> in the begining of xml
    3) i am a professional child.....joke....
    try to get to your sensitive side...thats way.

  • Validate XML with XSD Puntuaction Marks

    Hello all,
    I am trying to validate a XML document against a registered XML schema. The XML document contains punctuation marks (like ã, ç, õ) which cause the validation to fail. How to overcome this?
    I suspect of the encoding format the XSD and XML documents are using, encoding=UTF-8, right?
    Thank you,
    Pedro.

    Ok... just needed to change the enconding attribute of the XML document to the value of the parameter NLS_CHARACTERSET of my database.
    Unnecessary post. :-o)

  • Validate xml with local dtd

    hello
    trying to write a unit test that validates some xml we are marshalling against a dtd. here is a snippet of code. The problem is how to specify the dtd against which the xml is to be validated. verification_transaction is our root xml element. when i run this code i get a
    malformedurlexception: no protocol: verification.dtd
    any ideas?
                    StringWriter writer = new StringWriter();
                   // write the doctype declaration
                    writer.write("<!DOCTYPE verification_transaction SYSTEM \"verification.dtd\">");
                    // now marshal to the writer
              marshaller.marshal(spec, requestType, componentNumber, writer);
              InputStream inputStream = new ByteArrayInputStream(writer.getBuffer().toString().getBytes());
              Reader reader = new InputStreamReader(inputStream);
                    // get a sax parser that is validating
              TestHandler handler = new TestHandler();
              SAXParserFactory factory = SAXParserFactory.newInstance();
              factory.setValidating(true);
              SAXParser saxParser = factory.newSAXParser();
              try {
                   saxParser.parse(new InputSource(reader), handler);
                   fail("Should have thrown exception.");
              } catch (RuntimeException e) {
                   // pass
              }Message was edited by:
    shrndegruv

    I needed to do a bunch of things.
    1.
                    URL url = getClass().getResource("/verification.dtd");
              StringWriter writer = new StringWriter();
              writer.write("<?xml version=\"1.0\"?><!DOCTYPE verification_transaction SYSTEM \"" + url + "\">");and then I had to use a handler which processed the errors (which I got from an online tutorial):
    private static class MyErrorHandler extends DefaultHandler {
              public void warning(SAXParseException e) throws SAXException {
                   System.out.println("Warning: ");
                   printInfo(e);
              public void error(SAXParseException e) throws SAXException {
                   System.out.println("Error: ");
                   printInfo(e);
                   throw new SAXException("DTD Validation Error: [" + e.getMessage() + "]");
              public void fatalError(SAXParseException e) throws SAXException {
                   System.out.println("Fatal error: ");
                   printInfo(e);
              private void printInfo(SAXParseException e) {
                   System.out.println("   Public ID: " + e.getPublicId());
                   System.out.println("   System ID: " + e.getSystemId());
                   System.out.println("   Line number: " + e.getLineNumber());
                   System.out.println("   Column number: " + e.getColumnNumber());
                   System.out.println("   Message: " + e.getMessage());
         }

  • Build XML with DOM

    Why does this loop works well if I COMMENT OUT the second node -
    but I get a NULL document if I try to add the second node ?
    //Loop through the result set
    for (int i=0; i < iRows; i++) {
    System.out.println(result.getString("SiteID"));
    Node newSiteIDNode = document.createElement("SiteID");
    Text tnSiteIDNode = document.createTextNode(result.getString("SiteID"));
    newSiteIDNode.appendChild(tnSiteIDNode);
    root.appendChild(newSiteIDNode);
    Node newItemNode = document.createElement("ItemCode");
    Text tnItemNode = document.createTextNode(result.getString("ItemCode"));
    newItemNode.appendChild(tnItemNode);
    root.appendChild(newItemNode);

    The XML file that I'm creating via the following is empty
    TransformerFactory transFactory =TransformerFactory.newInstance();
    Transformer transformer = transFactory.newTransformer();
    // Using the DOM tree root node, the following line of code constructs a DOMSource object as the source of the transformation.
    DOMSource source = new DOMSource(document);
    // The following code fragment creates a StreamResult object to take the results of the transformation
    // and transforms the tree into an XML file.
    newXML = new File("FTHSites.xml");
    FileOutputStream os = new FileOutputStream(newXML);
    resultXML = new StreamResult(os);
    transformer.transform(source, resultXML);     

  • Validate XML with XSD

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    with the partitioning, real application clusters, olap, data mining
    and Real Application Testing options
    Working with relational tables containing clob type columns (no XMLDB available) I'm not able to set up a simple validation example as below (supposed to return 1 confirming a successful validation).
    declare
      xmldoc xmltype;
      sb_xml xmltype;
      valid_ number;
      xmlxsd varchar2(4000) := q'~<?xml version="1.0" ?>
                                  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
                                  <xs:element name="greeting" type="xs:string" />
                                  </xs:schema>~';
      xmlxml varchar2(32767) := q'~<?xml version="1.0" ?><greeting>"HELLO !"</greeting>~';
    begin
      xmldoc := xmltype(xmlxml);
      sb_xml := xmldoc.createschemabasedxml();
      valid_ := sb_xml.isschemavalid(xmlxsd);
      dbms_output.put_line('IsSchemaValid (0=false,1=true): ' || to_char(valid_));
    end;Thanks in advance for any kind of help provided
    Etbin

    no XMLDB availablenot sure if it will work without xmldb, but you might try to use java for schema validation:
    SQL> CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "SchemaUtil"
      2  as
      3
      4  import oracle.xml.parser.schema.*;
      5  import oracle.xml.parser.v2.*;
      6  import oracle.sql.CHAR;
      7  import java.io.*;
      8
      9  public class SchemaUtil
    10  {
    11     public static String validation(CHAR xml, CHAR xsd)
    12     throws Exception
    13     {
    14        //Build Schema Object
    15        XSDBuilder builder = new XSDBuilder();
    16        byte [] docbytes = xsd.getBytes();
    17        ByteArrayInputStream in = new   ByteArrayInputStream(docbytes);
    18        XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
    19        //Parse the input XML document with Schema Validation
    20        docbytes = xml.getBytes();
    21        in = new ByteArrayInputStream(docbytes);
    22        DOMParser dp  = new DOMParser();
    23        // Set Schema Object for Validation
    24        dp.setXMLSchema(schemadoc);
    25        dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    26        dp.setPreserveWhitespace (true);
    27        StringWriter sw = new StringWriter();
    28        dp.setErrorStream (new PrintWriter(sw));
    29        try
    30        {
    31           dp.parse (in);
    32           sw.write("The input XML parsed without errors.\n");
    33        }
    34        catch (XMLParseException pe)
    35        {
    36             sw.write("Parser Exception: " + pe.getMessage());
    37          }
    38        catch (Exception e)
    39          {
    40             sw.write("NonParserException: " + e.getMessage());
    41          }
    42          return sw.toString();
    43     }
    44   }
    45  /
    Java created.
    SQL>
    SQL> create or replace function schemavalidation(xml in varchar2,xsd in varchar2)
      2  return varchar2 is language java name 'SchemaUtil.validation(oracle.sql.CHAR,oracle.sql.CHAR)
      3                   returns java.lang.String';
      4  /
    Function created.
    SQL>
    SQL> select schemavalidation('<?xml version="1.0" ?><greeting>"HELLO !"</greeting>',
      2                           '<?xml version="1.0" ?>
      3                          <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      4                          <xs:element name="greeting" type="xs:string" />
      5                          </xs:schema>') schemavalidation from dual
      6  /
    SCHEMAVALIDATION
    The input XML parsed without errors.
    SQL>

  • Persisting unexplained errors when parsing XML with schema validation

    Hi,
    I am trying to parse an XML file including XML schema validation. When I validate my .xml and .xsd in NetBeans 5.5 beta, I get not error. When I parse my XML in Java, I systematically get the following errors no matter what I try:
    i) Document root element "SQL_STATEMENT_LIST", must match DOCTYPE root "null".
    ii) Document is invalid: no grammar found.
    The code I use is the following:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    My XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Defining the SQL_STATEMENT_LIST element -->
    <xs:element name="SQL_STATEMENT_LIST" type= "SQL_STATEMENT_ITEM"/>
    <xs:complexType name="SQL_STATEMENT_ITEM">
    <xs:sequence>
    <xs:element name="SQL_SCRIPT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <!-- Defining simple type ApplicationType with 3 possible values -->
    <xs:simpleType name="ApplicationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="DawningStreams"/>
    <xs:enumeration value="BaseResilience"/>
    <xs:enumeration value="BackBone"/>
    </xs:restriction>
    </xs:simpleType>
    <!-- Defining the SQL_SCRIPT element -->
    <xs:element name="SQL_SCRIPT" type= "SQL_STATEMENT"/>
    <xs:complexType name="SQL_STATEMENT">
    <xs:sequence>
    <xs:element name="NAME" type="xs:string"/>
    <xs:element name="TYPE" type="xs:string"/>
    <xs:element name="APPLICATION" type="ApplicationType"/>
    <xs:element name="SCRIPT" type="xs:string"/>
    <!-- Making sure the following element can occurs any number of times -->
    <xs:element name="FOLLOWS" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and my XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : SQLStatements.xml
    Created on : 1 juillet 2006, 15:08
    Author : J�r�me Verstrynge
    Description:
    Purpose of the document follows.
    -->
    <SQL_STATEMENT_LIST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.dawningstreams.com/XML-Schemas/SQLStatements.xsd">
    <SQL_SCRIPT>
    <NAME>CREATE_PEERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE PEERS (
    PEER_ID           VARCHAR(20) NOT NULL,
    PEER_KNOWN_AS      VARCHAR(30) DEFAULT ' ' ,
    PRIMARY KEY ( PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITIES_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITIES (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    COMMUNITY_KNOWN_AS VARCHAR(25) DEFAULT ' ',
    PRIMARY KEY ( COMMUNITY_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITY_MEMBERS (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    PEER_ID VARCHAR(20) NOT NULL,
    PRIMARY KEY ( COMMUNITY_ID, PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_PEER_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE PEERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITIES_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITIES IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITY_MEMBERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_VIEW</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE VIEW COMMUNITY_MEMBERS_VW AS
    SELECT P.PEER_ID, P.PEER_KNOWN_AS, C.COMMUNITY_ID, C.COMMUNITY_KNOWN_AS
    FROM PEERS P, COMMUNITIES C, COMMUNITY_MEMBERS CM
    WHERE P.PEER_ID = CM.PEER_ID
    AND C.COMMUNITY_ID = CM.COMMUNITY_ID
    </SCRIPT>
    <FOLLOWS>CREATE_PEERS_TABLE</FOLLOWS>
    <FOLLOWS>CREATE_COMMUNITIES_TABLE</FOLLOWS>
    </SQL_SCRIPT>
    </SQL_STATEMENT_LIST>
    Any ideas? Thanks !!!
    J�r�me Verstrynge

    Hi,
    I found the solution in the following post:
    Validate xml with DOM - no grammar found
    Sep 17, 2003 10:58 AM
    The solution is to add a line of code when parsing:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    The errors are gone !!!
    J�r�me Verstrynge

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

  • To convert XML to ABAP internal table can we do it with DOM or we need XSLT

    I have a requirement where I need to collect the data from XML file into an internal table.
    I need to collect this data into an internal table as I should make use of this data and do Goods Receipt in SAP.
    My XML file is very very complex and the child nodes in my XML file may occur ones or 10 times and change dynamically.
    I want to know if XML to ABAP internal table is possible with DOM or does it need XSLT too.
    I used the blog of Robert which uses DOM, but it I am unable to collect the data in internal table. The blog explains only how to wtite the out put to screen as element and value.
    I want to know if XML to ABAP internal table is possible with DOM or do I need XSLT too? I am confused please help.
    Any help will be highly appreciated.
    Regards,
    Jessica Sam

    Hello Jessica
    Why not using the DOM itself for processing?
    Below you see the post-processing coding which I use to add the interchange control number (ICN) into an EDI message (which at this stage is still an XML-EDI stream). This is done on SAP-XI yet on the ABAP stack so you could use this approach on your R/3 system as well.
    method POSTPROCESSING.
    * Post-Processing of outbound EDI invoices & dispatch advices
      me->map_icn( ).
    endmethod.
    method MAP_ICN.
    * define local data
      DATA: lo_node       TYPE REF TO if_ixml_node,
            ld_name       TYPE string,
            ld_value      TYPE string,
            ld_error_code type MPG_ERRCODE,
    **        ld_control_number   TYPE char13,
            ld_rc         TYPE i,
            ld_msg        TYPE string.  " bapi_msg.
      DATA: ld_interface  TYPE string.
      DATA: incode TYPE REF TO if_ixml_node_collection.
      LOG-POINT ID zedi
        SUBKEY mc_subkey_method_trace.
      ld_error_code = md_clsname.
    * Get next interchange control number (ICN)
      me->md_next_number = me->get_next_number(
          id_nrobj  = me->md_nrobj   " Object (SNRO)
          id_nrnr   = me->md_nrnr ). " Number Range
      CALL METHOD zcl_edi_uk_counter=>calculate_modulo_n09
        EXPORTING
          id_input  = me->md_next_number
        receiving
          rd_output = me->md_next_number.
    * Build ICN according to naming conventions agreed with EDI customer
      me->md_icn = me->generate_icn( me->md_next_number ).
      ld_value = me->md_icn.  " type conversion to string
      CLEAR: incode,
             lo_node.
      incode  = me->mo_document->get_elements_by_tag_name( mc_d_0020 ).
      lo_node = incode->get_item( index = 0 ).
      CALL METHOD lo_node->set_value
        EXPORTING
          value = ld_value
        RECEIVING
          rval  = ld_rc.
      IF ( ld_rc NE 0 ).
        CONCATENATE 'Error [' mc_d_0020
                    ']: Method SET_VALUE (IF_IXML_NODE)'
                    INTO ld_msg.
        CONDENSE ld_msg.
        me->mif_trace->trace2( message = ld_msg ).
        RAISE EXCEPTION TYPE cx_mapping_fault
          EXPORTING
    *        textid =
    *        previous =
            error_code = ld_error_code
            error_text = ld_msg.
    **    MESSAGE ld_msg TYPE 'A'.
      ENDIF.
      CLEAR: incode,
             lo_node.
      incode  = me->mo_document->get_elements_by_tag_name( mc_d_0020_2 ).  " element for ICN
      lo_node = incode->get_item( index = 0 ).
      CALL METHOD lo_node->set_value
        EXPORTING
          value = ld_value
        RECEIVING
          rval  = ld_rc.
      IF ( ld_rc NE 0 ).
        CONCATENATE 'Error [' mc_d_0020_2
                    ']: Method SET_VALUE (IF_IXML_NODE)'
                    INTO ld_msg.
        CONDENSE ld_msg.
        me->mif_trace->trace2( message = ld_msg ).
        RAISE EXCEPTION TYPE cx_mapping_fault
          EXPORTING
    *        textid =
    *        previous =
            error_code = ld_error_code
            error_text = ld_msg.
    **    MESSAGE ld_msg TYPE 'A'.
      ENDIF.
    * define local data
      DATA: ls_record       TYPE mpp_dynamic.
      CLEAR: ls_record.
      ls_record-namespace = mc_dynamic_namespace.
      ls_record-name      = mc_icn.
      ls_record-value     = ld_value.
      mif_dynamic->add_record( ls_record ).
    endmethod.
    In your case you would need to do a DO...ENDDO loop until you parsed all required nodes.
    NOTE: ME->MO_DOCUMENT is of TYPE REF TO IF_IXML_DOCUMENT.
    Regards
       Uwe

  • How to validate xml file with XSD schema ??  in JDK1.4.2

    How to validate xml file with XSD schema ?? in JDK1.4.2
    i dont want to use new Xerec Jar ...
    Suggest option ...

    Please do not double-post. http://forum.java.sun.com/thread.jspa?threadID=5134447&tstart=0
    Then use Stax (Woodstock) or Saxon.
    - Saish

  • How to validate XML Digital Signature with XML DB (o PL/SQL) in Oracle 11g

    Hi,
    Do you know if there is possibility to validate XML Digital Signature using XML DB (or PL/SQL) in Oracle 11g?
    Let say I have CLOB/XMLType containing Digitally Signed XML, and I want to validate, that thsi is proper signature. I also have public key of signer (I could store it in CLOB or file or Oracle wallet).
    Is it possible to do?
    If there is need to install additional component - then which one?
    Regards,
    Paweł

    Hi,
    this is what i got from someone...
    but the links he gave are not opening up...
    u have to place a picture there and have to load the digital signatures as Jpegs on to the server to OA top
    and have to refer them in the XML for dynamically get the signature on the reports
    when u select the properties of the picture placed in the XML template,
    there will be one tab with "URL"... in that u have to give the path for that jpegs
    Pls refer the following documents for enabling digital signature on pdf documents.
    http://iasdocs.us.oracle.com/iasdl/bi_ee/doc/bi.1013/e12187/T421739T481159.htm#5013638    (refer section 'Adding or Designating a Field for Digital Signature'
    http://iasdocs.us.oracle.com/iasdl/bi_ee/doc/bi.1013/e12188/T421739T475591.htm#5013688
    (Implementing a Digital Signature
    Is the BI Publisher installed on your instance of version 10.1.3.4 or higher?
    Pls procure a digital signature as soon as possible. The process can take time. OR we could use any certificate that you already might have OR generate a certificate using Oracle Certificate Authority for demo.

Maybe you are looking for

  • How can I convert an audio file (speech) into a text?

    Hello everybody!   Can someone explain how I can convert a garageband file (voice speech) into a text? My Mac is a Mac OS X 10.5.8 version, so I don't have programs such as mountain Lion. I thought to use googlevoice. Is this option available? If yes

  • The extension does not contain a valid signature

    hey guys, newbie on deck! So, after installing CS6 I ran the Adobe Update Manger. During the update the Adobe Extension Manager (AEM) fired off and began updating as well. One error I saw was: The extension 'Adobe_Flash_Professional_Toolkit_for_Creat

  • Problem while installing SAP Netweaver CE 7.1 SP3!

    Hi, I am installing SAP Netweaver CE 7.1 SP3 on Windows XP Pro. The installation proceeds normally till Step 26 but at Step 26 while creating and startiong SAPStartSrv an error is thrown that the Service can not be started in 40 seconds. If I retry t

  • IPhone 3Gs notes not working correctly

    I use notes app all the time on my iPhone and noticed today that it is not working correctly. When I make a new note it takes forever to save it, meaning the little indicator keeps spinning on top showing the iPhone is working. Then once it is saved

  • Serializing calls to ABAP server proxies

    Hi    I have a following scenario - SOAP client ( EOIO)--> XI IS --> XI Adapter --> (EOIO ) R3 The objective is to create a material in R3 based on the SOAP client call onto a XI Webservice . XI Integration server uses a ABAP server proxy ( async , t