Validating with multiple schemas

I am setting the schama attribute as follow:
String schemaSource = "C:\\Documents and Settings\\ayache\\My Documents\\C5 XML\\schema\\searhRequest.xsd";
               String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
               builderFactory.setAttribute(JAXP_SCHEMA_SOURCE, new File(schemaSource));searchRequest.xsd contains include statement: it referes to another schema. When i try to validate the xml document using the scheam above error is thrown stating that the elements that are defined in the second schema(BookingProfile.xsd) are not recognised or can't be resolved.
Is there a way to set multiple schemas?
Your help is much appreciated.

I figured out my problem in case anyone else is having trouble..
In the xml document that you need to refer to:
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
supported by xerces 1.3.1.
Whew!
"Karen Schaper" <[email protected]> wrote:
>
Has anyone been successful at validating xml with a Schema running weblogic
6.1
sp2?
Here is a snippet of code...
SAXParserFactory objFactory = SAXParserFactory.newInstance();
objFactory.setValidating("true");
objFactory.setNamespaceAware("true");
objFactory.setFeature("http://apache.org/xml/features/validation/schema",
"true");
objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
A_HANDLER);
When my xml code runs through the parser I get an error for each element
saying
the element type is not declared in the dtd or schema.
Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
validation
with a Schema. From what I've read it seems that it does.
Any help or insight would be appreciated.
Thanks
Karen

