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

Similar Messages

  • 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

  • SAML 2.0 required attributes

    Hello,
    I have configured WebLogic (10.3.5) as a SAML 2.0 Service Provider, and I am now trying to authenticate a user with SAML 2.0.
    The question is, what is the WebLogic required attributes list?
    Whatever the attributes in the claim I send to WebLogic, I still have the same error message :
    +[2011-10-17T21:23:22.466+02:00] [WC_Spaces] [WARNING] [] [oracle.webcenter.webcenterapp.internal.view.shell.handler] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: anonymous] [ecid: 51ed235acd286cea:-41dd2e20:13311f13d78:-8000-0000000000000809,0] [APP: webcenter#11.1.1.4.0] oracle.webcenter.webcenterapp.model.security.WebCenterAuthenticationException: Only authenticated users can perform the requested operation+
    Is there any documentation indicating the list of the mandatory SAML claims' attributes name and value content (givenName, NameID, userID, Groups,...) ? I have not found anything.
    Best regards.

    This has been filed as a bug in version 10.1.4.0.1 and fixed in 11.1.1.0.0. The bug number is:
    5725307 - SAML 2.0 CONFIG SHOULD ALLOW CUSTOM NAMEID FORMAT URI
    Have a look at the details.
    -shetty2k

  • To download an App the 3 security questions are required. But at the end, apple is not able to complete the task and gives an error message. No more downloads are possible. What can I do?

    to download an App the 3 security questions are required. But at the end, apple is not able to complete the task and gives an error message. No more downloads are possible. What can I do?

    Very Important, how much Free Space is on your Hard Drive first of all? Click on the Macintosh HD on the Desktop, then do a Get Info on it.
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    Do they launch OK while in Safe Mode?

  • 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

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

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

  • Custom Tag is missing required attribute property

    Hello,
    Here is my struts config file source;
    <global-forwards>
              <forward name="mainpage" path="/index.jsp">
              </forward>
              <forward name="CustomerDetailsForward" path="/GoToCustomerPage.do">
              </forward>
         </global-forwards>
         <!-- Action Mappings -->
         <action-mappings>
              <action path="/SubmitCustomerForm" type="action.SubmitCustomerForm" name="CustomerForm" scope="request" validate="true" input="/CustomerDetails.jsp">
                   <forward name="success" path="/Success.jsp">
                   </forward>
                   <forward name="failure" path="/Failure.jsp">
                   </forward>
              </action>
              <action path="/GoToCustomerPage" type="org.apache.struts.actions.ForwardAction" parameter="/CustomerDetails.jsp">
              </action>
         </action-mappings>
    And my index.jsp source;
    <html:html>
    <head>
    <html:base/>
    </head>
    <body>
    <html:button></html:button>
    <html:link forward="CustomerDetailsForward">Go To Customer Form </html:link>
    </body>
    </html:html>
    And here is the error;
    Error Message:JSPG0227E: Exception caught while translating /index.jsp: /index.jsp(13,1) --> JSPG0006E: Custom Tag is missing required attribute property
    Root Cause:com.ibm.ws.jsp.translator.JspTranslationException: JSPG0227E: Exception caught while translating /index.jsp: /index.jsp(13,1) --> JSPG0006E: Custom Tag is missing required attribute property     at com.ibm.ws.jsp.translator.visitor.validator.ValidateVisitor.visitCustomTagStart(ValidateVisitor.java:304)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:267)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:268)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:139)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.visit(JspVisitor.java:121)     at com.ibm.ws.jsp.translator.JspTranslator.processVisitors(JspTranslator.java:121)     at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJsp(JspTranslatorUtil.java:181)     at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJspAndCompile(JspTranslatorUtil.java:83)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:349)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper._checkForTranslation(AbstractJSPExtensionServletWrapper.java:317)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.checkForTranslation(AbstractJSPExtensionServletWrapper.java:226)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:131)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)     at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:472)     at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)     at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)     at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)

    volkov wrote:
    Error Message:JSPG0227E: Exception caught while translating /index.jsp: /index.jsp(13,1) --> JSPG0006E: Custom Tag is missing required attribute propertyWhich is line 13 then? And check the syntax for that tag.

  • How to override the default "required" attribute for the UIComponent?

    Hi, consider the following markup: <h:inputText id="txt_firstName" value="#{myBean.firstName}" required="true"/>
    if I leave this field empty and hit the submit button, the required validator will fire an error msg. If however, I leave an empty space in the text box and hit submit button, it will go through no problem.
    I'd like to override the required attribute, so it will trim the spaces first before decide if it really is empty:
    //whatever the name of the method i'm overriding....
    String value = (String)value;
    if(value==null)throw new ValidatorException(whateverDefinedInTheBundle);
    value = value.trim();
    if(value.length==0)throw new ValidatorException(whateverDefinedInTheBundle);
    How can I go about doing that?
    Thank you.

    Did you already try
               <af:treeTable value="#{bindings.DashProjectPhasesDev.treeModel}"
                                  var="node"
                                  selectionListener="#{bindings.DashProjectPhasesDev.treeModel.makeCurrent}"
                                  rowSelection="none" rowBandingInterval="0"
                             inlineStyle="width:810px; height:1100px;"> Check the last line with inlineStyle...
    Julian

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

  • [svn:fx-trunk] 7553: Fix the default value of the [skinPart] "required" attribute for asdoc.

    Revision: 7553
    Author:   [email protected]
    Date:     2009-06-04 09:32:51 -0700 (Thu, 04 Jun 2009)
    Log Message:
    Fix the default value of the "required" attribute for asdoc.
    Bugs: SDK-21488
    QE Notes: None.
    Doc Notes: None.
    tests: checkintests
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21488
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java

    ${ui:cond( uix.current.isNewRow, 'true', ui:cond( bindings.AddProjectNutsoverleg.value == 1, 'true', 'false' ) ) } notice the '.value' it could also be '.inputValue'.
    If not there is also an option to make sure that when the checkbox is empty a value is returned anyways this work like this:
      protected void processUpdateModel( DataActionContext ctx )
        //First look for the request parameter
        Object cbInRequest = ctx.getHttpServletRequest().getParameter( "nameofthecheckbox" );
        //We only need to do anything if it was not submitted
        if( cbInRequest == null )
          // Get hold of the Form Bean containing the record
          BindingContainerActionForm updateForm = (BindingContainerActionForm) ctx.getActionForm();
          //Get the binding for our particular column
          JUCtrlAttrsBinding checkBoxBinding = (JUCtrlAttrsBinding)updateForm.get( "nameofthecheckbox" );
          //Reset that explicitly to the *unchecked* value
          checkBoxBinding.setAttribute( 0, new oracle.jbo.domain.Number( 0 ) );
        super.processUpdateModel( ctx );
      }Maybe this helps.

  • Required attribute and cancel action

    How am I supposed to handle the following case (simplified):
    <h:inputText required="true" value="#{somebean.property}" />
    <h:messages />
    <h:commandButton type="submit" value="Cancel" action="cancel" />
    The "cancel" action is configured in faces-config.xml to navigate to another page and works like expected without the "required" attribute.
    But if I include the "required" attribute I get a validation error message and the navigation to the wanted page does not take place.
    Michael

    For action like "cancel" I would recommend to use attribute "immediate"
    <h:commandButton action="cancel" value="Cancel" immediate="true"/>Vladimir

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

  • Problem in runing xalan( says: stylesheet requires attribute: version)

    I have test.xml & test.xsl (listed bellow).When i go to transform it
    by using xalan with the command line as:
    E:\xmlExamples>java org.apache.xalan.xslt.Process -IN test.xml -XSL test.xsl -OUT test.html
    I get the error:
    file:///E:/xmlExamples/stocks.xsl; Line 2; Column 71;
    file:///E:/xmlExamples/stocks.xsl; Line 2; Column 71; XSLT Error (javax.xml.transform.TransformerCon
    figurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerExcep
    tion: stylesheet requires attribute: version
    Please help me out..
    //test.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet href="e:\xmlExamples\test.xsl" type="text/xsl">
    <company>
              <employee><name>X</name></employee>
              <employee><name>Y</name></employee>
              <employee><name>Z</name></employee>
    </company>
    //test.xsl
    <?xml version="1.0" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" version="1.0">
    <xsl:template match="/">
    <html>
    <head>
    <title>emp</title>
    </head>
    <body bgcolor="#ffffcc" text="#0000ff">
    <xsl:apply-templates/>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="company">
    <B>COMPANY</B>
    <xsl:for-each select="emloyee">
         <i><xsl:value-of select="name"/></i>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>

    try this xsl:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" encoding="utf-8"/>
         <xsl:template match="/">
              <html>
                   <head>
                        <title>emp</title>
                   </head>
                   <body bgcolor="#ffffcc" text="#0000ff">
                        <xsl:apply-templates/>
                   </body>
              </html>
         </xsl:template>
         <xsl:template match="company">
              <B>COMPANY</B>
              <xsl:for-each select="emloyee">
                   <i>
                        <xsl:value-of select="name"/>
                   </i>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>

Maybe you are looking for

  • Non-Global Zones - how can I tell what the Global Zone is

    Hi, I have a host that I know is a non-global zone (ngz). I can ssh to the ngz as root or a non-privileged user. But once there how do I know what the host name for the global zone is? I could probably run a script from all global zones to report all

  • How to sync changes in user-created distributions lists when used by multiple Outlook users

    Hi all, Thanks for looking at my post. We are using Outlook exchange and Outlook 2010. I have created a distribution list that is comprised of 20 members (students) with email addresses outside our organisation. I have sent this list to others in my

  • NWP1 Current date

    Hi experts, Basis has recently change the time in the system to terminate daylight savings, after that, the date in transaction NWP1 that is setting in variant attributes as current date, instead of current day the system shows the date of a day befo

  • Notiifcation Long text not grey out

    Guru I have seen the Notification Long text screen grey out once the user saves and log out. When next user enters he wil not b able to chnage the contents entered by previous user. This is not actually hapening in my case...The screen and info enter

  • Time of reading block from disk

    Hello ! Before block will be read into buffer cashe these processes takes place : 1) searching of the current version of block , 2) searching of free space Does "db file sequential(scattered) read" includes this wait events ? Thanks and regards, Pave