Error validating xml schema

Hi,
I'm getting an error trying to validate an xml document using xml schema(xsd). The java code/schema/xml/error are listed below.
Not sure what the error
" Invalid content was found starting with element 'ticker'. One of '{ticker}' is expected." means.
Using jre 1.6
Any input appreciated.
Thanks !
// Java Code
     SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
     Schema schema = sf.newSchema(schemaURL);
     Validator validator = schema.newValidator();
     validator.validate(new StreamSource(is));
// Schema
<xs:element name="stocktrade">
<xs:complexType>
<xs:sequence>
     <xs:element name="ticker" type="xs:string"/>
     <xs:element name="price" type="xs:string"/>
     <xs:element name="quantity" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
// XML doc
<stocktrade
xmlns ... and other attributes
>
<ticker>aaa</ticker>
<price>23.5</price>
<quantity>11</quantity>
</stocktrade>
// Error
Exception in thread "main" org.xml.sax.SAXParseException: cvc-complex-type.2.4.
: Invalid content was found starting with element 'ticker'. One of '{ticker}' i
expected.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSA
ParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Un
nown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErr
rReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.report
chemaError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handle
tartElement(Unknown Source)

When I tried this with Xerces SAX, I got---
org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
Maybe Xerces has not implemented the schemaLanguage property.
I have been successfully using Xerces-dependent properties to do validation:
XMLReader parser = saxParser.getXMLReader();
parser.setFeature( "http://xml.org/sax/features/validation", true);
parser.setFeature( "http://xml.org/sax/features/namespaces", true);
parser.setFeature( "http://apache.org/xml/features/validation/schema", true);
parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", true);
if (noNamespaceSchemaLocation!=null) {
parser.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
noNamespaceSchemaLocation);
if (schemaLocation!=null) {
parser.setProperty(
"http://apache.org/xml/properties/schema/external-schemaLocation",
schemaLocation);
Also, as DrClap pointed out, for the schema location I use URIs.
Please let me know if you got the jaxp schemaLocation property to work and how you did it.

Similar Messages

  • Error validating xml with xsd schema on JSDK 1.4

    Hi All,
    Asked to me do it a Web Service client in Java and validate its xml answer with an xsd file using 1.4 plataform.
    I googled and I saw many samples to 1.5 plataform, and few samples to 1.4, but anyway I tried to do what they asked to me.
    I got connect with service, got the response and so I went to validate that xml with an xsd file.
    But I got an error on that task. The error occurs in the following line
    "Schema schema = factory.getSchema();"
    Bellow my code
    final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
              final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
              final String schemaSource = "C:\\GetAuthorizationServiceOutput.xsd";
              final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();          
              factory.setNamespaceAware(true);
              factory.setValidating(true);
              try {
              factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
              factory.setAttribute(JAXP_SCHEMA_SOURCE,new File(source));
              catch (IllegalArgumentException x) {
                   System.out.println(x.getMessage());
    DocumentBuilder builder = null;
              Document document = null;
              try {
                   builder = factory.newDocumentBuilder();
                   document = builder.parse(new InputSource(new StringReader(ret.toString())));
              } catch (ParserConfigurationException e) {
                   e.printStackTrace();
              } catch (SAXException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
              **Schema schema = factory.getSchema();**
              Validator validator = schema.newValidator();
              try {
                   validator.validate(new DOMSource(document));
              } catch (SAXException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
    and here is the exception :
    Caused by: java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.getSchema()Ljavax/xml/validation/Schema;
    Method onLinkClicked of interface wicket.markup.html.link.ILinkListener targeted at component [MarkupContainer [Component id = btBack, page = br.com.weev.finan.mkb_er.extranet.view.relations.RelationsDetails, path = 30:form:btBack.RelationsDetails$4, isVisible = true, isVersioned = true]] threw an exception
    wicket.WicketRuntimeException: Method onLinkClicked of interface wicket.markup.html.link.ILinkListener targeted at component [MarkupContainer [Component id = btBack, page = br.com.weev.finan.mkb_er.extranet.view.relations.RelationsDetails, path = 30:form:btBack.RelationsDetails$4, isVisible = true, isVersioned = true]] threw an exception
         at wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:198)
         at wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:74)
         at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:65)
         at wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:57)
         at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:896)
         at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
         at wicket.RequestCycle.step(RequestCycle.java:1010)
         at wicket.RequestCycle.steps(RequestCycle.java:1084)
         at wicket.RequestCycle.request(RequestCycle.java:454)
         at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.GeneratedMethodAccessor342.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:187)
         ... 39 more
    Caused by: java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.getSchema()Ljavax/xml/validation/Schema;
         at br.com.weev.finan.mkb_er.business.manager.impl.RelationManagerImpl.getAuthorizationService(RelationManagerImpl.java:152)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy22.getAuthorizationService(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:377)
         at wicket.proxy.$Proxy39.getAuthorizationService(Unknown Source)
         at br.com.weev.finan.mkb_er.extranet.view.relations.RelationsDetails$4.onClick(RelationsDetails.java:125)
         at wicket.markup.html.link.Link.onLinkClicked(Link.java:254)
         ... 43 more
    It's my first time doing that, so I'm confuse to do it.
    Thank you
    Juliano.

    This is how.
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
    dbfac.setNamespaceAware(true);
    SchemaFactory factory1 = SchemaFactory
                        .newInstance("http://www.w3.org/2001/XMLSchema");
    Schema schema = factory1.newSchema(new File("person.xsd"));
    dbfac.setSchema(schema);
    DocumentBuilder dbparser1 = dbfac.newDocumentBuilder();
    Document doc1 = dbparser1.parse(new File("person.xml"));
    Validator validator1 = schema.newValidator();
    DOMSource dm1 = new DOMSource(doc1);
    DOMResult domresult1 = new DOMResult();
    validator1.validate(dm1, domresult1);

  • Localized Errors (xerces, xml-schema)

    i would like to get localized error messages (ex. in german) after parsing a xml-schema with the SchemaFactory.
    i've tried out the typical way with "Locale.SetDefault" and e.getLocaleMessage" in a selfwritten ErrorHandler but this doesn't work ...

    i would like to get localized error messages (ex. in
    german) after parsing a xml-schema with the
    SchemaFactory.
    i've tried out the typical way with
    "Locale.SetDefault" and e.getLocaleMessage" in a
    selfwritten ErrorHandler but this doesn't work ...I have the same problem as above. Is there a way to customise schema validation messages?
    example
    cvc-attribute.4: The value ''{2}'' of attribute ''{1}'' on element ''{0}'' is not valid with respect to its fixed '{'value constraint'}'. The attribute must have a value of ''{3}''.
    to become
    Element "{0}" value is invalid. Choose from "{3}".
    thanks

  • Error downloading XML schema processor for java from OTN

    I'm getting error downloading this product from otn site. http://technet.oracle.com/tech/xml/schema_java/index.htm
    I login to OTN, go to this site, enter registration information and then I get the following error when I try to submit my info.
    Runtime error occured. Do you wish to debug?
    Line: 20
    Error :'e_mail_valid' is undefined.
    When I say 'No' for debug, it takes me to 'XML parser for java' download page instead of 'XML Schema processor'.
    please help.
    thankx
    null

    The 'e_mail_valid' is undefined" has to do with the format of or lack of the email address. The routing problem is ours and should be fixed later today or by tomorrow morning.
    Thanks,
    Oracle XML Team

  • RuleAuthor : error importing XML Schemas into Data Model

    Hi,
    I have problems during import XML Schema in my Data Model.
    I'm following these steps:
    1) Click Definitions tab;
    2) Click XMLFact;
    3) Click Create
    4) I enter the path for the schema and the directory to store JAXB-generated classes. In this directory every user has all permission (777).
    In the next step when I click on "Add Shemas" I have this error:
    java.io.IOException: Not enough space at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:53) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:451) at java.lang.Runtime.exec(Runtime.java:591) at java.lang.Runtime.exec(Runtime.java:429) at java.lang.Runtime.exec(Runtime.java:326) at oracle.rules.sdk.datamodel.impl.DataModelUtil.compileJavaFile(DataModelUtil.java:479) at oracle.rules.sdk.datamodel.DataModelManager.addXMLSchemaPath(DataModelManager.java:984) at oracle.rules.sdk.mapper.RuleObjectHelper.addSchemapath(RuleObjectHelper.java:2759) at oracle.rules.ra.uix.mvc.SchemaSelectorEH.addSchema(SchemaSelectorEH.java:138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at oracle.rules.ra.uix.mvc.BeanEH.genericHandleEvent(BeanEH.java:869) at oracle.rules.ra.uix.mvc.BeanEH.handleEvent(BeanEH.java:838) at oracle.cabo.servlet.event.TableEventHandler.handleEvent(Unknown Source) at oracle.cabo.servlet.event.TableEventHandler.handleEvent(Unknown Source) at oracle.cabo.servlet.event.BasePageFlowEngine.handleRequest(Unknown Source) at oracle.cabo.servlet.AbstractPageBroker.handleRequest(Unknown Source) at oracle.cabo.servlet.ui.BaseUIPageBroker.handleRequest(Unknown Source) at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source) at oracle.cabo.servlet.UIXServlet.doGet(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)
    I cannot find the solution!
    Can someone help me?
    Thanks.

    Do you still have enough disk space available on your file system to store the different xml-facts the RuleAuthor will create for you?

  • EA1 error viewing XML schemas

    When I want to view the XML schemas of MDSYS I get the error ORA-22835 . I am not connected as MDSYS.
    This means that the buffer was to small for conversion from clob to char or blob to raw conversion.
    After this error I see only 'No text available'.
    I use Oracle version 11:
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production

    Do you still have enough disk space available on your file system to store the different xml-facts the RuleAuthor will create for you?

  • Request for sample code, Validating XML Schema

    Does anyone have some sample code to validate
    an XML Schema with the Oracle parser?
    Also, the classgen code seems to have more XML Schema classes in it. There is an xschema.jar full of XML Schema related code. Would it be possible to use this code?
    I've tried DOMSample.java with the v2 parser. It seems to happily echo Schema based XML files that are obviously wrong. (I use Tibco's XML Authority to verify the XML file and XML Schema).

    I do not have sample code but it is not a difficult API to call. I have worked on it before, so if you have a specific question on it, happy to help out if I can.

  • IllegalArgumentException - error validating xml with schema

    I'm trying to validate an XML document using the following:
    JAXP 1.2
    Xerces 1.4.4
    JDK 1.4.1
    The xml is valid and I can confirm it with XML Spy when I point it to the schema definition. But, I get an IllegalArgumentException when I try to do it in my class.
    Here's the code...
    public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    public static final String CIS_SCHEMA = "D:\\dev\\xml\\cis.xsd";
    public static final String[] SCHEMAS = { W3C_XML_SCHEMA, CIS_SCHEMA };
    private static DocumentBuilderFactory dbf;
    private static DocumentBuilder db;
    try {
         dbf.setNamespaceAware(true);
         dbf.setValidating(true);
         dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, SCHEMAS);
    } (catch ...) {
    I get the following error:
    java.lang.IllegalArgumentException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    Any ideas?

    When I tried this with Xerces SAX, I got---
    org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    Maybe Xerces has not implemented the schemaLanguage property.
    I have been successfully using Xerces-dependent properties to do validation:
    XMLReader parser = saxParser.getXMLReader();
    parser.setFeature( "http://xml.org/sax/features/validation", true);
    parser.setFeature( "http://xml.org/sax/features/namespaces", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", true);
    if (noNamespaceSchemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
    noNamespaceSchemaLocation);
    if (schemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-schemaLocation",
    schemaLocation);
    Also, as DrClap pointed out, for the schema location I use URIs.
    Please let me know if you got the jaxp schemaLocation property to work and how you did it.

  • Error validating a schema

    I have read a lot of posts and documentation on validating schema with Java. Whether I do it the sun Jaxp way, or with JDOM (using the latest xerces), I get the same error (below):
    java.lang.NoSuchMethodError
         at org.apache.xerces.util.DOMUtil.getLocalName(DOMUtil.java:699)
         at org.apache.xerces.impl.xs.traversers.XSAttributeChecker.resolveNamespace(XSAttributeChecker.java:1751)
         at org.apache.xerces.impl.xs.traversers.XSAttributeChecker.checkAttributes(XSAttributeChecker.java:1051)
         at org.apache.xerces.impl.xs.traversers.XSAttributeChecker.checkAttributes(XSAttributeChecker.java:1025)
         at org.apache.xerces.impl.xs.traversers.XSDocumentInfo.<init>(XSDocumentInfo.java:137)
         at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:523)
         at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:402)
         at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:524)
         at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2355)
         at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1749)
         at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:679)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:300)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:588)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1609)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:336)
         at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:220)
         at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:593)
         at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1168)
         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:370)
    Here is the start of my XML file, and the schema file is local as well. Any ideas would be well appreciated.
    <?xml version="1.0" encoding="UTF-8"?>
    <sdInterface xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="G:\projects\Architecture\shadow\SD10.xsd">
         <sdIdentification>
              <version>1</version>
              <transId>abcdefghij</transId>

    Is xercesImpl.jar and xml-apis.jar in the Classpath?
    Deepak

  • Error from XML Schema/JAVA link

    I'm getting the following error from all links on http://ws5.olab.oracle.com/faqdemo/xdkfaq.xsql?pagename=index:
    Oracle XSQL Servlet Page Processor 9.0.2.0.0C (Beta)XSQL-007: Cannot acquire a database connection to process page.
    ORA-01033: ORACLE initialization or shutdown in progress <<<
    Search (http://ws5.olab.oracle.com/faqdemo/xdkfaq.xsql?pagename=search) reports the following error as well, which may be related to the problem above:
    Start of root element expected. <<<Thanks,
    Mitch.

    We have closed all the public links to this web site for upgrading the database.
    Where did you got this access? We need to correct this.
    We will publish an update version later.
    Jinyu

  • XML Schema dependencies is not valid in osb 11g version

    Hi,
    I'm working in osb 11.1.1.5 version.I have to import the 10g project in 11g server, but in my 10g project some schemas are included in another schemas.When i'm trying to export the resources in the 10g console and importing it in the 11g console i'm getting the errors. XML Schema dependencies is not valid in osb 11g version.Is there any alternative to import the 10g project in 11g in this case?Please suggest.
    Thanks in advance!

    while running the proxy in the eclipse i'm getting the error
    servicebus:/XMLSchema/HistoricLoadService/Schemas/CCD/datatypes-base:998:2: error: derivation-ok-restriction.5.3a: A type with a mixed content model can only restrict another type with a mixed content model. at poc_ccd.xsd
    When i'm trying to export the project from 10g console and importing it from osb 11g console I'm getting the conflicts like
    servicebus:/XMLSchema/HistoricLoadService/Schemas/CCD/datatypes-base:289:2: error: derivation-ok-restriction.5.3: Must be a valid restriction.
    Resource XMLSchema HistoricLoadService/Schemas/CCD/ poc_ccd forms a cyclic reference

  • Validate XML Schema

    Hi,
    I need to load some XML schema definitions to afterwards validate some DOM documents against this schemas. My problem is, when loading those XML schema definitions I have to validate them. How to do this? How to provide an javax.xml.validation.Schema object and check is valid XML schema?
    Thanks in advance.

    The very act of loading the schema into a schema object will validate it. That is, if you get as far as having an instance of Schema, it's valid.

  • Validating XML Parser

    We want to validate XML Messages generated by UDS 5.1 components against XSchemas before we send them out.
    Forte 3.5. built in parser does no validation.
    Has anybody set up a solution architecture he/she will share with us ? ( We do NOT have an AppServer in place !).
    Solutions on UNIX platform preferred.
    Thanks for each hint !

    We have implemented a validating XML parser that does not require command line execution but unfortunately it depends on the Microsoft MSXML parser. We used olegen to create a Forte project that allows us to reference the MSXML parser as if it were inline Forte TOOL code. The MSXML4.dll provides support for validating XML schemas.
    We are looking to find a multi-platform way to accomplish the same thing. I'm guessing that there may be a validating XML parser out there implemented in C that can be included into the Forte repository using the wrapper mechanism - has anyone tried this?
    I see that Xerces has a C++ based validating parser - do you thing that could be accessed via the wrapper? Or would that have to be accessed via the command line?
    Regards.

  • Error in validating XML against schema

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

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

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

Maybe you are looking for

  • ITunes will not install on new Windows 7 computer

    I'm trying to download iTunes onto my new computer. I give my email address and download it, then towards the end I get an error message that says the installer is for the 32-bit version, please download the 64-bit version. The 64-bit version is what

  • HELP - How do you install classic without erasing OS 10.4.8

    Please help....I just replaced my PowerBook G4 with a new MacBook and would like to pass the G4 down to my daughter. Most of the games that she uses are in classic from her old Imac. My G4 came with classic but I had to reinstall OSX a while ago and

  • How do I keep photoshop from changing extensions from .JPG to .jpg

    How do I keep photoshop from changing extensions from .JPG to .jpg?

  • #eee is showing up as white

    My display is fine, but both of my bosses who are on last gen 27 inch imacs cannot see #eee. It shows up as white.

  • Importing Stereo files in Logic

    I am trying to import stereo interleaved audio files into Logic Pro 9.  When I do, the stereo files import as mono files and won't play.  Is there any way around this, or is Logic only designed for mono files?  This does not seem logical, although ma