Validation on integers

Hi,
Can any one help me with a validation on an item that only accept integers. The Item is not a column in de table.
ekas

couldn't this be better achieved on a client side validation?
anyway
WITH t AS (SELECT '123E' txt FROM DUAL
           UNION ALL
           SELECT '123' FROM DUAL
           UNION ALL
           SELECT 'E123' FROM DUAL
           UNION ALL
           SELECT 'E' FROM DUAL
           UNION ALL
           SELECT '1.23' FROM DUAL)
SELECT txt,
       CASE REGEXP_REPLACE (txt, '[^[:digit:]]')
          WHEN txt THEN 'Integer'
          ELSE 'not Integer'
       END
          int_indicator
  FROM t
TXT,INT_INDICATOR
123E,not Integer
123,Integer
E123,not Integer
E,not Integer
1.23,not Integer

Similar Messages

  • How to add a "global" counter in uccx?

    Hi
    my customer has UCCX 8.5 Enhanced and he cannot afford an upgrade to Premium.
    They need to know how many times an option has been pressed by the users along the time. That option has only a "play prompt" step.
    I thought about using an XML file and, every time that option was pressed, I would increment the variable inside it.
    The problem is that, inside the script, I cannot increment the string extracted from the xml file. That is only valid for integers.
    Does anyone have an idea about how to get it?
    Thank you
    Marcos

    You would run into issues using an xml document within uccx is having multiple updates as you have overlapping contacts.  
    From what I have seen while testing at run time the xml document is loaded into memory for that script.  Let's say the value is 1. If the script is executed again before the other one has completed it will also read the value as 1.  The first script has completed and updates the document to a value of 3.  The second script is not aware that the value was updated to 3 and will rewrite the value based on the starting point of 1 which will result in the data being lost.
    What you might be able to do is use the Create URL Document step to Post data to another server and have it do all of the calculations on the back end. 
    DJ

  • REST API: Create Deployment throwing error BadRequest (The specified configuration settings for Settings are invalid. Verify that the service configuration file is a valid XML file, and that role instance counts are specified as positive integers.)

    Hi All,
    We are trying to access the Create Deployment method stated below
    http://msdn.microsoft.com/en-us/library/windowsazure/ee460813
    We have uploaded the Package in the blob and browsing the configuration file. We have checked trying to upload manually the package and config file in Azure portal and its working
    fine.
    Below is the code we have written for creating deployment where "AzureEcoystemCloudService" is our cloud service name where we want to deploy our package. I have also highlighted the XML creation
    part.
    byte[] bytes =
    new byte[fupldConfig.PostedFile.ContentLength + 1];
                fupldConfig.PostedFile.InputStream.Read(bytes, 0, bytes.Length);
    string a = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
    string base64ConfigurationFile = a.ToBase64();
    X509Certificate2 certificate =
    CertificateUtility.GetStoreCertificate(ConfigurationManager.AppSettings["thumbprint"].ToString());
    HostedService.CreateNewDeployment(certificate,
    ConfigurationManager.AppSettings["SubscriptionId"].ToString(),
    "2012-03-01", "AzureEcoystemCloudService", Infosys.AzureEcosystem.Entities.Enums.DeploymentSlot.staging,
    "AzureEcoystemDeployment",
    "http://shubhendustorage.blob.core.windows.net/shubhendustorage/Infosys.AzureEcoystem.Web.cspkg",
    "AzureEcoystemDeployment", base64ConfigurationFile,
    true, false);   
    <summary>
    /// </summary>
    /// <param name="certificate"></param>
    /// <param name="subscriptionId"></param>
    /// <param name="version"></param>
    /// <param name="serviceName"></param>
    /// <param name="deploymentSlot"></param>
    /// <param name="name"></param>
    /// <param name="packageUrl"></param>
    /// <param name="label"></param>
    /// <param name="base64Configuration"></param>
    /// <param name="startDeployment"></param>
    /// <param name="treatWarningsAsError"></param>
    public static
    void CreateNewDeployment(X509Certificate2 certificate,
    string subscriptionId,
    string version, string serviceName, Infosys.AzureEcosystem.Entities.Enums.DeploymentSlot deploymentSlot,
    string name, string packageUrl,
    string label, string base64Configuration,
    bool startDeployment, bool treatWarningsAsError)
    Uri uri = new
    Uri(String.Format(Constants.CreateDeploymentUrlTemplate, subscriptionId, serviceName, deploymentSlot.ToString()));
    XNamespace wa = Constants.xmlNamespace;
    XDocument requestBody =
    new XDocument();
    String base64ConfigurationFile = base64Configuration;
    String base64Label = label.ToBase64();
    XElement xName = new
    XElement(wa + "Name", name);
    XElement xPackageUrl =
    new XElement(wa +
    "PackageUrl", packageUrl);
    XElement xLabel = new
    XElement(wa + "Label", base64Label);
    XElement xConfiguration =
    new XElement(wa +
    "Configuration", base64ConfigurationFile);
    XElement xStartDeployment =
    new XElement(wa +
    "StartDeployment", startDeployment.ToString().ToLower());
    XElement xTreatWarningsAsError =
    new XElement(wa +
    "TreatWarningsAsError", treatWarningsAsError.ToString().ToLower());
    XElement createDeployment =
    new XElement(wa +
    "CreateDeployment");
                createDeployment.Add(xName);
                createDeployment.Add(xPackageUrl);
                createDeployment.Add(xLabel);
                createDeployment.Add(xConfiguration);
                createDeployment.Add(xStartDeployment);
                createDeployment.Add(xTreatWarningsAsError);
                requestBody.Add(createDeployment);
                requestBody.Declaration =
    new XDeclaration("1.0",
    "UTF-8", "no");
    XDocument responseBody;
    RestApiUtility.InvokeRequest(
                    uri, Infosys.AzureEcosystem.Entities.Enums.RequestMethod.POST.ToString(),
    HttpStatusCode.Accepted, requestBody, certificate, version,
    out responseBody);
    <summary>
    /// A helper function to invoke a Service Management REST API operation.
    /// Throws an ApplicationException on unexpected status code results.
    /// </summary>
    /// <param name="uri">The URI of the operation to invoke using a web request.</param>
    /// <param name="method">The method of the web request, GET, PUT, POST, or DELETE.</param>
    /// <param name="expectedCode">The expected status code.</param>
    /// <param name="requestBody">The XML body to send with the web request. Use null to send no request body.</param>
    /// <param name="responseBody">The XML body returned by the request, if any.</param>
    /// <returns>The requestId returned by the operation.</returns>
    public static
    string InvokeRequest(
    Uri uri,
    string method,
    HttpStatusCode expectedCode,
    XDocument requestBody,
    X509Certificate2 certificate,
    string version,
    out XDocument responseBody)
                responseBody =
    null;
    string requestId = String.Empty;
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
                request.Method = method;
                request.Headers.Add("x-ms-Version", version);
                request.ClientCertificates.Add(certificate);
                request.ContentType =
    "application/xml";
    if (requestBody != null)
    using (Stream requestStream = request.GetRequestStream())
    using (StreamWriter streamWriter =
    new StreamWriter(
                            requestStream, System.Text.UTF8Encoding.UTF8))
                            requestBody.Save(streamWriter,
    SaveOptions.DisableFormatting);
    HttpWebResponse response;
    HttpStatusCode statusCode =
    HttpStatusCode.Unused;
    try
    response = (HttpWebResponse)request.GetResponse();
    catch (WebException ex)
    // GetResponse throws a WebException for 4XX and 5XX status codes
                    response = (HttpWebResponse)ex.Response;
    try
                    statusCode = response.StatusCode;
    if (response.ContentLength > 0)
    using (XmlReader reader =
    XmlReader.Create(response.GetResponseStream()))
                            responseBody =
    XDocument.Load(reader);
    if (response.Headers !=
    null)
                        requestId = response.Headers["x-ms-request-id"];
    finally
                    response.Close();
    if (!statusCode.Equals(expectedCode))
    throw new
    ApplicationException(string.Format(
    "Call to {0} returned an error:{1}Status Code: {2} ({3}):{1}{4}",
                        uri.ToString(),
    Environment.NewLine,
                        (int)statusCode,
                        statusCode,
                        responseBody.ToString(SaveOptions.OmitDuplicateNamespaces)));
    return requestId;
    But every time we are getting the below error from the line
     response = (HttpWebResponse)request.GetResponse();
    <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <Code>BadRequest</Code>
      <Message>The specified configuration settings for Settings are invalid. Verify that the service configuration file is a valid XML file, and that role instance counts are specified as positive integers.</Message>
    </Error>
     Any help is appreciated.
    Thanks,
    Shubhendu

    Please find the request XML I have found it in debug mode
    <CreateDeployment xmlns="http://schemas.microsoft.com/windowsazure">
      <Name>742d0a5e-2a5d-4bd0-b4ac-dc9fa0d69610</Name>
      <PackageUrl>http://shubhendustorage.blob.core.windows.net/shubhendustorage/WindowsAzure1.cspkg</PackageUrl>
      <Label>QXp1cmVFY295c3RlbURlcGxveW1lbnQ=</Label>
      <Configuration>77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0NCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KDQogIFRoaXMgZmlsZSB3YXMgZ2VuZXJhdGVkIGJ5IGEgdG9vbCBmcm9tIHRoZSBwcm9qZWN0IGZpbGU6IFNlcnZpY2VDb25maWd1cmF0aW9uLkNsb3VkLmNzY2ZnDQoNCiAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgbWF5IGNhdXNlIGluY29ycmVjdCBiZWhhdmlvciBhbmQgd2lsbCBiZSBsb3N0IGlmIHRoZSBmaWxlIGlzIHJlZ2VuZXJhdGVkLg0KDQogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCi0tPg0KPFNlcnZpY2VDb25maWd1cmF0aW9uIHNlcnZpY2VOYW1lPSJXaW5kb3dzQXp1cmUxIiB4bWxucz0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9TZXJ2aWNlSG9zdGluZy8yMDA4LzEwL1NlcnZpY2VDb25maWd1cmF0aW9uIiBvc0ZhbWlseT0iMSIgb3NWZXJzaW9uPSIqIiBzY2hlbWFWZXJzaW9uPSIyMDEyLTA1LjEuNyI+DQogIDxSb2xlIG5hbWU9IldlYlJvbGUxIj4NCiAgICA8SW5zdGFuY2VzIGNvdW50PSIyIiAvPg0KICAgIDxDb25maWd1cmF0aW9uU2V0dGluZ3M+DQogICAgICA8U2V0dGluZyBuYW1lPSJNaWNyb3NvZnQuV2luZG93c0F6dXJlLlBsdWdpbnMuRGlhZ25vc3RpY3MuQ29ubmVjdGlvblN0cmluZyIgdmFsdWU9IkRlZmF1bHRFbmRwb2ludHNQcm90b2NvbD1odHRwcztBY2NvdW50TmFtZT1zaHViaGVuZHVzdG9yYWdlO0FjY291bnRLZXk9WHIzZ3o2aUxFSkdMRHJBd1dTV3VIaUt3UklXbkFrYWo0MkFEcU5saGRKTTJwUnhnSzl4TWZEcTQ1ZHI3aDJXWUYvYUxObENnZ0FiZnhONWVBZ2lTWGc9PSIgLz4NCiAgICA8L0NvbmZpZ3VyYXRpb25TZXR0aW5ncz4NCiAgPC9Sb2xlPg0KPC9TZXJ2aWNlQ29uZmlndXJhdGlvbj4=</Configuration>
      <StartDeployment>true</StartDeployment>
      <TreatWarningsAsError>false</TreatWarningsAsError>
    </CreateDeployment>
    Shubhendu G

  • INFOPATH: Only Integers allowed validation tooltip

    I have a few lookup columns in an InfoPath library form template. The underlying fields are integer numbers, and the control is a dropdown which is populated from a secondary data connection. If the field is mandatory, a little validation tooltip reminds
    you "Only integers allowed". My users will be confused by such information. Is there a way to overwrite this message or at least switch it off? Thanks. Iko

    Any luck in solving this issue?
    Ok, this workaround helped me forward. Uncheck the option "Cannot be blank" on the drop down list. Instead, if you need validation and the field is mandatory, create a validation rule on the InfoPath control. its the same function, with a more meaningful message
    that you can customize.
    Hope it helps..

  • Reading strings and integers from a text file

    I want to read the contents of a text file and print them to screen, but am having problems reading integers. The file contains employee's personal info and basically looks like this:
    Warren Laing
    32 //age, data type is int
    M //gender, data type is String
    Sharon Smith
    44
    F
    Here's what I've done so far. The method should continue reading the file until there's no lines left. When I call it from main, I get a numberFormatException error. I'm not sure why because the data types of the set and get methods are correct, the right packages have been imported, and I'm sure I've used Integer.parseInt() correctly (if not, pls let me know). Can anyone suggest why I'm getting errors, or where my code is going wrong?
    many thanks
    Chris
    public void readFile() throws IOException{
    BufferedReader read = new BufferedReader(new FileReader("personal.txt"));
    int age = 0;
    String input = "";
    input = read.readLine();
    while (input != null){
    setName(input);
    age = Integer.parseInt(input);
    setAge(age);
    input = read.readLine();
    setGender(input);
    System.out.println("Name: " + getName() + " Age: " + getAge() + " Gender: " + getGender());
    read.close();

    To answer your question - I'm teaching myself java and I haven't covered enumeration classes yet.
    With the setGender("Q") scenario, the data in the text file has already been validated by other methods before being written to the file. Anyway I worked out my problems were caused by "input = read.readLine()" being in the wrong places. The code below works fine though I've left out the set and get methods for the time being.
    Chris
    public static void readFile()throws IOException{
    String name = "";
    String gender = "";
    int age = 0;
    BufferedReader read = new BufferedReader(new FileReader("myfile.txt"));
    String input = read.readLine();
    while(input != null){
    name = input;
    input = read.readLine();
    gender = input;
    input = read.readLine();
    age = Integer.parseInt(input);
    input = read.readLine();
    System.out.println("Name: " + name + " Gender: " + gender + " Age: " + age);
    read.close();

  • Xml document validation using Schema

    I want to validate XML Document using XML Schema...
    does any body have an idea how to do it.
    Every time i m running my java file by using different XML FILE AND XSD FILE in command line i m getting same error.
    error is:
    Exception in thread "main" org.xml.sax.SAXException: Error: URI=null Line=2: s4s-elt-schema-ns: The namespace of element 'catalog' must be from the schema name space.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1115)
    at SAXLocalNameCount.main(SAXLocalNameCount.java:117)
    Below is my java code with xml file and schema file.
    plz get back to me as soon as possible it is urgent.
    thanx
    java File
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import java.util.*;
    import java.io.*;
    public class SAXLocalNameCount extends DefaultHandler {
    /** Constants used for JAXP 1.2 */
    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";
    /** A Hashtable with tag names as keys and Integers as values */
    private Hashtable tags;
    // Parser calls this once at the beginning of a document
    public void startDocument() throws SAXException {
    tags = new Hashtable();
    // Parser calls this for each element in a document
    public void startElement(String namespaceURI, String localName,
    String qName, Attributes atts)
         throws SAXException
    String key = localName;
    Object value = tags.get(key);
    if (value == null) {
    // Add a new entry
    tags.put(key, new Integer(1));
    } else {
    // Get the current count and increment it
    int count = ((Integer)value).intValue();
    count++;
    tags.put(key, new Integer(count));
    System.out.println("TOTAL NUMBER OF TAG IN FILE = "+count);
    // Parser calls this once after parsing a document
    public void endDocument() throws SAXException {
    Enumeration e = tags.keys();
    while (e.hasMoreElements()) {
    String tag = (String)e.nextElement();
    int count = ((Integer)tags.get(tag)).intValue();
    System.out.println("Local Name \"" + tag + "\" occurs " + count
    + " times");
    static public void main(String[] args) throws Exception {
    String filename = null;
    String schemaSource = null;
    // Parse arguments
    schemaSource = args[0];
    filename = args[1];
    // Create a JAXP SAXParserFactory and configure it
    SAXParserFactory spf = SAXParserFactory.newInstance();
    // Set namespaceAware to true to get a parser that corresponds to
    // the default SAX2 namespace feature setting. This is necessary
    // because the default value from JAXP 1.0 was defined to be false.
    //spf.setNamespaceAware(true);
    // Validation part 1: set whether validation is on
    spf.setValidating(true);
    // Create a JAXP SAXParser
    SAXParser saxParser = spf.newSAXParser();
    System.out.println(" saxparser "+saxParser);
    // Validation part 2a: set the schema language if necessary
    if (true) {
    try {
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
    System.out.println(" saxparser ");
    } catch (SAXNotRecognizedException x) {
    // This can happen if the parser does not support JAXP 1.2
    System.err.println(
    "Error: JAXP SAXParser property not recognized: "
    + JAXP_SCHEMA_LANGUAGE);
    System.err.println(
    "Check to see if parser conforms to JAXP 1.2 spec.");
    System.exit(1);
    // Validation part 2b: Set the schema source, if any. See the JAXP
    // 1.2 maintenance update specification for more complex usages of
    // this feature.
    if (schemaSource != null) {
    saxParser.setProperty(JAXP_SCHEMA_SOURCE, new File(schemaSource));
    System.out.println(" saxparser 123");
    // Get the encapsulated SAX XMLReader
    XMLReader xmlReader = saxParser.getXMLReader();
    System.out.println(" XML READER "+xmlReader);
    // Set the ContentHandler of the XMLReader
    xmlReader.setContentHandler(new SAXLocalNameCount());
    System.out.println(" XML READER 345 ");
    // Set an ErrorHandler before parsing
    xmlReader.setErrorHandler(new MyErrorHandler(System.err));
    System.out.println(" XML READER 67878 ");
    // Tell the XMLReader to parse the XML document
    xmlReader.parse(filename);
    System.out.println(" XML READER ");
    // Error handler to report errors and warnings
    private static class MyErrorHandler implements ErrorHandler {
    /** Error handler output goes here */
    private PrintStream out;
    MyErrorHandler(PrintStream out) {
    this.out = out;
    * Returns a string describing parse exception details
    private String getParseExceptionInfo(SAXParseException spe) {
    String systemId = spe.getSystemId();
    if (systemId == null) {
    systemId = "null";
    String info = "URI=" + systemId +
    " Line=" + spe.getLineNumber() +
    ": " + spe.getMessage();
    return info;
    // The following methods are standard SAX ErrorHandler methods.
    // See SAX documentation for more info.
    public void warning(SAXParseException spe) throws SAXException {
    out.println("Warning: " + getParseExceptionInfo(spe));
    public void error(SAXParseException spe) throws SAXException {
    String message = "Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    public void fatalError(SAXParseException spe) throws SAXException {
    String message = "Fatal Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    xml file(books.xml)
    <?xml version="1.0"?>
    <catalog>
    <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <genre>Computer</genre>
    <price>44.95</price>
    <publish_date>2000-10-01</publish_date>
    <description>An in-depth look at creating applications
    with XML.</description>
    </book>
    <book id="bk102">
    <author>Ralls, Kim</author>
    <title>Midnight Rain</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-12-16</publish_date>
    <description>A former architect battles corporate zombies,
    an evil sorceress, and her own childhood to become queen
    of the world.</description>
    </book>
    <book id="bk103">
    <author>Corets, Eva</author>
    <title>Maeve Ascendant</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-11-17</publish_date>
    <description>After the collapse of a nanotechnology
    society in England, the young survivors lay the
    foundation for a new society.</description>
    </book>
    <book id="bk104">
    <author>Corets, Eva</author>
    <title>Oberon's Legacy</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2001-03-10</publish_date>
    <description>In post-apocalypse England, the mysterious
    agent known only as Oberon helps to create a new life
    for the inhabitants of London. Sequel to Maeve
    Ascendant.</description>
    </book>
    <book id="bk105">
    <author>Corets, Eva</author>
    <title>The Sundered Grail</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2001-09-10</publish_date>
    <description>The two daughters of Maeve, half-sisters,
    battle one another for control of England. Sequel to
    Oberon's Legacy.</description>
    </book>
    <book id="bk106">
    <author>Randall, Cynthia</author>
    <title>Lover Birds</title>
    <genre>Romance</genre>
    <price>4.95</price>
    <publish_date>2000-09-02</publish_date>
    <description>When Carla meets Paul at an ornithology
    conference, tempers fly as feathers get ruffled.</description>
    </book>
    <book id="bk107">
    <author>Thurman, Paula</author>
    <title>Splish Splash</title>
    <genre>Romance</genre>
    <price>4.95</price>
    <publish_date>2000-11-02</publish_date>
    <description>A deep sea diver finds true love twenty
    thousand leagues beneath the sea.</description>
    </book>
    <book id="bk108">
    <author>Knorr, Stefan</author>
    <title>Creepy Crawlies</title>
    <genre>Horror</genre>
    <price>4.95</price>
    <publish_date>2000-12-06</publish_date>
    <description>An anthology of horror stories about roaches,
    centipedes, scorpions and other insects.</description>
    </book>
    <book id="bk109">
    <author>Kress, Peter</author>
    <title>Paradox Lost</title>
    <genre>Science Fiction</genre>
    <price>6.95</price>
    <publish_date>2000-11-02</publish_date>
    <description>After an inadvertant trip through a Heisenberg
    Uncertainty Device, James Salway discovers the problems
    of being quantum.</description>
    </book>
    <book id="bk110">
    <author>O'Brien, Tim</author>
    <title>Microsoft .NET: The Programming Bible</title>
    <genre>Computer</genre>
    <price>36.95</price>
    <publish_date>2000-12-09</publish_date>
    <description>Microsoft's .NET initiative is explored in
    detail in this deep programmer's reference.</description>
    </book>
    <book id="bk111">
    <author>O'Brien, Tim</author>
    <title>MSXML3: A Comprehensive Guide</title>
    <genre>Computer</genre>
    <price>36.95</price>
    <publish_date>2000-12-01</publish_date>
    <description>The Microsoft MSXML3 parser is covered in
    detail, with attention to XML DOM interfaces, XSLT processing,
    SAX and more.</description>
    </book>
    <book id="bk112">
    <author>Galos, Mike</author>
    <title>Visual Studio 7: A Comprehensive Guide</title>
    <genre>Computer</genre>
    <price>49.95</price>
    <publish_date>2001-04-16</publish_date>
    <description>Microsoft Visual Studio 7 is explored in depth,
    looking at how Visual Basic, Visual C++, C#, and ASP+ are
    integrated into a comprehensive development
    environment.</description>
    </book>
    </catalog>
    (books.xsd)
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="catalog">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="book" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="author" type="xsd:string"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="genre" type="xsd:string"/>
    <xsd:element name="price" type="xsd:float"/>
    <xsd:element name="publish_date" type="xsd:date"/>
    <xsd:element name="description" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    Add xmlns:xsi attribute to the root element <catalog>.
    <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation='books.xsd'>

  • Control an Integer field Length without using Validation ??

    Hi,
    I have Couple of fields where I need to configure them as Integers.
    Now each one has a fixed length that i need to limit to.
    But when i create a field of type: integer, i cannot select teh length!!!
    To achive this the idea i have is to write a validation which checks length..
    But can i achive it without going for a validation on each field???
    PS: I am aware that TEXT field can limit the length But it also allows me to enter text values, my requirement clearly says that to allow users to only enter Numeric values..
    Did anyone face a similar Case?
    Kind Regards
    Eva

    Hi Eva,
    I didn't try in the system, but I feel there are two solutions to achieve your requirement (*of course in both cases you will need to write a simple validation)
    Solution 1 : When field is defined as "Integer" in Console.
    lets take an example, you want to restrict an integer field with a limit of max 4 characters.
    Maximum value of a 4 character integer can be "9999". So, you can put a simple validation to compare the field value with 9999. if the value is less then this means fields values is less than 4 characters, else more than 5 characters.
    In this case Your validation expression in expression editor will be:
    FIELD NAME<= "9999"
    Solution 2 : When field is defined as "Text" in Console.
    In this case you can restrict the maximum field length through Console. But you will also need to write a validation to ensure that user is not entering any alphabets or special characters in this field.
    In this Case you can use below validation:
    HAS_ALL_CHARS(FIELD NAME, "0","9")
    This will ensure that field has all characters between 0 and 9 and doesn't hold any special character or alphabets.
    In Both cases you will need to set  "Automatic Execution" property as "Error". Also please do not manually type any function or value in expression editor. use drop down for fields, operators, functions etc.  and enter numeric values using the first blank box before dimension list.
    Kindly revert if you face any issues.
    -Shiv

  • DNG SDK thinks 0xFFFFFFFF is invalid white level for 32 bit integers

    As discussed in another message the DNG SDK does not seem to be able to write floating point DNGs. Since I need higher dynamic range than a 16 bit sample I instead went for 32 bit integers.
    This works, and I manage to create a file but when I run dng_validate on it it says the white level is invalid. The white level I have of course set to 0xFFFFFFFF to make use of the full 32 bit range. Looking into the code in dng_ifd.cpp where this test is made it seems like the default max white level is set to 65535.0 and the file's white level is compared against that, regardless if the sample type is 16 or 32 bit. This means that I can only make use of 16 bits of the 32 bit integer which seems kind of strange. Looking into the DNG spec I don't see anything there that forbids using the full 32 bit range of 32 bit samples. So this looks like a bug to me.
    This is with version 1.4
    the created file can be opened in Lightroom 4, so the only problem seems to be that dng_validate does not think its valid.
    Message was edited by: torger76, removed clipping issue, that was a fault in my code.

    Hello Charles,
    I would be concerned too if my MacBook Prowas running slowly.  I found a couple of articles I recommend to help isolate and troubleshoot this issue.
    I recommend reviewing this article first for possible causes of the slowness:
    OS X Mavericks: If your Mac runs slowly
    http://support.apple.com/kb/PH13895
    You can further isolate the issue by determining if it is only happening in your user account or if it is happening system-wide:
    Isolating an issue by using another user account
    http://support.apple.com/kb/TS4053
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Validation Rules

    Hi,
    I need to develop component, which can perform Validations at Objects.
    External components will call it and pass it the following data:
    * The object to validate
    * The name of the validation rule to execute
    And then my component will perform validation (on that object) through the specified validation rule.
    Rule is a logical set of operations, which checks that a given data complies with specific restrictions. For example rule MinMax should check that given number is within defined range.
    Rules can be anything: MinMax (for integers), StringLength, ValidMailAddress and so on.
    I want my component to come with some out-of-the-box rules and I want to give the developers a good way to add rules.
    Before I develop that I need to know if there is an existing tool, which provides all that (more or less).
    I searched the Internet and I found only Jakarta's Validator.
    Do you know some other tools?
    Thanks,
    T.

    I want my component to come with some out-of-the-box
    rules and I want to give the developers a good way to
    add rules.When I saw this, I instantly thought of the W3C XML schema (Actually it's the W3C XML schema schema but I didn't go to school here.)
    It has validation for all the 'normal' types you can think of and allows for custom rules using a rich set of tools (including regex.)
    The (possible) downside is that you must at some point represent your data in an XML tree.

  • Acrobat not validating signature with three pairs of ByteRange values

    I have created a PDF with a Digital signature, when opened with Acrobat Reader 10 i see the signature not bieng validated with a message saying, "There are errors in the formatting or information contained in this signature (support information: SigDict /ByteRange value)". My signature's byterange  contains three pairs of integers(/ByteRange[0 569 6417 400 6817 1013]) which seems to be causing this problem. Will appreciate any input regarding this.

    Hi SindhuCT,
    I can't speak for PDF-XChange Viewer as to whether or not they are correctly processing the signature. The only thing I can point out is you are hashing the bytes from the beginning of the file (byte 0) to byte 569. Then you are leaving a hole for the signature from byte 570 through byte 6416. You are then hashing from byte 6417 and marching off another 400 bytes which gets you to byte 6817. Finally you are telling Acrobat/Reader to leave a hole from byte 6817 to the end of the file at byte 7830. The problem is your got byte 6817 on both sides of the fence, as part of the signed data and as part of the second unsigned portion of the file. That's probably where your problem lies.
    Yes, the PDF specification does say you can include other ranges, but it also says that it's not recommended because you are not going to be checking for all changes to the document. The specification says you should sign the entire file, less the hole for the signature contents.
    Steve

  • [JS][CS3] Validating edittexts in ScriptUI

    Hi,
    I have to attach validation methods to a bunch of edit fields' onChange. Some fields would have to contain floats (toFixed(2)), some - integers, some - capitalized strings after the field has lost focus. I'm ready with 3 functions to be attached to controls, but I would like to hear the most robust solution to this problem. Would you use ctrl.onChange = fn, or rather ctrl.addEventListener()...?
    Any comments welcome.
    M.

    Wait a second... Something I hadn't considered before.
    The problem of relying on the onChange event of a single field is that a click in an OK button will still close the window.
    But, if you set an event listener to the OK button's click event, you can validate all fields and then cancel the event.
    Here's an example that does work in ESTK2 (CS3) (I think this code will paste and show correctly, if it doesn't, sorry)
    // Basic ScriptUI validation
    /* This script shows the basics of validation using ScriptUI events
    By using the "change" event, a script can be notified that a value has changed. The problem with this approach is that it
    requires a field to lose focus for the event to fire. For example, a user can type an invalid number in a field, then, without leaving
    the field, click the OK button (which is still enabled because validation has not happened on the invalid field yet). In this case, clicking
    the OK button causes the field to lose focus, the validation occurs, but the OK button has already been pressed, and the dialog will
    close with an invalid entry.
    We could use the "changing" event that fires for every character typed; but, that approach brings its own set of complications. For example, the
    user is typing "12 inches" in the field. If the validation routine accepts units and abbreviations, as the user types we get the following states:
    "1" - valid
    "2" - valid
    " " - valid
    "i" - INVALID
    "n" - valid
    "c" - INVALID
    "h" - valid
    "e" - INVALID
    "s" - valid
    That doesn't work.
    If we intercept the OK button's mouseDown event, we can validate all fields, and either allow the OK button click event or cancel it.
    If cancelled, the OK button can disabled, and a visual cue could be provided as to the offending field(s).
    With this approach, the valdiation routines need to have a reference to the OK button, and all registered validations
    must happen each time a field is edited to set the state of the OK button.
    // setControlState sets the background color of a control to "good" or "bad". The white for good, red for bad
    setControlState= function( myControl ) {
    if ( myControl.isValid ) { // we're good, make it white
    myControl.graphics.backgroundColor = myControl.graphics.newBrush( myControl.graphics.BrushType.SOLID_COLOR, [1,1,1,1] );
    } else { // we're bad, make the field background red (straight red, [ 1, 0, 0, 1] is a bit harsh, so we're using a red-ish color
    var myRedColorArray = [ 210/255, 12/255, 82/255, 1];
    myControl.graphics.backgroundColor = myControl.graphics.newBrush( myControl.graphics.BrushType.SOLID_COLOR, myRedColorArray );
    // validateInteger will ensure that a field contains a valid integer
    validateInteger = function( myEvent ) {
    myEvent is passed to the handler when the event fires, myEvent.target is the target control of the event.
    We're adding a property "isValid" to the control so we can quickly check the state of any control
    Note that parseInt parses "12x" as 12, so you can't just check for isNaN on a parseInt...
    // make this a required field by checking to see if there's anything there
    if ( myEvent.target.text.length == 0 ) {
    myEvent.target.isValid = false;
    } else if ( isNaN( Number( myEvent.target.text ) ) ) { // if it can't be cast to a number, it's obviously bad
    myEvent.target.isValid = false;
    } else {
    // if we can parseIn the content of the field, change it back to a string, and get the original value, the original value must have been a string
    myEvent.target.isValid = ( parseInt( myEvent.target.text ).toString() == myEvent.target.text );
    // set the control's background to red if it's invalid
    setControlState( myEvent.target );
    // check all the fields, and set the OK button state
    validateAll( myEvent.target.window.okButton );
    // validateReal will ensure a field has a valid Real number
    validateReal = function( myEvent ) {
    // make this a required field by checking to see if there's anything there
    if ( myEvent.target.text.length == 0 ) {
    myEvent.target.isValid = false;
    } else if ( isNaN( Number( myEvent.target.text ) ) ) { // if casting to a number is NaN, it's bad...
    myEvent.target.isValid = false;
    } else {
    // if user enters ".2", parseFloat turns it into "0.2" so the same parseFloat().toString() won't work like it does for integers
    // using a regex instead
    var regex = /\d*\.{0,1}\d*/g; // zero or more digits, possibly a decimal point, followed by zero or more digits
    // if the first element of the array returned from String.match equals the original, we're good
    try {
    myEvent.target.isValid = ( myEvent.target.text == myEvent.target.text.match( regex )[ 0 ] );
    } catch( e ) {
    myEvent.targetisValid = false;
    //set the control's background to red if it's invalid
    setControlState( myEvent.target );
    // now check all the fields
    validateAll( myEvent.target.window.okButton );
    // uses the UnitValue object to ensure whatever is typed in will be a valid measurement unit
    // for this handler, we wil set a "fieldUnit" property on the edit box, all units will be converted to those units
    // we're supporting all units that UnitValue supports except pixels and percents as they are based on a base unit and traditional points/picas as no one will likely enter "tpc" or "tpt" vs "pt" or "pc"
    validateUnits = function( myEvent ) {
    // no empty fields
    if ( myEvent.target.text.length == 0 ) {
    myEvent.target.isValid = false;
    } else {
    // this regex will validate the basic form of a unit value - a real number followed by zero or more spaces and possibly a valid unit string
    var regex = /\d*\.{0,1}\d* *(?:in|inch|inches|ft|foot|feet|yd|yard|yards|mi|mile|miles|mm|millimeter|millimeters|cm| centimeter|centimeters|m|meter|meters|km|kilometer|kilometers|pt|point|points|pc|pica|pica s|ci|cicero|ciceros)?/gi;
    var myMatch = myEvent.target.text.match( regex );
    try {
    myEvent.target.isValid = ( myEvent.target.text == myEvent.target.text.match( regex )[ 0 ] );
    } catch( e ) {
    myEvent.target.isValid = false;
    if ( myEvent.target.isValid ) {
    // create a new UnitValue from the target text
    // it's posible that the units were left off, in which case the fieldUnits are assumed.
    // so use the regex from validateReal to see if there's a unit attached to the value
    var regex = /\d*\.{0,1}\d*/g; // zero or more digits, possibly a decimal point, followed by zero or more digits
    // if the first element of the array returned from String.match equals the original, there's no units
    try {
    var hasUnits = ( myEvent.target.text != myEvent.target.text.match( regex )[ 0 ] );
    } catch( e ) { // if this errors, something is very, very wrong...
    myEvent.target.isValid = false;
    setControlState( myEvent.target );
    validateAll( myEvent.target.window.okButton );
    return;
    if ( !hasUnits ) {
    var myUnitValue = new UnitValue( myEvent.target.text + " " + myEvent.target.fieldUnit );
    } else {
    var myUnitValue = new UnitValue( myEvent.target.text );
    if ( isNaN( myUnitValue ) ) {
    myUnitValue = new UnitValue( "0 " + myEvent.target.fieldUnit );
    try {
    // attempt to convert it to the fieldUnit - if it can't be done, this will error
    myUnitValue.convert( myEvent.target.fieldUnit );
    // the reason for the convert is that the UnitValue.toString() will inclue the abbreviated units for us, using UnitValue.as() will not
    myEvent.target.text = myUnitValue.toString();
    } catch ( e ) {
    // if we errored, it wasn't a valid measurement
    myEvent.target.isValid = false;
    setControlState( myEvent.target );
    validateAll( myEvent.target.window.okButton );
    // validateAll - this function is hard wired to check the isValid state (set in the validation routines) of the edit boxes used in the test example
    validateAll = function

  • Validating in a DataGrid

    I use a TextInput ItemEditor in a Datagrid. How do I make
    sure the user only inputs numeric input? I can use restrict to get
    only integers, but what if I want real numbers with two decimal
    places?

    A simple solution would be to use a Number Validator as seen
    here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=validators_1.html
    :S

  • Struts validation

    Hi
    i have a question and was looking forward for your help...
    during struts validation we use depends="int"
    so our purpose is to accept values which are pure integers and remaing should be rejected by validator.....but then if we put some text say "abc" it simply gets converted to 0 and validator accepts it and shows no error
    So how can validator classes help us to get around this....that is when ever user inserts something that's not a proper number validator should alarm with an error

    I've found a solution that works for me:
    1. In the form in each jsp of the multi-page form, add:
    <netui:hidden dataSource="{actionForm.page}"/>
    2. Add a page="<pageno>" attribute to each field element in the validations xml
    file, where validation is performed when <pageno> is <= to the current page number.
    3. In each action method add:
    form.setPage(<pageno>)
    where <pageno> is appropriate to the page that this action will forward to. You
    will need to initialise page to 1 in the begin() method.
    Andy
    >
    Hi all
    I'm using Struts validation in WLP 8.1 with a multi-page form that has
    a single
    ValidatorForm form bean. How do I ensure that only the fields for a page
    represented
    by an action are validated?
    thanks, Andy

  • Powershell script error adding integers

    Hi All, I am trying to add integers but the script is not running. I am using variable "a" with the same line of thinking as
    $arg in $args
    $a in $as
    #  create a script thats adds numbers using foreach
    # put an if statement if the numbers are not valid
    My script begins here:
       set-psdebug -strict
        $total = 0
    foreach($a in $as)
                   if ( $a -as[int] -eq $null)
                { Write-host "this is not a valid number"
                    exit 1
                    $total += $a
                  Write-host "The total is $total"
    I am calling my script with the following line: .\finalexam\foreachadd.ps1 6 6 i
    The error is :
    The variable '$as' cannot be retrieved because it has not been set.
    At C:\cmd.practise\finalexam\foreachadd.ps1:8 char:15
    + foreach($a in $as)
    +               ~~~
        + CategoryInfo          : InvalidOperation: (as:String) [], RuntimeException
        + FullyQualifiedErrorId : VariableIsUndefined
    Thank-you
    SQL 75
    (LearningPowerhsell)

    You need to go back and study the very initial basics of PowerShell.  You are repeatedly guessing wrong and misunderstanding how this works. Without the fundamentals you will be forever lost.
    Try to understand why and how the following works.  Read the basics of using PowerShell variables and loops.
    $as=1,2,'x',4,5,'z'
    $total=0
    foreach($a in $as){
    if($a -as [int]){
            $total+=$a
    }else{
            Write-host "$a cannot be converted to a valid integer 32"
    Write-host "The total is $total"
    You also need to learn how to format your code.  Tat would make it easier for you too see your mistakes.
    \_(ツ)_/

  • Range Validation in Java

    Hi,
    I am having a doubt in Range Validation
    I having the following as input, i will maintain a Default Values,
    StartId, EndId as Constant in my program
    Example :
    StartID= "0000000" Format will be "XXXXXXX"
    EndID = "0000100" Format will be "XXXXXXX"
    From the UI, i will have the option to enter a text. If the User has to enter the same Format "XXXXXXX", the format validation I performed using reg Expression,
    I need to perform the Range validation here, if the user Enters value say
    "0000700" < it is not within the StartId & EndId Range, then i need to say Error.
    How can i perform Range Validation in java.?
    Any Ideas please..

    It can be done with regexp but it's probably easier to parse the start and end ids and the entered value into integers and perform the validation using a normal if statement.

Maybe you are looking for

  • XSLT MAPPING/JAVA MAPPING

    Hi All,    After faceing so much of problem, i found that it would be better if i can go for an XSLT/java mapping: 1. It is adding an extra <b>ns0</b> to header line & end line which i dont want to be generated in the output xml file. 2. Namespace pr

  • How   to customise Personnel actions in Vesion 3.1 I

    Hello Experts, I have to  configure Personnel actions in version 3.1 but I could not find the node for the same .......Please help as it is urgent.. Thanks in advance Rajeev Chhabra

  • How to know my previous version of Mozilla Firefox I used

    Mozilla Firefox automatically updated to version 32. Previously I used older version. I want to uninstall this version and again wanted to install older version. But I dont know which version I used. I never checked it. So please tell me how to know

  • How to display last 10 minutes data  only using sql query

    Hi, Presently, I'm using version is, Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production PL/SQL Release 11.1.0.6.0 - Production CORE 11.1.0.6.0 Production TNS for 32-bit Windows: Version 11.1.0.6.0 - Production NLSRTL Version 11.1.

  • Publish a new addon .

    Hi,expert The problem as follow: 1.I install  addon successfully in sap server . (sap server is window 2003) 2. I log in some client machine.the error msg prompot.(client OS is win 7) using 64bit. but install other client is ok .(OS is XP) "Error: An