XSD parsing

I would need a way of programmatically
access the structure of an XML schema in Java.
I'm talking about handling the structure of the schema, including constraints, cardinalities, etc, through an API or a set of generated classes.
What would be the simplest and most efficient way to do that? JDOM, JAXB, etc do not seem to really fit my problem...
My objective is to build a java GUI that allows online creation/editing of an XML document and I have to know about the structure and constraints of the schema in order to 'drive' the editing process.
Thanks,
Francesco

This topic is still alive! :)
Hello Francesco and all follower,
I am also very interested in this problem since I have to do almost the same as you but for web. I have the same problem at the moment, namely how to parse XML schema and get all required information about certain element. It would be great help for me if you or anyone could tell me what tool/technologie/etc. I should use. I also would be very happy about small example if possible.
Thanks a lot for any replies!
Sveta

Similar Messages

  • Fetching parent-child relationship using API or XSD parsing?

    Hi,
    I would like to fetch all children of a parent object. I did not see any API to provide this information. I tried with GetMapping API, however it does not provide list of all child objects.
    E.g. Fetching all child of "Account" object should return all child objects {Activity, Address, Asset, Attachment, Business Plan, Claim, Deal Registration, Financial Account, Financial Account Holder, Financial Plan, Lead, Message Response, Note, Objective, Opportunity, Policy, Policy Holder, Revenue, Service Request, Special Pricing Request}
    Is it possible through API? If not, then XSD parsing seems to be the only way to retrieve children. Any guideline or rule on XSD parsing to get list of all children. XSD parsing doesn't look a good solution. Any other way to do so?
    This information is crucial for us. Please provide input.
    Thanks
    Ravish

    833189 wrote:
    Hi,
    I would like to fetch all children of a parent object. I did not see any API to provide this information. I tried with GetMapping API, however it does not provide list of all child objects.
    E.g. Fetching all child of "Account" object should return all child objects {Activity, Address, Asset, Attachment, Business Plan, Claim, Deal Registration, Financial Account, Financial Account Holder, Financial Plan, Lead, Message Response, Note, Objective, Opportunity, Policy, Policy Holder, Revenue, Service Request, Special Pricing Request}
    Is it possible through API? If not, then XSD parsing seems to be the only way to retrieve children. Any guideline or rule on XSD parsing to get list of all children. XSD parsing doesn't look a good solution. Any other way to do so?
    This information is crucial for us. Please provide input.
    Thanks
    RavishHi Ravish,
    Any success on this one? We are hurdling the same difficulty as of the moment. We are basically building a plugin that will remotely (and automatically) import a CRMOD object's data model. That goes to say also that we're relying on CRMOD's web services for our solution.
    I've read from the Web Services on Demand Guide that GetMapping is suppose to "Return the display names and XML tags of the fields of a record type *or one of its child components*..."+. It seems that this translates to - if you want the list of fields for a child component, you have to run GetMapping on the child component. If this is the case, what other available web services calls can we make to get the relationship hierarchy of a CRMOD object? Any help would be greatly appreciated.:-)
    Thank you,
    John

  • XSD parser change from XI 3.0 to 7.1 ?

    Hello,
    we upgraded 3.0 to 7.1 EHP1 and noticed an ugly problem:
    it seems that in XI 3.0 (until at least SP21) the XSD parser used a default value 0 when minOccurs is missing in the XSD. Contrary, in PI 7.1, it uses a default value of 1 (which is consistent with W3C standard).
    This leads to changed mapping behaviour because on XI some nodes are displayed with minOccur=0 while the same mapping (with same XSD) on PI 7.1 are displayed as minOccur=1. Which causes trouble obviously, because our implementation relied on minOccurs=0, and some data now can not be processed anymore because data for that node is missing.
    Some external vendors seem to rely on the old behaviour, so those mappings do not work anymore now for certain test data.
    Does anybody know how to deal with that problem ? We can manually change all XSD's and add the minOccurs=0, but that is much work and error prone. Is there an easier way, e.g. an option in the XSD parser which can be set globally somewhere ? Or a tool which can do this conversion automatically ?
    CSY

    Hi,
    It is strange issue, I never noticed but will try.
    Script can be written to automatically add minOccurs = 0 wherever it is missing but it could be dangerous as well. If you have limited xsd (less than 100) then my suggestion to go by manual changes (may be in XI3.0 system first then import it in PI7.1).
    I'll try it out and come back to you.
    Regards,
    Gourav

  • SAX error in xsd parsing (was: Application only returns "Log is disabled.")

    Ok, it seems the underlying error of the "Log is disabled" is with parsing xml. I paste in the relevant bits of the console output of Weblogic 10.3.2.0 below (slightly modified the URL). I made a small testcase in Eclipse reading the same xsd from the same URL with SAX (same JDK as using in weblogic) and it works there. Has anybody an idea? I thought it might be a conflict with SAX versions or so, but couldn't find anything.
    Thanks,
    Stefan
    java.lang.Exception: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://ip/data/blah/V100/other.xsd'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.load(AbstractDefinitionContext.java:157)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.load(AbstractDefinitionContext.java:115)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.loadIfNecessary(AbstractDefinitionContext.java:91)
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.<init>(WsdlMockRunner.java:94)
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockService.start(WsdlMockService.java:206)
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockService.start(WsdlMockService.java:492)
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockService.start(WsdlMockService.java:67)
    at com.eviware.soapui.mockaswar.MockAsWarServlet.init(MockAsWarServlet.java:82)
    at javax.servlet.GenericServlet.init(GenericServlet.java:241)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:531)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:235)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://ip/data/blah/V100/other.xsd'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:48)
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:264)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:230)
    at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
    at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:140)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.nex(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
    at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:163)
    ... 20 more
    Edited by: user13782455 on 19.01.2011 05:03

    earlier it was
    org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'USAVER'.anmd now it is
    org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'Alert1'.some problem in this Alert1 message is what i guess.. some parsing error.. look closely..
    i guess some of the xml characters are not rendered properly in forum software.. or it may be truncated.. so i believe something wrong which is not visible..

  • Error in XSD Parsing - Imported XSD not being loaded

    I am trying to validate XML with XSD. The XML has elements in two different namespaces:-
    1-"http://schemas.xmlsoap.org/soap/envelope/"
    2-urn:Hotel_Reserve
    So in Schema I have defined elements Envelop, Header and Body in "http://schemas.xmlsoap.org/soap/envelope/" namespace and targetNamespace and imported another schema which is in "urn:Hotel_Reserve" namespace. Here it is:-
    <xs:schema xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:n1="urn:Hotel_Reserve" targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" elementFormDefault="qualified">
    *<xs:import namespace="urn:Hotel_Reserve" schemaLocation="BookingRequestBody.xsd"/>*
    <xs:element name="Envelope">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Header">
    <xs:complexType/>
    </xs:element>
    <xs:element name="Body">
    <xs:complexType>
    <xs:sequence>
    *<xs:element ref="n1S_HotelRes_RQ"/>*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    I am using JDK1.5. I am able to validate the XML in a standalone Java program. I suppose here the Xerces parse is being used which is shipped with JDK itself in com.sun.org.apache.xerces* package.
    The problem is when the same code is deployed in JBoss 4.0.3SP1, I get following exception:-
    org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'n1S_HotelRes_RQ' to a(n) 'element declaration' component.
    It seems that when the code is deployed in JBoss, and the main XSD(which is mentioned above) is loaded and parsed, the schema in the import section is not loaded. I have checked the schema are present in the required place.
    Any clue where I may be doing wrong?

    Instead of parsing the schema with DOM/SAX, just loading it with URL worked with JBoss.
    But I don’t know how and why?
    here is the sample code:
    URL schemaURL = Thread.currentThread().getContextClassLoader().getResource(WSConstants.BOOKING_SCHEMA_FILE);
    SchemaFactory provBookingSchemaFactory = schemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); provBookingSchemaFactory.setErrorHandler(new InvalidXMLErrorHandler());
    Schema provBookingSchema = provBookingSchemaFactory.newSchema(schemaURL);
    Validator provBookingValidator = provBookingSchema.newValidator();
    provBookingValidator.validate(new DOMSource(requestDoc));
    Earlier I was creating the schema instance using the DOM source:-
    Schema provBookingSchema = provBookingSchemaFactory.newSchema(new DOMSource(schemaDoc));

  • BPEL MDS XSD parsing exception

    Hi,
    I am trying to explore MDS usage in SOA 11.1.1.3.I created an MDS connection in my jdev with file based persistence in the following folder
    D:\Jdev11113\jdeveloper\integration\seed\apps\xsd and I kept an xsd in this path.I also edited my adf-config.xml to refer to the mds.Below is my adf-config.xml
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config"
    xmlns:adf="http://xmlns.oracle.com/adf/config/properties">
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="MDSSample-5135"/>
    </adf:adf-properties-child>
    <adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
    <mds-config xmlns="http://xmlns.oracle.com/mds/config">
    <persistence-config>
    <metadata-namespaces>
    <namespace metadata-store-usage="mstore-usage_1" path="/soa/shared"/>
    <namespace metadata-store-usage="mstore-usage_2" path="/apps/xsd"/>
    </metadata-namespaces>
    <metadata-store-usages>
    <metadata-store-usage id="mstore-usage_1">
    <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
    <property value="${oracle.home}/integration"
    name="metadata-path"/>
    <property value="seed" name="partition-name"/>
    </metadata-store>
    </metadata-store-usage>
    <metadata-store-usage id="mstore-usage_2">
         <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
         <property value="${oracle.home}/integration"
         name="metadata-path"/>
         <property value="seed" name="partition-name"/>
         </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    </persistence-config>
    </mds-config>
    </adf-mds-config>
    </adf-config>
    But when I am creating a bpel process which refers to the schema I kept in the xsd folder it shows error that the schema cannot be parsed.
    Am I missing any step.Please guide me.
    Thanks.
    Edited by: user13542496 on May 4, 2011 12:12 AM

    I got it working.While creating the MDS connection in jdev I need to set the path only till apps folder.

  • JDeveloper Giving XSD Parse Error in BPEL Project during Adapter Config

    Folks:
    I receive the following error in the JDEV "Type Chooser" from the Adapter Configuration Wizard GUI:
    Under the ESB Projects header:
    "Exception: Unable To Parse schema EmpDBOut_table.xsd"
    Yet, If I manually add the exact same XSD to the root of the BPEL PRoject, it parses perfectly fine.
    JDeveloper Version: 10.1.3.2.0.4066 Studio Edition
    Steps to recreate: 1) Create New BPEL Project with Empty BPEL Process;
    2) Add a JMS AdapterService and step through the Adapter wizard:
    Step 1 Name: TestESB
    Step 2 OEMS: memory/file
    Step 3: Connection (give it your previously configured App Server Connection)
    Step 4: Select Consume Message
    Step 5: Destination Name = demoTopic(Topic) at root of JMS tree
    Step 6: browse Schema location which brings up the Type Chooser dialog
    Choose any schema available inside the ESB Projects or the WSDL explorer and you get the same Exception.
    What's the problem here?

    I figured it out. The problem was inside the ESB Control. SOA Suite 10.1.3.1 was installed using http port 8889. When I went to look at the definitions of the end points in the ESB Control, the wsdl url location was showing 8888. When I changed the deployed ESB process using the ESB control to 8889 -- then JDeveloper was able to see the correct xsd definitions and the root elements are visible.
    SO, the quick answer is ESB default server location needs to be modified if the app server port is anything but 8888.

  • Xml sax parser

    Hi all,
    I am newbie to xml. I am using SAX parser for parsing xml documents. I have to write a code which parses all types of xsd files(including which can contain inline , referenced or both). Can anyone help / guide me how to code a generic xsd parser??
    Thanks in advance,

    An XSD file is an XML file, so you can parse it using sax.
    See :
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/work/Echo02.java
    See also:
    http://www.oracle.com/technology/tech/xml/xdk/doc/production/java/doc/java/javadoc/oracle/xml/parser/schema/XMLSchema.html#getXMLSchemaNodeTable

  • Getting Error in java mapping: Parsing empty source. Root element expected!

    Hi Experts,
       I am using java mapping for schema validation of input message. I have followed all the standard procedures and implemented the java class in the interface mapping.
    My interface mapping is like this:
    OrderData --->Java Class ---SchemaValidate
                         Mesg Map ---OrderData_to_BAP --->BAPI Msg
    So first I want to validate the schema of the input message. If the input message is invalid then XI should throw an exception. Then I use the actual message mapping to map the input order data to the BAPI input parameters.
    In the java code I am using xerces parser.
    The java code works fine when I run it as a standalone application.
    The interface mapping also works fine if I don't include the java mapping. Ofcourse schema validation does not happen.
    But when I test the interface mapping by including the java mapping then I am getting the error:
    Call method execute of the application Java mapping SchemaValidate
    Java mapping SchemaValidate completed. (execute() of SchemaValidate
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Parsing an empty source. Root element expected!
    What am I doing wrong? Why it is not getting the root element?
    My Java code is as follows:
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import java.io.*;
    import java.util.Map;
    import javax.xml.parsers.*;
    import org.xml.sax.helpers.*;
    import org.xml.sax.*;
    import org.apache.xerces.jaxp.*;
    Sample mapper for SAP-XI
    @author Gopal
    public class SchemaValidate implements StreamTransformation {
        //Constants when using XML Schema for SAX parsing.
         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";
    Injection of mapping parameters
    from integration engine
    @param map Map with configuration data
        public void setParameter(Map map) {
    Mapping implementation
    @param inputStream Input data from integration engine
    @param outputStream Output data to integration engine
        public void execute(InputStream inputStream,
                            OutputStream outputStream)
          throws StreamTransformationException {
            try {
                  // obtain an object of class javax.xml.parsers.SAXParser,
                  SAXParserFactory spf = SAXParserFactoryImpl.newInstance();
                  spf.setNamespaceAware(true);
                  spf.setValidating(true);
                  SAXParser sp = spf.newSAXParser();
                  // setup the schema file
                  sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                  sp.setProperty(JAXP_SCHEMA_SOURCE, new File("IOReqMsgSchema.xsd"));
                  //parse the input xml using the given schema
                  sp.parse(inputStream, new ParseErrorHandler());
            catch(SAXException se) {
              se.printStackTrace();
            catch ( Exception e ) {
              throw new StreamTransformationException( e.getMessage() );
    My input message is :
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreate_request xmlns:ns0="mynamespace">
       <ORDER>HTEST1234567</ORDER>
       <ORDER_TYPE>z001</ORDER_TYPE>
       <ORDER_NAME>Test Order</ORDER_NAME>
       <CO_AREA>INTC</CO_AREA>
       <CCTR_POSTED>1234567890888888888</CCTR_POSTED>
       <CURRENCY>USD</CURRENCY>
       <PERSON_RESP>12345679</PERSON_RESP>
    </ns0:OrderCreate_request>
    Kindly help! please this is urgent!!!!!!
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Feb 28, 2008 9:34 AM

    Hi Stefan,
       I did the code changes to return output stream and the java code works perfectly in standalone mode in my PC.
       But when I use the same in the Java mapping with XI then It throws an error "Getting Error in java mapping: Parsing empty source. Root element expected!".
    My XI J2EE server has JDK1.4.3.11.
    Is there any limitation of using SAX parser in XI? If Yes, then which parser should be used for schema validation in XI?
    I have included the XSD file for schema validation along with class files in the .jar file. This jar file is then imported in XI repository. Is the XI engine not able to read the XSD file?
    Do I have to handle reading XSD file differently? Any suggession how?
    Is this parser error due to some security access?
    Kindly help me! I have been struggling with this problem since 2 weeks. I will be greatfull to you if you can help me.
    Thanks
    Gopal

  • Problem in parsing XML Schema

    I am trying to parse XML Schema using XSOM. The Schema has <xs:include>s
    e.g. I have first.xsd which includes second.xsd and second.xsd again includes third.xsd.
    First.xsd
    <xs:include schemaLocation="../Second.xsd">....
    Second.xsd
    <xs:include schemaLocation="Third.xsd">....
    When I parse "First.xsd" parser passes the correct path "C:/XSDSchema/Second.xsd"(First.xsd resides in "C:/XSDSchema/Schema/") to the EntityResolver's resolveEntity method. But for Second.xsd it passes "Third.xsd" only (Third.xsd resides in "C:/XSDSchema/" ) .
    Any Idea ?????

    Here is a screenshort of the part of my workflow:
    In the mappings of the "Set Value" activity, I have one line with those properties:
    Location: /process_data/bonusValidationForm/object/data/xdp/datasets/data/BonusValidationForm/buMan agerID
    Expression: /process_data/currentUser/object/@userId
    Where:
    bonusValidationForm is a process variable of my workflow that point my xdp form
    buManagerID is the textfield I want to set
    currentUser is a process variable (type User) that was well setted by the task Find BU Manager

  • JAXB 1.3 can't parse W3 SOAP 2003-05 envelope XML schema

    Hello,
    I was trying to use JAXB to parse the MMAP schema from the SMS Forum
    (http://www.smsforum.net/schemas/mmap/v1.0/mmap.xsd). I finally
    tracked it down to XJC choking on the included SOAP envelope schema's
    use of the xml:lang attribute for a tag called reasontext. Here's the
    pared-down test case:
    C:\java\src\baz>%JWSDP_HOME%\jaxb\bin\xjc.bat http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd
    %JWSDP_HOME%\jaxb\bin\xjc.bat http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd
    parsing a schema...
    [ERROR] src-resolve: Cannot resolve the name 'xml:lang' to a(n) attribute declaration component.
      line 97 of soap-envelope.xsd
    [ERROR] src-ct.0.1: Complex Type Definition Representation Error for type 'reasontext'.  Element 'attribute' is invalid, misplaced, or occurs too often.
      line 97 of soap-envelope.xsd
    Failed to parse a schema.
    C:\java\src\baz>I believe that the relevant portions of the schemas and namespaces in
    question are:
    http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd
    <xs:complexType name="reasontext">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute ref="xml:lang" use="required" />
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>http://www.w3.org/2001/XMLSchema.xsd
    <xs:complexType name="attribute" mixed="false">
    <xs:complexContent>
    <xs:extension base="xs:annotated">
    <xs:sequence>
    <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType" />
    </xs:sequence>
    <xs:attributeGroup ref="xs:defRef" />
    <xs:attribute name="type" type="xs:QName" />
    <xs:attribute name="use" use="optional" default="optional">
    <xs:simpleType>
    <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="prohibited" />
    <xs:enumeration value="optional" />
    <xs:enumeration value="required" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="default" type="xs:string" />
    <xs:attribute name="fixed" type="xs:string" />
    <xs:attribute name="form" type="xs:formChoice" />
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>http://www.w3.org/2001/XMLSchema.xsd
    <xs:attributeGroup name="defRef">
    <xs:annotation>
    <xs:documentation>for element, group and attributeGroup, which both define and reference</xs:documentation>
    </xs:annotation>
    <xs:attribute name="name" type="xs:NCName" />
    <xs:attribute name="ref" type="xs:QName" />
    </xs:attributeGroup>http://www.w3.org/XML/1998/namespace
    The namespace whose name is http://www.w3.org/XML/1998/namespace is
    bound by definition to the prefix xml: according to Namespaces in XML,
    W3C Recommendation 14 Jan 1999. Note that unlike all other XML
    namespaces, both the name and the prefix are specified; i.e., if you
    want XML 1.0 processors to recognize this namespace, you must use the
    reserved prefix xml:.
    xml:lang and xml:space
    As of the last update of this document, the XML 1.0 Specification
    defines two attribute names in this namespace:
    xml:lang
    Designed for identifying the human language used in the scope of the
    element to which it's attached.
    .I'm no XML schema expert, but it looks to me like "name" and "ref"
    are both valid attributes for an <xs:attribute> tag and that the XML
    namespace standard requires XML processors to recognize the xml:lang
    attribute. Hence, this appears to me to be a bug in JAXB.
    A secondary bug is that the original error message left the name of
    the offending included schema blank:
    C:\java\src\foo>d:\java\jwsdp\jwsdp-1.3\jaxb\bin\xjc.bat http://www.smsforum.net/schemas/mmap/v1.0/mmap.xsd
    parsing a schema...
    [ERROR] src-resolve: Cannot resolve the name 'xml:lang' to a(n) attribute declaration component.
      line 97 of
    [ERROR] src-ct.0.1: Complex Type Definition Representation Error for type 'reasontext'.  Element 'attribute' is invalid, misplaced, or occurs too often.
      line 97 of
    Failed to parse a schema.
    C:\java\src\foo>In case it helps with problem diagnosis, I'm running with J2SDK 1.4.2
    and have copied the endorsed jar files into the JRE lib as instructured
    with JAXB:
    C:\java\src\baz>java -version
    java -version
    java version "1.4.2"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
    Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
    C:\java\src\baz>dir %JAVA_HOME%\jre\lib\endorsed
    dir %JAVA_HOME%\jre\lib\endorsed
    Volume in drive D has no label.
    Volume Serial Number is 70AE-6E52
    Directory of D:\java\j2se\j2sdk1.4.2\jre\lib\endorsed
    03/31/2004  09:41 AM    <DIR>          .
    03/31/2004  09:41 AM    <DIR>          ..
    03/29/2004  01:28 PM            56,619 dom.jar
    03/29/2004  01:28 PM            60,963 sax.jar
    03/29/2004  01:28 PM         2,823,241 xalan.jar
    03/29/2004  01:28 PM         2,667,618 xercesImpl.jar
    10/10/2003  06:36 PM         1,379,810 xsltc.jar
                   6 File(s)      6,989,573 bytes
                   2 Dir(s)   7,889,731,584 bytes free
    C:\java\src\baz>I'm quite interested in the resolution of this issue as I'm stopped in
    my tracks on progress here. Help with resolution, whether in JAXB or
    my usage of it, will be much appreciated. I did a search of existing
    issues but didn't notice a duplicate. Thanks in advance.

    I have also come across a similar problem with validating an xml file with an xml:lang attribute. It seems to be common across the schema validation and dtd validation. I get the following error with both schema and dtd validation:
    Validation Error Msg (0): unexpected attribute "xml:lang"
    Validation Error Location (0): FreeFormText
    The test file extract looks like this:
    <FreeFormText xml:lang="EN">Pelle</FreeFormText>
    The schema defines the node as:
    <xs:complexType name="FreeFormText">
              <xs:simpleContent>
                   <xs:extension base="FreeFormTextType">
                        <xs:attribute name="lang" type="xs:language"/>
                   </xs:extension>
              </xs:simpleContent>
    </xs:complexType>
    and the dtd defines the node as:
    <!ELEMENT FreeFormText
         (#PCDATA)>
    <!ATTLIST FreeFormText xml:lang CDATA #IMPLIED >
    This looks like a bug in JAXB to me aswell. Any help on it would be much appreciated as i am also stuck.

  • JAXB to generate java classes for XSD.

    Hi
    I have a XSD, which is importing other couple of xsds in it, tried to generate java classes using xjc, it is throwing error.
    C:\vittal\Project\received\development-1\da_xsd>xjc -p com daAuthoring.xsd
    parsing a schema...
    [ERROR] Property "Alt" is already defined. Use <jaxb:property> to resolve thi
    s conflict.
      line 42 of file:/C:/vittal/Project/received/development-1/da_xsd/commonElement
    s.xsd
    [ERROR] The following location is relevant to the above error
      line 2205 of file:/C:/vittal/Project/received/development-1/da_xsd/daCommonEle
    ments.xsd
    Failed to parse a schema.Please let me know how to fix this issue.

    Thanks for information,
    I do understand xml well, and having basic knowledge on XSD.
    1. can i generate a java classes for a xsd which is including other XSDs.
    2. how to overwrite the issue, using annotation, point me to a location where i will get more information, that will be great help.
    here is my xsd.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:dctm="http://www.documentum.com" elementFormDefault="qualified">
         <xs:import namespace="http://dita.oasis-open.org/architecture/2005/" schemaLocation="ditaarch.xsd"/>
         <xs:import namespace="http://www.documentum.com" schemaLocation="dctmAttrs.ent.xsd"/>
         <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
         <xs:group name="alt">
              <xs:sequence>
                   <xs:element ref="alt"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="desc">
              <xs:sequence>
                   <xs:element ref="desc"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="title">
              <xs:sequence>
                   <xs:element ref="title"/>
              </xs:sequence>
         </xs:group>
         <!-- Elements in tblDecl.mod -->
         <xs:group name="colspec">
              <xs:sequence>
                   <xs:element ref="colspec"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="entry">
              <xs:sequence>
                   <xs:element ref="entry"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="row">
              <xs:sequence>
                   <xs:element ref="row"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tbody">
              <xs:sequence>
                   <xs:element ref="tbody"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tgroup">
              <xs:sequence>
                   <xs:element ref="tgroup"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="thead">
              <xs:sequence>
                   <xs:element ref="thead"/>
              </xs:sequence>
         </xs:group>
    </xs:schema>

  • JAXB Parsing error. Could it be a configuration problem?

    Do version mismatches produce schema errors or are the errors below true schema mismatches do you think?
    running this command.
    Error:
    C:\perforce\strata\v3\pools\prjSTA\src\classes>C:\Sun\jwsdp-1.5\jaxb\bin\xjc.bat
    -extension -use-runtime com.bofa.strata.component.xml.JAXBruntime1_0_4 -d C:\pe
    rforce\strata\v3\pools\prjSTA\src\classes\com\bofa\strata\business\cdrom\schema
    -p com.bofa.strata.business.cdrom.schema C:\perforce\strata\v3\pools\prjSTA\src\
    classes\com\bofa\strata\business\cdrom\schema\MonthlyBillingRequest.xsd
    parsing a schema...
    [ERROR] src-resolve: Cannot resolve the name 'tscd:BillingId.SimpleType' to a(n)
    'type definition' component.
      line 18 of MonthlyBillingRequest.xsd
    [ERROR] src-resolve: Cannot resolve the name 'ts:SigningMethod.Enumeration' to a
    (n) 'type definition' component.
      line 23 of MonthlyBillingRequest.xsdFailed to parse a schema.
    C:\perforce\strata\v3\pools\prjSTA\src\classes>C:\Sun\jwsdp-1.5\jaxb\bin\xjc.bat
    -extension -use-runtime com.bofa.strata.component.xml.JAXBruntime1_0_4 -d C:\pe
    rforce\strata\v3\pools\prjSTA\src\classes\com\bofa\strata\business\cdrom\schema
    -p com.bofa.strata.business.cdrom.schema C:\perforce\strata\v3\pools\prjSTA\src\
    classes\com\bofa\strata\business\cdrom\schema\MonthlyBillingResponse.xsd
    parsing a schema...
    [ERROR] src-resolve: Cannot resolve the name 'tscd:BillingId.SimpleType' to a(n)
    'type definition' component.
      line 11 of MonthlyBillingResponse.xsd
    [ERROR] src-resolve: Cannot resolve the name 'ts:AccountNumber.SimpleType' to a(
    n) 'type definition' component.
      line 13 of CDROM.xsdFailed to parse a schema.

    I've been looking around on eBay and I'm not quite sure which antenna I need. There's different types like 9dBi, 12dBi and 19dBi. Which type is best? Is this one any good?
    http://cgi.ebay.com.au/2-4GHz-12dBi-WIFI-Booster-Wireless-Antenna-WLAN-RP-SMA-/1 40523920864?pt=AUComputers_Networking_Accessories&hash=item20b7e0dde0#ht_3432wt932

  • SaxParser.setProperty without a XSD file reference!

    Hi!
    I currently make modifications to existing code that find errors in XML documents. The author is using the SAX (Simple API for XML) parser. In the code, following is written:
    public void process(String xmlString, String msgType) throws Exception
    String schemaLocation;
    schemaLocation=Constants.XSD+msgType+".xsd";
    parser.setProperty("http://apache.org/xml/properties/schema/external- schemaLocation", schemaLocation);
    parser.parse(new InputSource(new StringReader(xmlString)));
    if (this.errors != null)
    throw new ValidationException(this.errors,"Schema violation(s) occured.");
    } // public void process(String, String)
    With the setProperty method, the SAXParser sets a relation between the string and the object schemaLocation, which is another string. I a guess that this information is used to access the file, as the value of this variable is
    schemaLocation = "http://<IP Address>/ezoll/V01 file:///D:\\workspace\\ecs\\WebContent\\ezollat\\schemas
    " + <msgType that defines the file name> + ".XSD"
    QUESTION:
    My problem is that the XSD file that contains the rules for the XML file is a special kind of file that should be read in only once so that access time is reduced. How is it possible to modify this such that instead of accessing over setProperty a file, some other Object that is in the memory cache should be used?
    If you do not have a direct answer to the problem, which documentation would you advise to read? I have currently access to http://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/parsers/SAXParser.html.
    I know that reading all the file in the memory is somehow "violating" the idea of SAX; it's more DOM-like. But that is the requirement from my customer.
    Thank you all for your support!

    Thank you for the hint! I have found plenty of information online about the EntityResolver interface and classes that implement it from different vendors. I think that it will solve my problem.

  • BI pulisher errors out when I tried to load xml in rtf template.

    Hello,
    Today I have installed bi publisher with .net framework.But when I tried to load the xml file after opening .rtf template it gives error "XSD parser returned an error"
    Please let me know what could be the issue.
    Thanks
    Ganesh Mane

    Hello,
    --BI version : 10.1.3.2.0
    --OS          : WINXP
    Did you run microsoft update program if yes then what patches you have updated?
    -No. I just installed .net framework on my machine before installing this BI publisher.
    Thanks
    Ganesh
    Thanks
    Ravi

Maybe you are looking for