Similar Messages

  • Help With Multiple Schemas In Multiple Environments

    Dear Oracle Forum:
    We have a bit of controversy around the office and I was hoping we could get some expert input to get us on the right track.
    For the purposes of this discussion, we have two machines, development and production. Currently, on each machine, we have one database with multiple schemas, say, one for sales data and another for inventory. The sales data has maybe 200 tables and the inventory has another 50. About 12 times a year, once a month, we have a release and move code from dev to prod. The database is accessed by several hundred Pro*C and Pro*Cobol programs for online transaction processing.
    The problem comes up when we need to have multiple development environments. If I need to work on something for May that requires the customer address field to be 50 characters and somebody else is working on something for July that requires the customer address field to be 100 characters, we can’t both function in the same schema. We have a method of configuring running programs to attach to a given schema/database. Currently, everything connects to the same place. We were told that we should not have the programs running as the owners of the schemas for some reason so we set up additional users. The SALES schema is accessed with the connect string: SALES_USER/[email protected]. (I don’t know where we got dot world from but that is not the current discussion.)
    One of the guys said that we should have 12 copies of the database running, which is kind of painful to think about in my opinion. Oracle is not a lightweight product and there are any number of ancillary processes that would have to be duplicated 12 times.
    My recommendation is that we have 12 schemas each for sales and inventory with 12 users each to access them. We would have something like JAN_SALES_USER, FEB_SALES_USER, etc. Each user would have synonyms set up for each of the tables it is interested in. When my program connects as MAY_SALES_USER, I could select from the customer table and I would get my 50 character address field. When the other user connects as JUL_SALES_USER, he would get his 100 character address field. Both of us would not know anything different.
    Another idea that came up is to have a logon trigger that would set the current schema for that user to the appropriate base schema. When JUL_SALES_USER logs in, the current schema would be set to JUL_SALES, etc. This would simplify things by allowing us to avoid having something like 2400 synonyms to maintain (which could be automated without too much difficulty) but it would complicate things by requiring a trigger.
    There are probably other ways to go about this we have not considered as yet. Any input you can give will be appreciated.
    Regards,
    /Bob Bryan

    Hans Forbrich wrote:
    I'd rather see you with 12 schemas than with 12 databases. Unless you have lots of CPUs to spare ... and lots of cash to pay for those extra CPU licenses.
    Then again, I'd take it one step further and ask to investigate the base design. There should be little reason to change the schema based on time. Indeed, from what little I know of your app, I'd have to ask whether adding a 'date' column and appropriate views or properly coded SQL statements might simplify things. Interesting. If we were to have one big Customer table with views for each month, how would we handle the case where the May people have to see 50 character address and July have to see a 100 character address field. I guess we could have MAY_ADDRESS VARCHAR2(50) and JULY_ADDRESS VARCHAR2(100) and take care to make sure that people connecting as May can only see the May columns, etc. This is simpler than multiple schemas?
    I may have overly simplified things in my effort to get something down that would not require too much explanation. The big thing is that multiple people are doing development and they have to be independent of each other. If we were to drop a column for July, the May people will have trouble compiling if we don’t keep things separate. It is not a case of making the data available. The data in development is something we cook up to allow us to test. The other part is the code we compile now will be released to production one of these times. In production, there is only a need for one database.
    We are moving from another database product where multiple databases are effectively different sets of files. We have lots of disk space so multiple databases were no problem. Oracle is such a powerful product; I can’t believe there is not some way to set up something similar.

  • Validating with XML Schemas

    Has anyone been successful at validating xml with a Schema running weblogic 6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema", "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)), A_HANDLER);
    When my xml code runs through the parser I get an error for each element saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

    I figured out my problem in case anyone else is having trouble..
    In the xml document that you need to refer to:
    xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
    supported by xerces 1.3.1.
    Whew!
    "Karen Schaper" <[email protected]> wrote:
    >
    Has anyone been successful at validating xml with a Schema running weblogic
    6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema",
    "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
    A_HANDLER);
    When my xml code runs through the parser I get an error for each element
    saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
    validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

  • One application with Multiple schemas- common application frame work

    Hi All,
    I am trying setup a common application frame work in apex. Please help me.
    How to achieve this.
    Creation of one application attached to different schemas at run time. So that my application maintaince is going to be easy instated of creating copies of same application.
    More details:
    1. I have one application with 100 pages pointing to a schema dev_common in one workspace APP_COMMON. I have 50 schemas with same structure of dev_common schema with different set of data ( because of large amount of data).
    So I want to create one application attached to different schemas.
    2. And another thing is I have 100 users, the user can work on 1 or multiple schemas ( I mean same application with different schemas attached)
    Any help much appreciated.
    Thanks,

    Thank you for the reply.
    >> b) I think you have to give access rights for the dev_common and app_common to all users.
    Dev_common schema is a kind of placeholder. I have 50 schemas same as dev_common because of different business requirements but the front end is same for all 50 schemas. How can we create one application used for 50 schemas instead of creating 50 applications and 50 workspaces.
    Please help me.

  • XML Validation with multiple XSD files (referenced)

    Hello,
    I know that XML validation with version 7.1 is possible now. However I was provided with a set of XSD files that have references to each other and need to be placed in a hierachical file system order so that references can be resolved.
    An element <xsl:include schemaLocation="../../baseSchemas/baseSchema.xsd" /> is used for example. How can I handle that for XSD validation in PI? Can I create the same folder structure or do I need to put all XSD files in one directory and change the import manually?
    But most important question: Is it possible it all to use more than one XSD for schema validation?

    Dear Florian,
    I had encountered such case in a project.
    I was given 3 files. One main file and 2 others called Schema1.xsd and Schema2.xsd.
    This happens because your data type is not in single namespace, but is being referred across namespaces and software components.
    I am assuming that you have read the How to Guide for XML validations on PI 7.1
    Best way to do this quickly is as follows.
    1. Enable XML validation at adapter engine in the sender agreement.
    2. Post a message using HTTP post. (http://sappihttpclient.codeplex.com)
    3. Check communication channel in runtime workbench. There will be an error saying which is missing at what path.
    4. Create the path mentioned and place the file at that path.
    5. Repeat steps 2,3,4 for all the files.
    When you are done with this, you will get a proper validation error in case XML file is not correct. And remember to generate XSD from message type and not data type.
    Regards,
    Vikas
    Edited by: Vikas Aggarwal on Sep 2, 2009 8:45 PM
    Edited by: Vikas Aggarwal on Sep 2, 2009 8:48 PM

  • How to develope application with multiple schema

    Hi,
    In my application, there is 3 schema, forms are from different schema, but the database is one. How should I manage it, When i open the form with different schema I am not getting the expected result,
    I am using Oracle 10g Forms & Database
    Thanks in advance
    Rizly

    hi,
    what database-user is the user connected with, when executing the forms ? Is it one of the three schemaowners or has each logical user his own database-user?
    About your db-objects:
    I would create 3 roles, one for each schema, and grant the needed privileges for one schema to the according role
    Example:
    CREATE ROLE RL_SCHEMA1;
    GRANT SELECT, INSERT, UPDATE, DELETE ON SCHEMA1.TABLE RO RL_SCHEMA1;
    ...Then you can grant the roles to the databaseuser you are connected with at runtime.
    If you use named users (each logical user has it's own database-user) then you assign each user only those roles he needs.

  • Oracle troubles with multiple schemas in same database

    We have several different users set up with individual schemas in the
    same Oracle database. We run into trouble when more than one user tries
    to use Kodo in their local schema. Things go fine for User A, but when
    the User B tries to run the schematool on their own Oracle schema, they
    get this nonsense:
    javax.jdo.JDOFatalDataStoreException: An error occurred while connecting
    to the data store.
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=SELECT
    DISTINCT JDO_SCHEMA_METADATAX.CLASSNAMEX FROM JDO_SCHEMA_METADATAX]
    ORA-00942: table or view does not exist
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.<init>(SchemaTool.java:99)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1114)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1083)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1073)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1064)
    If the User A drops all the tables from their schema, then things go
    fine for User B ... but then User A will have the same problem when they
    try to run the schematool.
    It is our suspicion that Kodo is actually selecting the metadata all of
    the tables in **everybody's** schemas, and thus erroneously thinking
    that jdo_schema_medatax already exists. It really ought to restrict
    itself to the schema it's actually connected to.
    If our theory is correct, it would explain why Kodo is so incredibly,
    horribly, painfully slow to connect to our Oracle database -- we have
    dozens of schemas in there, many of which have hundreds of tables.
    Is 2.3.0 addressing this problem?
    Paul

    Paul,
    Are you using the 'schema-name' system preference setting for each user?
    Oracle's mechanism for selecting database metadata requires that the
    appropriate schema name be explicitly when more than one schemas are used.
    See the database setup section of our documentation for more information.
    -Patrick
    On 7/3/02 3:50 PM, "Paul Cantrell" <[email protected]> wrote:
    We have several different users set up with individual schemas in the
    same Oracle database. We run into trouble when more than one user tries
    to use Kodo in their local schema. Things go fine for User A, but when
    the User B tries to run the schematool on their own Oracle schema, they
    get this nonsense:
    javax.jdo.JDOFatalDataStoreException: An error occurred while connecting
    to the data store.
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=SELECT
    DISTINCT JDO_SCHEMA_METADATAX.CLASSNAMEX FROM JDO_SCHEMA_METADATAX]
    ORA-00942: table or view does not exist
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.<init>(SchemaTool.java:99)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1114)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1083)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1073)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1064)
    If the User A drops all the tables from their schema, then things go
    fine for User B ... but then User A will have the same problem when they
    try to run the schematool.
    It is our suspicion that Kodo is actually selecting the metadata all of
    the tables in **everybody's** schemas, and thus erroneously thinking
    that jdo_schema_medatax already exists. It really ought to restrict
    itself to the schema it's actually connected to.
    If our theory is correct, it would explain why Kodo is so incredibly,
    horribly, painfully slow to connect to our Oracle database -- we have
    dozens of schemas in there, many of which have hundreds of tables.
    Is 2.3.0 addressing this problem?
    Paul
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • XSD validation with multiple namespaces

    Hi All,
    I'm trying to validate some XML using an XSD that contains multiple namespace schema descriptions, as such, the main XSD file must import an XSD for each namespace.
    The difficulty is that I cannot seem to find a way (in Oracle) to run a XSD validation using this (multi-XSD file) method.
    Has anyone out there tackled a similar problem?
    Cheers,
    Ben

    check out the class
    CL_XML_SCHEMA
    Regards
    Raja

  • Validating with a Schema

    I know this should not be difficult, but I cannot really find an easy answer to validating an XML document against a schema. I have an XML document that I can validate against a schema within Netbeans. I want to write some Java code that will validate the XML document against the schema at runtime before I start reading the data. Can someone provide me with a simple straightforward answer? Does the XML document have to have the "xsi:schemaLocation" or can I define that at code time?
    I am currently using the DocumentBuilderFactory, DocumentBuilder, and Document to load the XML into a DOM document so that I can read the data.
    Thanks

    http://forum.java.sun.com/thread.jsp?forum=34&thread=288059

  • JAXB / XML Project with Multiple Schemas

    So, I am wondering how I can accomplish the following:
    1) I am using Toplink 10.1.3.1.
    2) I have a project that deals with many varieties of XML files.
    3) Each XML file will have its own xsd.
    4) I want to be able to generate the JAXB objects for each file type into different packages.
    5) I want to be able to create a jaxb object based on the package name. Can I just add the different projects to the session.xml file? If so, how?
    I know that you can do this with other JAXB implementations. Just curious what the deal is with Toplink? Seems that I can only have one schema per project. I then can only have one session.xml file. Using the JAXBConext to create a new instance, I am not allowed to specify an additional session.xml file.
    Thoughts? Opinions? Suggestions!!!
    Thanks,
    BradW

    Ok. Looks like I need to create a session.xml file that has multiple sessions based on the package name. Yeah!
    Now everyone knows... :)
    BradW

  • How to use one application with multiple schema without copying application?

    Hi,
    Previously we are using oracle forms and by that we can manage by using a set of folders containing fmx and use different schema/database for different customers. so the source code comes from one individual file but used for different database users.
    is it possible to do this without copying application in apex?
    reason is because if applications are copied for each customer, and in a situation where a page has a bug, the developer must correct multiple pages across all the application. This would not be appropriate to manage.
    could this be done in apex? or is there any other approach?

    Hi,
    An application is tied to its parsing schema, so it is not possible to have one code base which you can then point to different schemas. I have seen some threads relating to dynamically setting the parsing schema, but I don't think it has worked to well, and would not be a supported configuration by Oracle.
    The normal way to do this is to have one schema and for each entity where it is logical you will have an extra key which is the customer id. I mention where it is logical, because not every entity needs its own data defined by customer. Some data will be common across all customers, such as lookup data and some entities will comprise child entities by which the data separation will be implied by the parent. You can then use Oracle's Virtual Private Database feature to implement a seperate view of the data through the application, based most likely on the customer who is logged on.
    Hope this helps.
    Regards
    Andre

  • TextField validation with multiple options

    Hi.
    I am trying to create a textField widget that can have a
    number of possible correct answers. Can anyone let me know if this
    is possible. I have successfully created a textField that validates
    one answer with the use of Type Custom, but i am unsure how to have
    multiple correct answers for one textField.
    Thanks
    Barry.

    Hi Barry,
    to validate more values inside the textfield widget, you have
    to create your custom regular expression that fits with what values
    you accept for that input field.
    So your contructor should look similar with this:
    var sprytextfield1 = new
    Spry.Widget.ValidationTextField("sprytextfield1", "custom",
    {regExpFilter:/test1|test2|test3/, useCharacterMasking:true});
    This regexp is translated: the textfiled will accept only
    test1, test2, test3 values.
    You can also have this behavior if you create a custom
    function having a set of switch values:
    switch(){
    case1: ...
    case2:...
    default:false
    and you call this function as option in the widget
    constructor.
    Diana

  • Queries with multiple schemas in XML Publiser Enterprise

    We are looking at XML Publisher Enterprise for a non-Oracle application. We have several reports that use queries where we join tables from more than one schema. Will this be a problem with XML Publisher Enterprise? I have not found any documentation on this.

    Hi, you can FOR XML PATH for a finer degree of control over your XML.  Use the @ symbol to create attributes.  Here's a simple example:
    DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
    INSERT INTO @t VALUES
    ( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
    SELECT
    [address] AS "Address",
    city AS City,
    [floor] AS "Location/@Floor",
    suite AS "Location/@Suite",
    doorType AS "Location/@DoorType"
    FROM @t
    FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS;

  • Validation with XML Schema

    With the Xerces parser, you can validate an XML document against an XML schema. But what I wanted to do is something different.
    I want to validate data before they are put in XML. Like this:
    1) I have a set of class/classes that act as helper class(es) that creates an XML document that conforms to a specific XML Schema. The class(es) would have, of course, setXXXX() methods in it. The XML document is not created until someone call create().
    2) With each setXXXXX() method call, I know that the setXXXXX() would eventually map to a specific attribute in a specific element in the XML document that will be created.
    3) Therefore, I would want to be able to throw an Exception if a developer call setXXXX() with the correct Java data type, but with an incorrect value based on the XML Schema .... instead of throwing the error when the XML is being serialized / created by the XML parser in the create() method.
    Any ideas on how to do this?
    Regards,
    John

    The only way that I could think to do this is to have
    a lot of XSDs, one for each element essentially.
    In this case you'd have to build your mini-XMLs, parse
    each one with an XSD, and then report the error.
    Why do you want to do it this way? Is it because you
    want to know exactly which one gave an error without
    having to parse through the sometimes cryptic error
    messages?
    PaulYes. that's one.
    The other is, if you think of a form that is being filled by a user, you would want the user to be informed of which field in the form has the incorrect value, instead of just showing a generic message .... after which the user may get fed up and do his business elsewhere. Not good for business, isn't it?

  • XML: VALIDATING WITH XML SCHEMA: SAXNotRecognizedException

    Hi,
    1. From The Java� Web Services Tutorial for SAX
    If the parser is not 1.2 compliant, and therefore does not support XML Schema,it could throw a SAXNotRecognizedException .
    SAXParser saxParser =factory.newSAXParser();
    try {
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE,W3C_XML_SCHEMA);
    catch (SAXNotRecognizedException x){
    //Happens if the parser does not support JAXP 1.2
    2. How do we know if the parser is not 1.2 compliant or not? 1M Thanks.

    If you have an older xerces.jar in your class path your parser will not be JAXP 1.2 compliant.
    Try replacing xerces.jar with both xercesImpl.jar and xml-apis.jar.

Maybe you are looking for

  • Why does Pages 09 hang for 1min30sec? The spinning ball, etc...

    I am using Pages 09 version 4.3 (not the iWork package, just Pages 09) Operating system 10.8.3 with 4 Gb memory on an iMac from around 2009 (Intel core 2 duo) I had been using Quark Xpress for a couple decades and wanted to save a book I did in Pages

  • Latest firmware update and startup problems

    Hi I have been reading all about this so-called firmware and its importance in keeping updated on my new macbook pro. Therefore I have been diligently trying to keep it updated over my dial-up connection. I installed the latest firmware as my automat

  • Buttons don't work

    I am working on a small application. My main frame is a public class that defines two buttons in its constructor one for input and the other for feedback. The input screen and the feedback screens are defined as inner listener classes of the main cla

  • Does anyone get this to work on WinXP?

    I found a bunch of threads on this topic, but none of the recommended fixes have worked for me. Here's my setup: The Mac is a Dual 867 G4 (MDD), running OS 10.4.5. Uses Airport to connect wirelessly to a Linksys 4-port WAP. The printer is an HP Laser

  • Help with color display

    I bought a new IPod and it WAS working fine. Then all of the sudden the color screen won't come to life anymore. I can see images, but they are dim, like the unit is in powersave mode. I've checked my setting and reset to no avail. Help please.