(Error) Element 'schema' has invalid namespace: 'http://www.w3.org/2001/XMLSchema'
Date: 22 Apr 2002 15:41:54 -0700
Message-ID: <a82b1436.0204221441.73a253c5_at_posting.google.com>
i ran into
a problem with validating against the schema. I searched all the archives but I could not get any information on it. This is the code I have and error message is appended after the code. Thanks in advance for your time, regards.
import java.io.*; import java.sql.*; import java.math.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import java.util.*;
import java.net.*;
public class XMLQuery {
//private static XSLStylesheet XSLFile = null;
//private static URL xslURL = null;
//private static XMLDocument xmldoc = null;
//static OutputStream output = null;
static String dbURL = null;
static String dbUser = null;
static String dbPassword = null;
static String sqlTEDS = null;
static String dbSID = null;
static String dbPort = null;
//instanced a property object
static Properties toolProperty = new Properties();
//use getter to get the keys in the property file public static String getProperty(String key) {
return toolProperty.getProperty(key); }
public static void main(String args[]) throws SQLException {
String xmlString = getXMLData();
System.out.println("Result: " + xmlString);
}
/**
* Insert the method's description here.
* Creation date: (4/22/2002 12:27:34 PM)
* _at_return java.lang.String
*/
public static String getXMLData() {
try {
//point to the location that hold the property file
String fileName = "d://New
Folder//lms2portal//lms2portal.properties";
//load the property file
toolProperty.load(new FileInputStream(fileName)); //load the
property file
//get TEDS database URL from the lms2portal.properties
dbURL = getProperty("DBurl");
//get TEDS database name
dbSID = getProperty("DBSID");
//get TEDS databse port
dbPort = getProperty("DBPORT");
//get username from the lms2portal.properties
dbUser = getProperty("DBUsername");
//get password from the lms2portal.properties
dbPassword = getProperty("DBPasswd");
//get the sql statement from the lms2portal.properties
sqlTEDS = getProperty("SQL");
//System.out.println(sqlTEDS);
//register the JDBC driver..
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
//initiate a JDBC connection
Connection conn =
DriverManager.getConnection(
"jdbc:oracle:thin:_at_" + dbURL + ":" + dbPort + ":" +
dbSID,
dbUser,
dbPassword);
/*if (conn != null) {
System.out.println("Connection good");
}*/
//initialize the OracleXMLQuery
OracleXMLQuery qry = new OracleXMLQuery(conn, sqlTEDS);
//Set XSLT File
//structure the generated XML document
qry.setMaxRows(5); // set the maximum number of rows to be
returned
qry.setRowsetTag("courses"); // set the root document tag
qry.setRowTag("course"); // sets the row separator tag
qry.setRaiseException(true);
qry.setXSLT(
"file:d://New Folder//lms2portal//teds2lmsport.xsl",
"http://webd01.corporate.ge.com/learningport/learningportal/schema/");
// sets the stylesheet
/* This block of code is working just fine
try {
//XMLDocument xml;
xmldoc = (XMLDocument)qry.getXMLDOM();
} catch (Exception e) {
}
xslURL = new URL("file:d://New
Folder//lms2portal//teds2lmsport.xsl");
URL refURL = new URL("file:d://New
Folder//lms2portal");
XSLFile = new XSLStylesheet(xslURL,refURL);
System.out.println("Got Stylesheet");
output = new FileOutputStream("d://New
Folder//lms2portal//lmsdata.xml");
try {
XSLProcessor xslt = new XSLProcessor();
xslt.processXSL(XSLFile, xmldoc, output);
} catch (XSLException e) {
}
try {
output.flush();
}
catch (IOException e){}
*/
//get the query result as a string
String xml = qry.getXMLString();
//close the query
qry.close();
//close the database connection
conn.close();
//return the string
return xml;
} catch (Exception e) {
System.err.println("Error: " + e);
return null;
}
}
}
This is the error message:
<Line 1, Column 126>: XSD-2030: (Error) Element 'schema' has invalid
namespace: 'http://www.w3.org/2001/XMLSchema'
<Line 519, Column -636>: XSD-2026: (Error) Invalid attribute 'nillable'
in element 'element'
<Line 519, Column -249>: XSD-2028: (Error) Invalid reference:
':text50Type'
oracle.xml.parser.schema.XSDException: Element 'schema' has invalid
namespace: 'http://www.w3.org/2001/XMLSchema' java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) oracle.xml.parser.schema.XSDException(java.lang.String) void
oracle.xml.parser.schema.XSDBuilder.buildSchema(oracle.xml.parser.v2.XML Element, int, java.net.URL)
java.lang.Object
oracle.xml.parser.schema.XSDBuilder.build(oracle.xml.parser.v2.XMLDocume
nt, java.net.URL)
java.lang.Object
oracle.xml.parser.schema.XSDBuilder.build(java.net.URL)
oracle.xml.parser.v2.XMLDocument
XMLQuery.validateXML(java.net.URL, java.net.URL)
void XMLQuery.main(java.lang.String []) Received on Tue Apr 23 2002 - 00:41:54 CEST
