Validating different sets of required attributes in an XML schema.

My requirement is to validate an xml with two different validation strategies. In strategy 1, the xml is required to have several instances of an element with certain required attributes. In strategy 2, the xml is required to have several instances of the same element with different required attributes. So, the idea is that there are two different sets of the same element with different set of required attributes for each set. Is there a way to validate this with using only one xsd. My only solution so far is to use two different xsd files to validate. Thank you.

Define an xsd:choice for the 2 elements.

Similar Messages

  • Help how to create full set of nested table with given xml schema?

    Hi everyone, I am new to oracle and programming language. Recently I was asked to create nested table with given a complex xml schema. I knew that after the registration of xsd file, oracle will generate few tables( including nested table) and types for the users. But it seems to be not complete set of tables. Can anyone please help me with the problem. Really thanks a lot on the help given. I would like to give extra explanation if what I have given above is not clear enough. Thanks

    How about posting the XML Schema, the code you used to register it, the database version you are using and the list of nested tables that were generated...

  • Different set up required once new company code is created

    Hi Experts
    Can you pls let me know different settings required once new company code is created in the system
    thanks

    Hi,
    After company code, you need  Create of MM organisation structure
    Creation of Purchase organisation,Plant,Storage location, Purchasing Group & assignment of plant to company code and assignment of plant to purchase organisation)
    Check the link for for details:
    http://www.docstoc.com/docs/11125515/SAP-MM-Customization-Document
    Also you need to setting in OMSY & other vital auto account determination(OMSK,OMWN,OMWD,OMWB,OMWM)
    OMSY and OB52
    Re: Account determination -MM
    For more details check the link
    basic mm settings
    Regards,
    Biju K

  • Using value binding expressions to set 'required' attribute

    I am trying to use a value binding expression to determine whether the value of various input control's is required or not according to where they are used and not having much luck. I wonder if anyone can shed some light on this...
    The following expression works: <h:inputText id="name" required="#{true}"/> whereas <c:set var="required" value="true" scope="request"/>
    <h:inputText id="name" required="#{required}"/> does not, even though the expression evaluates to true! I have tried numerous variations (requestScope.required, required == true, required ? true : false, etc.) to no avail. Interestingly, #{1 == 1} or binding to a backing bean method works, but as soon as you add a request variable it breaks.
    Am I doing something wrong, is this something that JSF doesn't allow, or just a bug in the RI? Note that I don't want to vary this flag between multiple submissions of the same form, I am just trying to reuse the same JSP include to generate form controls for required and optional data on different forms to avoid a whole lot of cutting any pasting.
    Any pointers gratefully received.
    -- Keith Wilson

    I had something like this happen, and here's what I concluded the problem was. Perhaps your problem is similar.
    In the first non-working example you show a request-scope variable being set in the JSP page, and then use that to set the "required" attribute. But consider what happens when you submit the form. There is no longer any request-scope variable set because we have a new request and we don't go through the JSP page! (Not before validation is checked, anyhow).
    So basically I concluded that the variable had to be in (say) session scope for it to work as you would like.

  • How to manage with the required attribute with the h:selectOneMenu ?

    dear all,
    I have form with some drop down list.
    All have a default value to invite user to select a criteria.
    By submitting my form I have an actionListener method wich check validity of the fields.
    I would like to display a message near the <h:selectOneMenu> to point the attention of the user about selection must be done.
    I try following:
    <h:selectOneMenu  id="idContractNature" required="#{applicationController.requiredContract}" partialSubmit="true" valueChangeListener="#{applicationController.valueChangeContractType}" value="#{applicationBackingInfo.opportunityInfo.contractNatureId}">                          
                   <f:selectItems    id="SlctContractNatureItms" value="#{applicationDefaultDataController.contractNatures}"/>          
    </h:selectOneMenu>
    <h:message for="idContractNature"></h:message>I set the required attribute to true in the actionListener method if the contract id is equal to 0 (my default value)
    But it doesn't work.
    How can i check the validity of the drop down list?
    I set the required attribute to true when the

    thanks but can set null for the value of the default value due to:
    Can't set property 'contractNatureId' of type 'int' on class '....' to value 'null'.
    because it's a list SelectItem with int / string

  • What are the different kind of parameter/attributes we can set in  XI ?

    Hi  Experts
        Yesterday i have attended an interview ....one question was
        1) What are the different knid of parameters we can set in XI ? Have done ?
            what and all the cases we will set the parameters/Attributes?
    and one more was
       2) How will you do Stress testing in XI ?
    Awaitng for responses
    Adv thax and regards
    Kiran lvs

    Hi,
    1) What are the different knid of parameters we can set in XI ? Have done ?
    what and all the cases we will set the parameters/Attributes?
    -First you should ask in which stage or where do you want to configure parameters ,i mean  Whatever parameters we can set in XI all comes under this question like all sort of Adapters,each of adapter can have its own set of configuration , configuration parameters,XI admin config parameters.. etc..
    and one more was
    2) How will you do Stress testing in XI ?
    In general stress tesing will be done by testing team
    Stress testing by way of sending more messages and performance also
    see the below links
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3a67c790-0201-0010-89aa-d27d97dd1374
    Rules of thumb on size of messagetypes in XI
    /people/sravya.talanki2/blog/2006/02/28/simulating-xi-messages-proto
    Measure Performance
    Regards
    Chilla..

  • In Apple Configurator, can I set up different sets of iPads with different apps loaded? Or will all iPads synced with Configurator be required to have the same build?

    In Apple Configurator, can I set up different sets of iPads with different apps loaded? Or will all iPads synced with Configurator be required to have the same build?

    Hi jshira86,
    You can definitely have different sets of iPads with different apps loaded. When you "supervise" your iPads, you will see that on the left side of the Configurator window there is a "+" sign in the lower left corner. Click it to create a new device group. With this new device group you can choose what apps and configuration profiles you want to install on that group of iPads. Create as many groups as you want to customize the apps and profiles you want on them.
    Hope this answers your question!
    ~Joe

  • Bulk import error - Missing required attribute ‘fullname’

    Folks,
    I am having trouble trying to bulk import some users.
    I have the following file for import (cut down from what I really want to import):
    command,user,waveset.resources,password.password,password.confirmpassword,global.firstname,global.lastname,global.fullname
    Create,”user1”,”myLDAPresourcename”,”passwd”,”passwd”,”myfirstname1”,”mysurname1”,” myfirstname1 mysurname1”This works using “Accounts->Launch Bulk Actions” with Action set to “From Action List” and everything else on that page left at the default value. The correct data appears in IDM and the LDAP resource.
    Now if I try to import the following file, in which the user does not have a first name, I get in to trouble:
    command,user,waveset.resources,password.password,password.confirmpassword,global.firstname,global.lastname,global.fullname
    Create,”user2”,”myldapresourcename”,”passwd”,”passwd”,””,”mysurname2”,”mysurname2”
    The error message is:
    com.waveset.Util.WaveSetException: An error occurred adding user ‘uid=user2,…..’ to resource “myLDAPresourcename”.
    com.waveset.util.WavesetException:  Missing required attribute ‘fullname’Clearly the import file contains a column for ‘fullname’ (column 8) and a value for ‘fullname’ in the only row of data “mysurname2”. As far as I am concerned it is perfectly valid for a user not to have a ‘firstname’; but they must have a ‘fullname’.
    I have tried using an import file without a value for ‘fullname’, but with a ‘firstname’ and ‘lastname’ like this
    command,user,waveset.resources,password.password,password.confirmpassword,global.firstname,global.lastname,global.fullname
    Create,”user3”,”myLDAPresourcename”,”passwd”,”passwd”,”myfirstname3”,”mysurname3”,””This works. The correct data appears in IDM and the LDAP resource and IDM has generated a ‘fullname’ value of “{Firstname} {Surname}”. Trying to leave out the ‘firstname’ and the ‘fullname’ gives the same error as above.
    The configuration of my resource (in summary) is
    objectclasses:
         top
         person
         inetOrgPerson
    Account Attributes:
         accounted     -> uid               [required]
         password     -> userPassword
         firstname     -> givenname
         lastname     -> sn               [required]
         objectClass     -> objectClass
         fullname     -> cn               [required]
    As an experiment I have tried reconfiguring the resource so that ‘fullname’ is not marked as required.
    Importing user1 and user3 still works and still creates the correct data in IDM and the LDAP resource.
    Importing user2 now gives a different error:
    com.waveset.Util.WaveSetException: An error occurred adding user ‘uid=user2,…..’ to resource “myLDAPresourcename”.
    javax.naming.directory.SchemaViolationException: [LDAP: error code 65 – Object Class Violation]I don’t understand why, during the import of a user without a ‘firstname’ IDM will not generate a ‘fullname’ or use the supplied ‘fullname’.
    Can anyone help?
    Regards,
    Gavin

    After further testing it turned out that I couldn't create a user without a firstname from the IDM GUI and this in turn was because of the way fullname was generated by the user form.
    I've got the user form changed and now user creation (from the GUI and via bulk import) is working as hoped.

  • Problem with the "required" attribute in input_text (in 1.0 beta)

    Suppose you wanted to display a more meaningfull message instead of the default "Validation Error: Value is required", e.g. "Please enter your e-mail address". Looks like the only way to do this is to write a custom validator. However, if required="true" in the input_text, you will get the default message, if you don't set "required", your custom validator is not called at all.
    This is something that needs to be addressed, because it will be very common to want to have meaningfull error messages (I can't imagine somebody will approve a commercial application which will display messages like "Validation Error: Value is required").
    As a workaround, I tried setting an error message in the action handler, but I can't seem to get the component from within the bean code. In the action method I have:
    FacesContext context = FacesContext.getCurrentInstance();
    UIInput component = (UIInput) context.getViewRoot().findComponent("testInput");where testInput is the id of the input_text - findComponent() returns null.
    P.S. Btw, I noticed that now in 1.0 the ids look like this id0:testInput which is a really bad choice if you have to write any JavaScript handler, e.g. onClick(), since id0:testInput is not a valid JavaScript variable name. You can still find it by going through all the document.forms[0].elements[n].name and set it up that way, but it's a hassle.

    Thanks,
    findComponent("formName:inputName")worked fine.
    But still, I think that if you have a custom validator
    it should be called regardless of whether there is
    something in the input or not (or maybe bypass the
    default validation if "required" attribute is set, but
    there is a custom validator), because that's the only
    way you can change the default "Value required"
    message using a validator. If you have to check it in
    the action method, you might as well do the whole
    validation there, which makes validators pointless.The expert group considered this decision carefully, and concluded that the current behavior was the best -- if there is no input data, skip any specified validations -- because of the likelihood for things like null pointer exceptons in validators that are not prepared for this scenario.
    One approach to dealing with this if you would prefer different behavior for your own components is to subclass UIInput and override the validate() method to do something different.
    Craig

  • Required attribute does not work with any data type other than String

    sir,
    I am a new to JSF. My problem is that I have used an integer type data in my page which is taking its value from a bean.But in jsf code I have used the required attribute for the <h:inputText> but if I leave the text box empty it is not showing the validation error which it show show. Another problem is that the page is also not navigating to the next page.
    The code is
    <h:inputText value="#{UserBean.age}" required="true"/>
    where age is of integer type

    Well. The fact that it is not jumping to the next view is "works as required". The assumption is, that once you say a field is required, it could be that the application CANNOT function without that value. Therefor the initial view is redisplayed until all required values are entered.
    IF you need a different behaviour, then the OptionalValidator-package which is currently in development state, is the way to go. It allows to specify different validating strategies for different links on a view (no validation, soft validation (== allow to go on, but produce warning messages), hard validation (== the way JSF works right now)). The problem is that with JSF 1.1 it is quite difficult to implement this behaviour. For simple validators (no parameters) it is working, but for complex validators (requiring parameters) not yet. For more info: http://wiki.apache.org/myfaces/OptionalValidationFramework
    No comment on the String-only behaviour, as I have not yet tested/observed that problem...
    hth
    Alexander

  • How to change the required attribute of a field

    Hi,
    I'm using jdeveloper 10g, uix and jHeadstart to generate my application.
    In my form, I have some attributes that are required and if I change a checkbox, some of these fields that was required, must now be not required.
    How can I do this?
    Any ideas?
    Thanks!
    Martin

    Sounds like a custom validation, but you could also use a partial rendering and EL to achieve this. Lets say you could set the 'required' property of the field based on the EL expression calculating the value in the other field

  • Question on Required Attribute Behavior

    I am having difficulty understanding what the correct behavior of a "required attribute" should be. Im using 9ifs.
    Using the Java API, I created a new content type derived from DOCUMENT, named it CLASSIFIED_DOCUMENT, associated a new file extension "cla" with it, and created a new required attribute called "Security_Level". From ifsmgr, I can see the new type and see that Security_Level
    is a required attribute. When I upload a file with the "cla" extension from the Viewer, it is entered into the database and correctly associated with the CLASSIFIED_DOCUMENT content type. So far so good.
    However, I have not supplied a value for the required attribute, and nothing complains that the Security_Level field is null. It seems to me that IFS should not allow the item to be entered into the database without this required attribute having a value, or perhaps a dialog box should pop up which forces one to enter values for required attributes before the instance of CLASSIFIED_DOCUMENT is entered into the database. Lacking that, an invalid instance is silently slipped into the DB...
    So on to my specific questions:
    How does one enter required attribute data when uploading using the Viewer?
    Shouldn't IFS be complaining when a CLASSIFIED_DOCUMENT is uploaded without Security_Level being set?
    Will required attribute constraints also be "ignored" when performing a programmatic file creation
    (similar to the "Hello World" example) of an instance of CLASSIFIED_DOCUMENT?
    Do I need to do other things when creating a required attribute using Java that will actually cause the attribute to be, well, REQUIRED?
    Is there a RTFM answer to this, and if so, can some kind soul please point me to the correct FM to R? I have the Developer's Guide and the IFS javadocs. The Guide has good examples but is woefully inadequate if you want to do something different from the examples. The jovadocs are of course good reference material but have nothing in the way of "application notes". I have looked at the
    example code and it suffers from the same shortfall as the Guide: if you want to do something different from what is in the example code, you're on your own!
    Is there a document that I should be reading but have missed?
    Thank you,
    Jeff Rininger

    Hi Jeff -
    Thanks for the feedback.
    REQUIRED attributes are exactly what you describe: they are a way to ensure an attribute has a non-null value when a new object is created or when that attribute is updated in an existing object.
    From an API perspective, in creating a new object, that value can be supplied in three ways: explicitly by setting an attribute in the LibraryObjectDefinition, through a VALUEDEFAULT on the attribute, or (advanced topic) through custom server extensibility code.
    One thing to keep in mind: REQUIRED checks are (intentionally) not performed in administration mode. You might want to try creating an object as a non-admin user. That should cause the check to be performed.
    David Pitfield
    Oracle

  • Creation of Service Product with Set Type and Attribute

    Dear All,
    Please guide me with proper step by step process,
    How to create the product with the set type and attribute for service industry in sap crm 7.0
    Regards,

    Hi Nitin,
    Before creating the Service type of product, you have to define the Base category for Service type product. Generally the category for service will be created under the R3 hierarchy R3PRODSTYPE. You can create this category using the TCode:
    COMM_HIERARCHY. Here you have to select the product type as Service and have to assign the set types to the category.
    You can create a service product using the transaction : COMMPR01 -> Click on Service ICON -> Select the Category for Service Type. Then fill in the details for Service Product description, Service ID(Based on number range settings for products), Language.
    Also fill other details like Base Unit of measure, Pricing condition for different sales areas for the service product.
    Since you are using CRM7.0, you can do all these activities using a POWER USER role.
    For more information about Set types and hierarchies please refer the following help link:
    http://help.sap.com/saphelp_crm70/helpdata/EN/46/57672501a208e7e10000000a114a6b/frameset.htm
    Hope this helps!
    Regards,
    Chethan

  • Automatic Generation of classes with required attribute names

    Hi ,
    I am new to XML technologies ...I am having a problem in deciding whether I
    should use JAXB or Castor for data binding.
    The problem is the attributes I am to use are named differently as that found in
    the DTD.I have creted my own classes using the required attribute names and the
    n mapped them using the Castor mapping with the attributes.
    I was wondering how should I achieve --"automatic generation of classes" with th
    e specified attribute names?
    I understand that JAXB can be used to automatically generate classes ,but this
    uses the same default names as that of the XML file ..is there a way of forcing
    JAXB to generate classes that use my name attributes rather than that of the XM
    L dtd
    If I use Castor ..is there a way to do the same.Generate Classes with the specif
    id attributes

    Hi ,
    I am new to XML technologies ...I am having a problem in deciding whether I
    should use JAXB or Castor for data binding.
    The problem is the attributes I am to use are named differently as that found in
    the DTD.I have creted my own classes using the required attribute names and the
    n mapped them using the Castor mapping with the attributes.
    I was wondering how should I achieve --"automatic generation of classes" with th
    e specified attribute names?
    I understand that JAXB can be used to automatically generate classes ,but this
    uses the same default names as that of the XML file ..is there a way of forcing
    JAXB to generate classes that use my name attributes rather than that of the XM
    L dtd
    If I use Castor ..is there a way to do the same.Generate Classes with the specif
    id attributes

  • Problem with "required" attribute in inputBox

    Hi ,
    I have a requirement where a input field needs to be populated using lookup.
    I am using commandButton to populate the input field.Since I dont want user to type anything in this input Field , I have made this field readOnly.
    This is a mandatory field so I have put required attribute true.But on the click of submit button this validation does not trigger.If I make remove readOnly attribute or make it false, the validation triggers.Here is the snippet for this part.
    <afh:rowLayout>
    <afh:cellFormat halign="right" >
    <af:commandButton id="lookupFrom_buttonId" text="From Mfg:"
    action="dialog:company.selectBox"
    immediate="true" windowWidth="390" windowHeight="550"
    launchListener="#{mfgReassignBean.addParameter}"
    returnListener="#{mfgReassignBean.returnFromMfr}"
    partialSubmit="true" useWindow="true"
    >
    </af:commandButton>
    </afh:cellFormat>
    <af:inputText
    partialTriggers="lookupFrom_buttonId"
    readOnly="true"
    required="true"
    binding="#{mfgReassignBean.fromDeveloperInput}"
    value="#{mfgReassignBean.assignmentRule.fromMfgName}"
    />
    </afh:rowLayout>
    has anybody faced such situation...any suggestions ?
    Thanks!!

    disabled and readonly fields are discarded from the JSF stack and thus not validated! Options are: make readonly field not readonly on form submit or copy readonly field to hidden field (both involve client side javascript)

Maybe you are looking for

  • Display three Values in Pie charts

    Hi All, I want to display three Values in Pie Chart(%, Value and one more field). Please suggest me any solution for this. For Eg Pie chart should display value lie this :- Nokia, 25,025, 38.52% (It consists of three differet values) Thanks,

  • Will a library vault created in 3.5.1, open in 3.6.

    I'm considering backing up my Aperture Library to a vault on 3.5.1, before upgrading to 3.6, in the event of a worst case scenario.  Will a vault created in the earlier version, be able to open in 3.6.  I also have two libraries on on 3.5.1, so I'm g

  • Dynamic Filter not being refreshed

    I have a problem with a dynamic filter refreshing properly. In a 7.0 Bex Query,  I have a variable where I put in a Sales Rep.  Based on the Sales Rep entered ('Z_M1Y_SALESREP04' ), I have a user exit that reads that Sales Rep and goes and gets all t

  • Instant  Collabortaion Pack & Netscape 7

    I am testing iCP, however when Netscape 6 or 7 clients try to load the iIM java plugin, it fails with the following message being displayed in the Java Console. Amazingly it works with IE6.0 - go figure. Also if I use Java Web Start with the 1.4 JRE,

  • Name-service-cache (nscd) and LDAP

    We are running Solaris 10u6 with the latest patches and have an issue with nscd. Periodically nscd will stop authenticating ssh sessions and requires restart to allow people to login. Our /etc/nsswitch.conf passwd line is "passwd: files ldap". Our LD