Generateschema minlength/maxlength ??

Can the dbms_xmlschema.generateschema procedure produce minlength and maxlength when producing the schema?
Thanks

9.2.0.4
Windows 2000
Can the dbms_xmlschema.generateschema generate minlength/maxlength attributes?
Here is the procedure call:
XSD_TYPE := dbms_xmlschema.generateschema('SJS','XMLAPI_INCIDENT_TYPE','APIIncident',FALSE,FALSE,FALSE);
here is the output portion:
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://ns.oracle.com/xdb/SJS" xmlns="http://ns.oracle.com/xdb/SJS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb http://xmlns.oracle.com/xdb/XDBSchema.xsd">
<xsd:element name="IncidentRecord" type="XMLAPI_INCIDENT_TYPEType"/>
<xsd:complexType name="XMLAPI_INCIDENT_TYPEType">
<xsd:sequence>
<xsd:element name="I_ID" type="xsd:double"/>
<xsd:element name="AgencyORI" type="xsd:string"/>
<xsd:element name="IncidentNumber" type="xsd:string"/>
<xsd:element name="DivisionPrecinct" type="xsd:string"/>
<xsd:element name="CaseNumber" type="xsd:string"/>
<xsd:element name="IncidentType" type="xsd:string"/>
<xsd:element name="ExternalIncidentID" type="xsd:string"/>
<xsd:element name="ExternalSourceLocation" type="xsd:string"/>

Similar Messages

  • Getting the Physical Length of a Piece of Text (in mm etc.) in Javascript

    I'm trying to write a script in Indesign CS5 (Windows) that can measure the physical, 'rendered' length of two pieces of text of similar length (in mm etc.), calculate the average length of the two, and adjust the tracking/horizontal scale of one or both of the pieces of text so that the physical length of both texts are the same.
    I need a script because this task must be done thousands of time in a long document.
    I'm struggling to find a way to access the 'rendered' length of a piece of text in Javascript.
    I know among the attributes of a text box is whether the text has overrun. So I could copy the text to a special text-box, and use a for loop to reduce the dimentions of the text box, 1mm at a time, until the text box overruns, thus determining the length..
    I could also get the length of a rendered string using python with it's built in GUI toolkit Tkinter:
    http://stackoverflow.com/questions/2922295/calculating-the-pixel-size-of-a-string-with-pyt hon
    And then have an indesign script that takes some data from the python script and sets the tracking/horizontal in Indesign with some fudge factors.
    Both ideas seem like real kludges.
    Any other suggestions?
    Many thanks
    David

    You can simply iterate through each line in text to get the widest line. Something like this:
    Main();
    function Main() {
        var text = app.selection[0],
        minLength, maxLength, start, end;
        for (var i = 0; i < text.lines.length; i++) {
            start = text.lines[i].characters[0].horizontalOffset,
            end = text.lines[i].characters[text.lines[i].characters.length-1].horizontalOffset;
            if (minLength == undefined || start < minLength) {
                minLength = start;
            if (maxLength == undefined || end > maxLength) {
                maxLength = end;
        var length = maxLength - minLength;
        $.writeln(length);
    But this approach seems to be a little less precise than creating outlines since (I guess) it measures up to the beginning of the last character; discretionary hyphens, line brakes, etc. are not included into the measurement.

  • Struts and validation question ?

    hi,
    i am using the struts framework for my application, i have a simple jsp logon page (username, password)
    i have defined a validtion.xml file
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    <!--
        Validation Rules for the Struts Example Web Application
        $Id: validation.xml,v 1.8 2003/05/25 22:51:20 dgraham Exp $
    -->
    <form-validation>
        <!-- ========== Default Language Form Definitions ===================== -->
        <formset>
            <form name="logonForm">
                <field property="username"
                        depends="required, minlength,maxlength">
                    <arg0   key="prompt.username"/>
                    <arg1   key="${var:minlength}" name="minlength"
                       resource="false"/>
                    <arg2   key="${var:maxlength}" name="maxlength"
                       resource="false"/>
                    <var>
                        <var-name>maxlength</var-name>
                        <var-value>16</var-value>
                    </var>
                    <var>
                        <var-name>minlength</var-name>
                        <var-value>3</var-value>
                    </var>
                </field>
                <field property="password"
                        depends="required, minlength,maxlength">
                    <arg0   key="prompt.password"/>
                    <arg1   key="${var:minlength}" name="minlength"
                       resource="false"/>
                    <arg2   key="${var:maxlength}" name="maxlength"
                       resource="false"/>
                    <var>
                        <var-name>maxlength</var-name>
                        <var-value>16</var-value>
                    </var>
                    <var>
                        <var-name>minlength</var-name>
                        <var-value>3</var-value>
                    </var>
                </field>
            </form>
            <form name="registrationForm">
                <field property="fromAddress"
                        depends="required,email">
                    <arg0   key="prompt.fromAddress"/>
                </field>
                <field property="fullName"
                        depends="required">
                  <arg0     key="prompt.fullName"/>
                </field>
                <field property="replyToAddress"
                        depends="email">
                    <arg0   key="prompt.replyToAddress"/>
                </field>
                <field property="username"
                        depends="required">
                  <arg0     key="prompt.username"/>
                </field>
            </form>
        </formset>
    </form-validation>i have also the validation-rules.xml file provided by the struts lib.
    i would like to force the content of 'username' property to be alphabetic.
    i guess i have to create my own element
    <validator name="alphabeticString"...> inside the validation-rules.xml file, but i am newbie in javascript programming.
    i have tree question.
    1) why the validation code inside the validator element is written in javascript since it's not going to be executed at client side???
    2)can i use java instead ? (to code teh validation ...)
    3)has anyone got a code to solve this problem ?
    thanks for your help

    i would like to force the content of 'username' property to be alphabetic.
    i guess i have to create my own element
    <validator name="alphabeticString"...> inside the validation-rules.xml file,
    but i am newbie in javascript programming.Not for something that simple... there's a validator rule called mask, which takes a regular expression as an argument, so if you want only a-z: "[a-zA-Z]*" should work.
    1) why the validation code inside the validator element is written in javascript since it's not going to be executed at client side???It is validated on the client, or can be. You have to include the javascript with the html:javascript tag library tag and specify the form name. Then you need to put the onsubmit="return validateFormName();" attribute in the form tag. If JS isn't supported, it'll still default back to the server side validation.
    2)can i use java instead ? (to code teh validation ...)Don't include the JS stuff.

  • Problem with the field length restrictions in the WSDL file

    Hi all,
    We have created a XSD file where we have defined fields and given some restrictions (like minLength, maxLength) for each field. See below one ex of one element "Id":
    {code     <xs:simpleType name="Id">
              <xs:restriction base="xs:string">
                   <xs:maxLength value="40"/>
              </xs:restriction>
         </xs:simpleType>
    {code}
    Here we have defined maxLength of this field as 40 chars. Our WSDL uses (refers/import) this XSD file and we ganerates java skeleton using RAD. But at runtime if we set more than 40 chars then also it is accepting. It is not throwing an exception. (In the generated java skeletion these restrictions are not reflected antwhere)
    I have one question that, if such restrictions defined in the XSD file works or not? and is it a industry standard to define restriction in the XSD file?
    If yes then what i need to do more to make it working?
    If not then is there any way to do such validation of the fields that are input to the webservice? Or shall i have to just write my own java class to validate each field?
    Regards,
    Ravi

    Or is it possible that we give length restrictions in the XSD (and import this XSD in WSDL) and generate java skeleton from WSDL then the restrictions defined in XSD are mapped into java classes?
    For ex:
    <xs:simpleType name="Id">
        <xs:restriction base="xs:string">
            <xs:maxLength value="40"/>
        </xs:restriction>
    </xs:simpleType>so when in generated java skeleton we set value to "Id" element which is more than 40 charsthen it should throw a exception?
    Is it possible by default or do we need to write custom validation classes to do validations on such fields?
    Has anybody worked in such scenerios?
    Or how to do field validations in webservice? Simple question.
    Thanks In Advance.

  • Getting the unscaled length of

    I'm developing a graphing application with FLEX 3 that will
    be embedded into a PDF document (version 9). The graphing SWF is
    pretty much finished, but I want to have greater control over the
    scaling on the axis. If I graph the parametric equations x=cos(t)
    and y=sin(t), the trace of these equations appears as an ellipse.
    Is there some what if getting the unscaled length of the vertical
    axis and the horizontal axis in pixels, so I can compute the exact
    aspect ratio of the axes. If that is known, I can rescale using
    scaleX and scaleY. Can anyone give me pointers?
    dps

    You can simply iterate through each line in text to get the widest line. Something like this:
    Main();
    function Main() {
        var text = app.selection[0],
        minLength, maxLength, start, end;
        for (var i = 0; i < text.lines.length; i++) {
            start = text.lines[i].characters[0].horizontalOffset,
            end = text.lines[i].characters[text.lines[i].characters.length-1].horizontalOffset;
            if (minLength == undefined || start < minLength) {
                minLength = start;
            if (maxLength == undefined || end > maxLength) {
                maxLength = end;
        var length = maxLength - minLength;
        $.writeln(length);
    But this approach seems to be a little less precise than creating outlines since (I guess) it measures up to the beginning of the last character; discretionary hyphens, line brakes, etc. are not included into the measurement.

  • Javascript validate date format?

    i cant figure out how to check the format of the date, i want it to check that the date is
    dd/mm/yy
                   if(document.getElementById(i+"eddstartdate").value == ????)
                        window.alert('You Must Enter a Start Date with a valid format');
                        return;
                   }

    I'm sure I had a small solution to this simple requirement. But I'm pasting the solution below.
    Include a js file named as say dateValidate.js with contents below and call the js function isDate(val,format) wherein you pass the value and the required format. Based on the boolean value return show the required message.
    var MONTH_NAMES = new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
    // isDate ( date_string, format_string )
    // Returns true if date string matches format of format string and
    // is a valid date. Else returns false.
    // It is recommended that you trim whitespace around the value before
    // passing it to this function, as whitespace is NOT ignored!
    function isDate(val,format) {
         //alert("val="+val)
         var date = getDateFromFormat(val,format);
         //alert("date="+date)
         if (date == 0) { return false; }
         return true;
    // compareDates(date1,date1format,date2,date2format)
    //   Compare two date strings to see which is greater.
    //   Returns:
    //   1 if date1 is greater than date2
    //   0 if date2 is greater than date1 of if they are the same
    //  -1 if either of the dates is in an invalid format
    function compareDates(date1,dateformat1,date2,dateformat2) {
         var d1 = getDateFromFormat(date1,dateformat1);
         var d2 = getDateFromFormat(date2,dateformat2);
         if (d1==0 || d2==0) {
              return -1;
         else if (d1 >= d2) {
              return 1;
         return 0;
    //      function to alert messages..
    /*function warnInvalid(s)
    {   alert(s)
        return false
    // formatDate (date_object, format)
    // Returns a date in the output format specified.
    // The format string uses the same abbreviations as in getDateFromFormat()
    function formatDate(date,format) {
         format = format+"";
         var result = "";
         var i_format = 0;
         var c = "";
         var token = "";
         var y = date.getYear()+"";
         var M = date.getMonth()+1;
         var d = date.getDate();
         var H = date.getHours();
         var m = date.getMinutes();
         var s = date.getSeconds();
         var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
         // Convert real date parts into formatted versions
         // Year
         if (y.length < 4) {
              y = y-0+1900;
         y = ""+y;
         yyyy = y;
         yy = y.substring(2,4);
         // Month
         if (M < 10) { MM = "0"+M; }
              else { MM = M; }
         MMM = MONTH_NAMES[M-1];
         // Date
         if (d < 10) { dd = "0"+d; }
              else { dd = d; }
         // Hour
         h=H+1;
         K=H;
         k=H+1;
         if (h > 12) { h-=12; }
         if (h == 0) { h=12; }
         if (h < 10) { hh = "0"+h; }
              else { hh = h; }
         if (H < 10) { HH = "0"+K; }
              else { HH = H; }
         if (K > 11) { K-=12; }
         if (K < 10) { KK = "0"+K; }
              else { KK = K; }
         if (k < 10) { kk = "0"+k; }
              else { kk = k; }
         // AM/PM
         if (H > 11) { ampm="PM"; }
         else { ampm="AM"; }
         // Minute
         if (m < 10) { mm = "0"+m; }
              else { mm = m; }
         // Second
         if (s < 10) { ss = "0"+s; }
              else { ss = s; }
         // Now put them all into an object!
         var value = new Object();
         value["yyyy"] = yyyy;
         value["yy"] = yy;
         value["y"] = y;
         value["MMM"] = MMM;
         value["MM"] = MM;
         value["M"] = M;
         value["dd"] = dd;
         value["d"] = d;
         value["hh"] = hh;
         value["h"] = h;
         value["HH"] = HH;
         value["H"] = H;
         value["KK"] = KK;
         value["K"] = K;
         value["kk"] = kk;
         value["k"] = k;
         value["mm"] = mm;
         value["m"] = m;
         value["ss"] = ss;
         value["s"] = s;
         value["a"] = ampm;
         while (i_format < format.length) {
              // Get next token from format string
              c = format.charAt(i_format);
              token = "";
              while ((format.charAt(i_format) == c) && (i_format < format.length)) {
                   token += format.charAt(i_format);
                   i_format++;
              if (value[token] != null) {
                   result = result + value[token];
              else {
                   result = result + token;
         return result;
    // Utility functions for parsing in getDateFromFormat()
    function _isInteger(val) {
         var digits = "1234567890";
         for (var i=0; i < val.length; i++) {
              if (digits.indexOf(val.charAt(i)) == -1) { return false; }
         return true;
    function _getInt(str,i,minlength,maxlength) {
         for (x=maxlength; x>=minlength; x--) {
              var token = str.substring(i,i+x);
              if (token.length < minlength) {
                   return null;
              if (_isInteger(token)) {
                   return token;
         return null;
    // END Utility Functions
    // getDateFromFormat( date_string , format_string )
    // This function takes a date string and a format string. It matches
    // If the date string matches the format string, it returns the
    // getTime() of the date. If it does not match, it returns 0.
    // This function uses the same format strings as the
    // java.text.SimpleDateFormat class, with minor exceptions.
    // The format string consists of the following abbreviations:
    // Field        | Full Form          | Short Form
    // -------------+--------------------+-----------------------
    // Year         | yyyy (4 digits)    | yy (2 digits), y (2 or 4 digits)
    // Month        | MMM (name or abbr.)| MM (2 digits), M (1 or 2 digits)
    // Day of Month | dd (2 digits)      | d (1 or 2 digits)
    // Hour (1-12)  | hh (2 digits)      | h (1 or 2 digits)
    // Hour (0-23)  | HH (2 digits)      | H (1 or 2 digits)
    // Hour (0-11)  | KK (2 digits)      | K (1 or 2 digits)
    // Hour (1-24)  | kk (2 digits)      | k (1 or 2 digits)
    // Minute       | mm (2 digits)      | m (1 or 2 digits)
    // Second       | ss (2 digits)      | s (1 or 2 digits)
    // AM/PM        | a                  |
    // Examples:
    //  "MMM d, y" matches: January 01, 2000
    //                      Dec 1, 1900
    //                      Nov 20, 00
    //  "m/d/yy"   matches: 01/20/00
    //                      9/2/00
    //  "MMM dd, yyyy hh:mm:ssa" matches: "January 01, 2000 12:30:45AM"
    function getDateFromFormat(val,format) {
         var date_split=val.split("/");
         /*if(date_split[0].length<2)
              date_split[0]="0"+date_split[0];
         if(date_split[1].length<2)
              date_split[1]="0"+date_split[1];
         val = date_split[0] + "/" + date_split[1] + "/" + date_split[2];*/
         val = val+"";
         format = format+"";
         var i_val = 0;
         var i_format = 0;
         var c = "";
         var token = "";
         var token2= "";
         var x,y;
         var now   = new Date();
         var year  = now.getYear();
         var month = now.getMonth()+1;
         var date  = now.getDate();
         var hh    = now.getHours();
         var mm    = now.getMinutes();
         var ss    = now.getSeconds();
         var ampm  = "";
         while (i_format < format.length) {
              // Get next token from format string
              c = format.charAt(i_format);
              token = "";
              while ((format.charAt(i_format) == c) && (i_format < format.length)) {
                   token += format.charAt(i_format);
                   i_format++;
              // Extract contents of value based on format token
              if (token=="yyyy" || token=="yy" || token=="y") {
                   if (token=="yyyy") { x=4;y=4; }// 4-digit year
                   if (token=="yy")   { x=2;y=2; }// 2-digit year
                   if (token=="y")    { x=2;y=4; }// 2-or-4-digit year
                   year = _getInt(val,i_val,x,y);
                   if (year == null) { return 0; }
                   i_val += year.length;
                   if (year.length == 2) {
                        if (year > 70) {
                             year = 1900+(year-0);
                        else {
                             year = 2000+(year-0);
              else if (token=="MMM"){// Month name
                   month = 0;
                   for (var i=0; i<MONTH_NAMES.length; i++) {
                        var month_name = MONTH_NAMES;
                        if (val.substring(i_val,i_val+month_name.length).toLowerCase() == month_name.toLowerCase()) {
                             month = i+1;
                             if (month>12) { month -= 12; }
                             i_val += month_name.length;
                             break;
                   if (month == 0) { return 0; }
                   if ((month < 1) || (month>12)) { return 0; }
                   // TODO: Process Month Name
              else if (token=="MM" || token=="M") {
                   x=token.length; y=2;
                   month = getInt(val,ival,x,y);
                   if (month == null) { return 0; }
                   if ((month < 1) || (month > 12)) { return 0; }
                   i_val += month.length;
              else if (token=="dd" || token=="d") {
                   x=token.length; y=2;
                   date = getInt(val,ival,x,y);
                   if (date == null) { return 0; }
                   if ((date < 1) || (date>31)) { return 0; }
                   i_val += date.length;
              else if (token=="hh" || token=="h") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 1) || (hh > 12)) { return 0; }
                   i_val += hh.length;
                   hh--;
              else if (token=="HH" || token=="H") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 0) || (hh > 23)) { return 0; }
                   i_val += hh.length;
              else if (token=="KK" || token=="K") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 0) || (hh > 11)) { return 0; }
                   i_val += hh.length;
              else if (token=="kk" || token=="k") {
                   x=token.length; y=2;
                   hh = getInt(val,ival,x,y);
                   if (hh == null) { return 0; }
                   if ((hh < 1) || (hh > 24)) { return 0; }
                   i_val += hh.length;
                   h--;
              else if (token=="mm" || token=="m") {
                   x=token.length; y=2;
                   mm = getInt(val,ival,x,y);
                   if (mm == null) { return 0; }
                   if ((mm < 0) || (mm > 59)) { return 0; }
                   i_val += mm.length;
              else if (token=="ss" || token=="s") {
                   x=token.length; y=2;
                   ss = getInt(val,ival,x,y);
                   if (ss == null) { return 0; }
                   if ((ss < 0) || (ss > 59)) { return 0; }
                   i_val += ss.length;
              else if (token=="a") {
                   if (val.substring(i_val,i_val+2).toLowerCase() == "am") {
                        ampm = "AM";
                   else if (val.substring(i_val,i_val+2).toLowerCase() == "pm") {
                        ampm = "PM";
                   else {
                        return 0;
              else {
                   if (val.substring(i_val,i_val+token.length) != token) {
                        return 0;
                   else {
                        i_val += token.length;
         // If there are any trailing characters left in the value, it doesn't match
         if (i_val != val.length) {
              return 0;
         // Is date valid for month?
         if (month == 2) {
              // Check for leap year
              if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) { // leap year
                   if (date > 29){ return false; }
              else {
                   if (date > 28) { return false; }
         if ((month==4)||(month==6)||(month==9)||(month==11)) {
              if (date > 30) { return false; }
         // Correct hours value
         if (hh<12 && ampm=="PM") {
              hh+=12;
         else if (hh>11 && ampm=="AM") {
              hh-=12;
         var newdate = new Date(year,month-1,date,hh,mm,ss);
         return newdate.getTime();
    Hope this helps
    Regards
    Rohit

  • JAXB - Errors getting in binding the schema

    Hi! I have one xsd document that uses another xsd for list of values. First I bound the list of values xsd document and then tried to bind the original xsd. It is giving me the following error.
    [ERROR] length-minLength-maxLength: It is an error for both length and either of
    minLength or maxLength to be specified.
    line 762 of Origianl_DT.xsd
    [ERROR] length-minLength-maxLength: It is an error for both length and either of
    minLength or maxLength to be specified.
    line 1159 of Origianl_DT.xsd
    [ERROR] length-minLength-maxLength: It is an error for both length and either of
    minLength or maxLength to be specified.
    line 1295 of Origianl_DT.xsd
    Both of the xsd files were validated using xmlspy successfully. Now, I want to learn JAXB for simple xml file creation and validation against the xsd files. Please help me. Thanks,

    JAXB has extra rules that it uses to validate the schema. I believe this is for simplicity in the code generation side. For example, you can't have a maxOccurs="unbounded" element in an "all" complex element, it must be in a "sequence".
    In this case (and hopefully all others) fixing the schema so that JAXB will accept it is not going to hurt anything. A length requirement is both a maxLength and a minLength.
    There are some rules I don't appreciate that JAXB tacks on. For example, if you import another schema into your binding schema, and don't use every type specified in the imported schema, it will balk. Why? I can't think of a good reason. It really makes it a pain in the ass to create reusable custom XML types. I have to have a different schema for every type.

  • How to read XSD file

    Hi all,
    I want to read XML Schema (XSD) files in my application. But dont know any API for this.
    For ex:
    <xs:schema xmlns:sswfm="http://www.sumasoft.com/XMLSchema/WFM" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.sumasoft.com/XMLSchema/WFM" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="Bounds" type="sswfm:BoundsType"/>
         <xs:complexType name="BoundsType">
              <xs:sequence>
                   <xs:element name="PositionX" type="xs:integer" default="0"/>
                   <xs:element name="PositionY" type="xs:integer" default="0"/>
                   <xs:element name="Width" type="xs:integer" default="20"/>
                   <xs:element name="Height" type="xs:integer" default="10"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>in this XSD i need to read all the elements like this-
    PositionX - 0
    PositionY - 0
    Width - 20
    Height - 10
    My XSD is much more complex than this. It may contains Enumerations, minlength, maxLength.
    How can i read like this?
    Any help is appreciable.

    I have the same problem ...
    I'm not able to read an .xsd file and load SimpleType and ComplexType .
    Can you help me ?
    Thank you very much .
    Marco

  • Load xml image to button - help

    im bulding a photographer web site.
    and for each picture i want to have its thumbnail as a
    button.
    but i want the image of the thumbnail button to be loaded by
    an xml file.
    can any one help ? or send me a file ?
    thanksss

    The bug you are referencing occurs when an Enumerated Value also has min and max lengths specified..
    Eg something like
    <xsd:simpleType name="EnumType">
         <xsd:annotation>
             <xsd:documentation>ENUM_TYPE</xsd:documentation>
         </xsd:annotation>
         <xsd:restriction base="xsd:string">
             <xsd:enumeration value="AA"/>
             <xsd:enumeration value="AB"/>
             <xsd:enumeration value="AE"/>
             <xsd:enumeration value="AK"/>
             <xsd:enumeration value="AL"/>
         </xsd:restriction>
       </xsd:simpleType>
       <xsd:complexType name="TYPE1">
         <xsd:sequence>
             <xsd:element name="TYPE11">
               <xsd:simpleType>
                   <xsd:restriction base="EnumType">
                     <xsd:minLength value="1"/>
                     <xsd:maxLength value="10"/>
                   </xsd:restriction>
               </xsd:simpleType>
             </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
    </xsd:schema> Do you have something like this in your XML Schema. If this is the case try removing the minLength, maxLength as they are redundant, which is probably why we didn't catch this one in internal testing, it sort of falls into the "if it hurts please don't do it" category :). Also the fix for this bug appears to have been backported on top of 9.2.0.6.0 so upgrading to 9.2.0.7.0 or 9.2.0.8.0 or the later releases of 10.1 or 10.2 should fix the problem.

  • Load XML file to Oracle 10G XE

    The load xml wizard in Oracle XE asks for a table in the HR schema to load into.
    Well I create one using the 'Create Table' procedure with a script that runs and creates the table. Now I have a XML file that matches the table I created and try to load the file contents into the table. I get an error. Am I surprised? no, I am not. Nothing works the first time.
    Is there a preferred format for the xml file that supports loading into a table?
    There appears to be no help file, but then I may be mistaken.
    Could someone show me where to find this help file?

    The bug you are referencing occurs when an Enumerated Value also has min and max lengths specified..
    Eg something like
    <xsd:simpleType name="EnumType">
         <xsd:annotation>
             <xsd:documentation>ENUM_TYPE</xsd:documentation>
         </xsd:annotation>
         <xsd:restriction base="xsd:string">
             <xsd:enumeration value="AA"/>
             <xsd:enumeration value="AB"/>
             <xsd:enumeration value="AE"/>
             <xsd:enumeration value="AK"/>
             <xsd:enumeration value="AL"/>
         </xsd:restriction>
       </xsd:simpleType>
       <xsd:complexType name="TYPE1">
         <xsd:sequence>
             <xsd:element name="TYPE11">
               <xsd:simpleType>
                   <xsd:restriction base="EnumType">
                     <xsd:minLength value="1"/>
                     <xsd:maxLength value="10"/>
                   </xsd:restriction>
               </xsd:simpleType>
             </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
    </xsd:schema> Do you have something like this in your XML Schema. If this is the case try removing the minLength, maxLength as they are redundant, which is probably why we didn't catch this one in internal testing, it sort of falls into the "if it hurts please don't do it" category :). Also the fix for this bug appears to have been backported on top of 9.2.0.6.0 so upgrading to 9.2.0.7.0 or 9.2.0.8.0 or the later releases of 10.1 or 10.2 should fix the problem.

  • Dbms_xmlschema.generateschema - JAXB

    dbms_xmlschema.generateschema - JAXB
    We want to use our Oracle produced xsd to build JAVA content trees for unmarshalling and marshalling USING JAXB. The Oracle generated xsd does NOT nest complex sequence elements properly for JAXB. Any input is appreciated.
    Below is an example from the sun tutorial for using JAXB. Notice the ITEMS/ITEM structure. Below that is our example types, PL/SQL to generate xsd and the results.
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
    <xsd:element name="comment" type="xsd:string"/>
    <xsd:complexType name="PurchaseOrderType">
    <xsd:sequence>
    <xsd:element name="shipTo" type="USAddress"/>
    <xsd:element name="billTo" type="USAddress"/>
    <xsd:element ref="comment" minOccurs="0"/>
    <xsd:element name="items" type="Items"/>
    </xsd:sequence>
    <xsd:attribute name="orderDate" type="xsd:date"/>
    </xsd:complexType>
    <xsd:complexType name="USAddress">
    <xsd:sequence>
    <xsd:element name="name" type="xsd:string"/>
    <xsd:element name="street" type="xsd:string"/>
    <xsd:element name="city" type="xsd:string"/>
    <xsd:element name="state" type="xsd:string"/>
    <xsd:element name="zip" type="xsd:decimal"/>
    </xsd:sequence>
    <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
    </xsd:complexType>
    <xsd:complexType name="Items">
    <xsd:sequence>
    <xsd:element name="item" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="productName" type="xsd:string"/>
    <xsd:element name="quantity">
    <xsd:simpleType>
    <xsd:restriction base="xsd:positiveInteger">
    <xsd:maxExclusive value="100"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="USPrice" type="xsd:decimal"/>
    <xsd:element ref="comment" minOccurs="0"/>
    <xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
    </xsd:sequence>
    <xsd:attribute name="partNum" type="SKU" use="required"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <!-- Stock Keeping Unit, a code for identifying products -->
    <xsd:simpleType name="SKU">
    <xsd:restriction base="xsd:string">
    <xsd:pattern value="\d{3}-[A-Z]{2}"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    CREATE OR REPLACE TYPE sjs.Item AS OBJECT
    ( "productName"                    VARCHAR2(100),
    "quantity"               INTEGER
    CREATE OR REPLACE TYPE sjs.Items AS TABLE OF sjs.Item
    CREATE OR REPLACE TYPE sjs.purchaseOrder AS OBJECT
    ("comment"               VARCHAR2(100),
    "Items"               Items
    DECLARE
    RECURSE BOOLEAN := TRUE;
    ANNOTATE BOOLEAN := FALSE;
    EMBEDCOLL BOOLEAN := FALSE;
    Schemaurl VARCHAR2(10) := 'WWW';
    XSD_TYPE XMLTYPE;
    XSD_CLOB CLOB;
    XML_CLOB CLOB;
    XML_TYPE XMLsequenceTYPE;
    valid_flag INTEGER;
    p_out     CLOB;
    message VARCHAR2(4000);
    BEGIN
    EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY XML_DIR AS ''C:\XMLAPI_PRODUCE''';
    XSD_TYPE := dbms_xmlschema.generateschema('SJS','ITEMS','purchaseOrder',RECURSE,ANNOTATE,EMBEDCOLL);
    XSD_CLOB := XSD_TYPE.getclobval;
    sjs.file_util.write_clob(XSD_CLOB,'po.xsd','C:\XMLAPI_PRODUCE');
    DBMS_LOB.CREATETEMPORARY(xml_CLOB,TRUE,dbms_lob.CALL);
    DBMS_LOB.OPEN(xml_CLOB, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.CREATETEMPORARY(xsd_CLOB,TRUE,dbms_lob.CALL);
    DBMS_LOB.OPEN(xsd_CLOB, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.CLOSE(xml_CLOB);
    DBMS_LOB.FREETEMPORARY(xml_CLOB);
    DBMS_LOB.CLOSE(xsd_CLOB);
    DBMS_LOB.FREETEMPORARY(xsd_CLOB);
    END;
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb" xsi:schemaLocation="http://xmlns.oracle.com/xdb http://xmlns.oracle.com/xdb/XDBSchema.xsd">
    <xsd:element name="purchaseOrder" type="ITEMSType"/>
    <xsd:complexType name="ITEMSType">
    <xsd:sequence>
    <xsd:element name="ITEMS_ITEM" type="ITEMType" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ITEMType">
    <xsd:sequence>
    <xsd:element name="productName">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:maxLength value="100"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="quantity" type="xsd:integer"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

    DB Structure
    Parent Table - Incident --> Child Table - IncidentCharges --> Child Table of IncidentCharges --> IncidentChargeWeapons
    Container
    Oracle Containers for JAVA(OC4J)
    We have a schema (Incident.xsd) which comprises of our entire database structure. We unmarshalled the schema using JAXB to Java classes and interfaces .
    It created 2 .java classes and 2 .java interfaces for each high level tag . for eg for our Incident tag it created a Incident interface and a IncidentType Interface
    and also it created 2 classes IncidentImpl and IncidentTypeImpl . The IncidentTypeImpl has all the get and set properties we require eg. getIncidentType,
    setIncidentType,getIncidentNumber,setIncidentNumber,getOccuranceDate,setOccuranceDate etc.
    Our objective is to create a JSP page which has form fields to enter data which use these JAXB generated classes get and set properties. In other words
    we want to bind the JSP form fields to these JAXB generated classes. And once these JAXB objects are populated we want to marshal it and create a XML file with the data from those JAXB . Our database would then consume the generated XML. We tried creating a simple incident form with just 3 fields IncidentType,Occurance date and Incident Number and tried to bind these fields with the properties from IncidentTypeImpl classes using the <jsp:usebean> tag . When we deployed it to our container and tried to load the Incident.jsp page , it would not load up . Only when we cleared all the bindings it loaded up .
    Then we tried another workaround (just to get it working. Not a preferred approach) . We created another simple JAVA bean(not JAXB generated beans) which has set and get properties for the form fields and bound the form fields to it.
    On submitting the JSP page we called a servlet which takes data from our created bean and transfers it to the JAXB generated IncidentTypeImpl bean. When we deployed this the jsp page loads up and also our bean is filled with data . But the servlet bombs with this error below.
    500 Internal Server Error
    java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
         at Servlets.IncidentServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    We have 2 questions .
    1. Can a JSP page be bound directly to this JAXB generated bean in pretty much the same way as we bind it to our own bean ? (We would like to do this so that we dont have to create duplicate classes which mirror the JAXB generated classes.)
    2. Is there something special we have to do to deploy this application to recognize the JAXB classes. Do we have to deploy some jar file for it to recognize those classes ?

  • Set MaxLength in h:inputTextarea through javascript

    hi,
    There is no maxlength attribute in <h:inputTextarea> for JSF. So how can i set the length through javascript ?
    Is it possible?
    Thanks,

    It is possible but not straightforward. Try a JavaScript forum.

  • Urgent Help reg setting the maxlength of a text box

    Hi all,
    I want to set the max length or the no of characters to be entered of a textbox in parent page from a child popup window.
    Even if i use the opener property the maxlength is not set. Is there any other way to set the property. I'm not refreshing the parent page when coming back from child page. I tried to set the value of the text box from child and it's working fine. But the maxlength is not working.. Is there any way to do this.. Pls help me to solve this problem.

    this is really a js question and im not sure that you can access the formElem.maxlen property unless you get into DOM coding
    ...but ...
    maybe u could use something like this and set it from the parent window to the onkeyup event on the text box in the parent
    function textLimit(field, maxlen) {
    if (field.value.length > maxlen) {
    field.value = field.value.substring(0, maxlen);
    alert('your input has been truncated!');
    } }hth
    g00fy

  • Maxlength in h:inputTextarea ?

    In the Tag <h:inputText> it exist the attribute "maxlength", but this attribute does not exist in the Tag <h:inputTextarea>. I need this functionalty in the inputTextarea. I can use the standard validator to validate the length, but I need this functionality during the input.
    Can I solve this problem only with Javascript?
    Regards,

    Hi,
    I'va <h:inputTextArea> and done validation using validator.
    I'm resticting the max length of <h:inputTextArea> for 40 characters.
    but if i enter data about more than int range may be more than 32k ,
    and click on c\submit button. then getting expetion as
    HTTP Status 500 error on window. Error "12:55:06,773 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
    java.lang.IllegalStateException: Post too large" on console.
    maruthi reddy: java.lang.IllegalStateException: Post too large
    thank you

  • ORA-31094 & ORA-31082 when registering Schemas generated w/generateSchema()

    I have genereated several Schemas using DBMS_XMLSCHEMA.generateSchema(). However, trying to register these Schemas results in error messages. The error messages state that "REF" and also my own Types were incompatible SQL-Types for an Attribute or Element (ORA-31094). Also, they state that "SQLSchema" was an invalid Attribute (ORA-31082).
    As an example, I have included one of the Schemas that has been generated, the procedure used to register it and and also the type OTYP_Artikel it has been generated from. I would like to know why the Schemas generated by Oracle contain these errors and how to fix this.
    declare
    doc varchar2(2000) := '<xsd:schema targetNamespace="http://ns.oracle.com/xdb/OO_CHEF" xmlns="http://ns.oracle.com/xdb/OO_CHEF" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/xdb http://xmlns.oracle.com/xdb/XDBSchema.xsd">
    <xsd:element name="OTYP_ARTIKEL" type="OTYP_ARTIKELType" xdb:SQLType="OTYP_ARTIKEL" xdb:SQLSchema="OO_CHEF"/>
    <xsd:complexType name="OTYP_ARTIKELType">
    <xsd:sequence>
    <xsd:element name="ARTIKEL_NR" type="xsd:string" xdb:SQLName="ARTIKEL_NR" xdb:SQLType="VARCHAR2"/>
    <xsd:element name="MWST" type="xsd:hexBinary" xdb:SQLName="MWST" xdb:SQLType="REF"/>
    <xsd:element name="BEZEICHNUNG" type="xsd:string" xdb:SQLName="BEZEICHNUNG" xdb:SQLType="VARCHAR2"/>
    <xsd:element name="LISTENPREIS" type="xsd:double" xdb:SQLName="LISTENPREIS" xdb:SQLType="NUMBER"/>
    <xsd:element name="BESTAND" type="xsd:double" xdb:SQLName="BESTAND" xdb:SQLType="NUMBER"/>
    <xsd:element name="MINDESTBESTAND" type="xsd:double" xdb:SQLName="MINDESTBESTAND" xdb:SQLType="NUMBER"/>
    <xsd:element name="VERPACKUNG" type="xsd:string" xdb:SQLName="VERPACKUNG" xdb:SQLType="VARCHAR2"/>
    <xsd:element name="LAGERPLATZ" type="xsd:double" xdb:SQLName="LAGERPLATZ" xdb:SQLType="NUMBER"/>
    <xsd:element name="KANN_WEGFALLEN" type="xsd:double" xdb:SQLName="KANN_WEGFALLEN" xdb:SQLType="NUMBER"/>
    <xsd:element name="BESTELLVORSCHLAG" type="xsd:date" xdb:SQLName="BESTELLVORSCHLAG" xdb:SQLType="DATE"/>
    <xsd:element name="NACHBESTELLUNG" type="xsd:date" xdb:SQLName="NACHBESTELLUNG" xdb:SQLType="DATE"/>
    <xsd:element name="NACHBESTELLMENGE" type="xsd:double" xdb:SQLName="NACHBESTELLMENGE" xdb:SQLType="NUMBER"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>';
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/best.xsd', doc);
    end;
    DROP TABLE otab_artikel
    DROP TABLE otab_mwstsatz
    DROP TYPE otyp_artikel
    DROP TYPE otyp_mwstsatz
    CREATE OR REPLACE TYPE otyp_mwstsatz AS OBJECT (
    mwst integer,
    prozent number (3,3),
    beschreibung varchar2(10),
    MAP MEMBER FUNCTION mwst_order RETURN REAL,
    PRAGMA RESTRICT_REFERENCES
    (mwst_order, RNDS, WNDS, RNPS, WNPS),
    STATIC FUNCTION construct_mwst (in_mwst IN INTEGER,
    in_prozent IN NUMBER, in_beschreib IN VARCHAR2)
    RETURN otyp_mwstsatz
    show errors
    CREATE OR REPLACE TYPE BODY otyp_mwstsatz AS
    MAP MEMBER FUNCTION mwst_order RETURN REAL IS
    BEGIN
    RETURN prozent;
    END mwst_order;
    STATIC FUNCTION construct_mwst (in_mwst IN INTEGER,
    in_prozent IN NUMBER,
    in_beschreib IN VARCHAR2)
    RETURN otyp_mwstsatz IS
    BEGIN
    IF in_mwst < 0 THEN
    DBMS_OUTPUT.PUT_LINE ('Mwst-Schluessel muss >=0 sein');
    raise_application_error(-1,'Wertfehler bei mwst',FALSE);
    ELSE
    RETURN otyp_mwstsatz(in_mwst,in_prozent,in_beschreib);
    END IF;
    END construct_mwst;
    END;
    show errors
    CREATE TABLE otab_mwstsatz OF otyp_mwstsatz
    mwst NOT NULL,
    prozent NOT NULL,
    CONSTRAINT pk_mwstsatz PRIMARY KEY (mwst)
    CREATE OR REPLACE TYPE otyp_artikel AS OBJECT (
    artikel_nr varchar2(4),
    mwst REF otyp_mwstsatz,
    bezeichnung varchar2(15),
    listenpreis number(8,2),
    bestand number(5,0),
    mindestbestand number (5,0),
    verpackung varchar2(15),
    lagerplatz number(2,0),
    kann_wegfallen number(1,0),
    bestellvorschlag date,
    nachbestellung date,
    nachbestellmenge number(5,0),
    MEMBER FUNCTION get_mwst RETURN REAL,
    PRAGMA RESTRICT_REFERENCES (get_mwst, WNDS, WNPS)
    show errors
    CREATE OR REPLACE TYPE BODY otyp_artikel AS
    MEMBER FUNCTION get_mwst RETURN REAL IS
    lvar_prozent NUMBER(3,3);
    lvar_mwst otyp_mwstsatz;
    BEGIN
    SELECT DEREF(mwst) INTO lvar_mwst
    FROM dual;
    lvar_prozent := lvar_mwst.prozent;
    RETURN lvar_prozent;
    END get_mwst;
    END;
    show errors
    CREATE TABLE otab_artikel OF otyp_artikel (
    CONSTRAINT pk_artikel PRIMARY KEY (artikel_nr),
    CONSTRAINT nn_mwst mwst NOT NULL,
    CONSTRAINT nn_bezeichnung bezeichnung NOT NULL,
    CONSTRAINT nn_listenpreis listenpreis NOT NULL,
    CONSTRAINT nn_bestand bestand NOT NULL,
    CONSTRAINT chk_bestand CHECK (bestand >= 0),
    CONSTRAINT nn_mindestbestand mindestbestand NOT NULL,
    CONSTRAINT chk_mindestbestand CHECK (mindestbestand >= 0),
    CONSTRAINT chk_nachbestell
    CHECK (nachbestellmenge IS NULL OR nachbestellmenge >= 0)
    );

    Please post your question to XML DB forum for further help.

Maybe you are looking for

  • Itunes 10.1.2.17 upgrade killed my sound, music scroll bar doesn't move

    After upgrading to 10.1.2.17 on 1/30/2011 all sound ceased on my system. Updated the sound card driver to no avail. No conflict in compatability mode. When song selected in iTunes, the play bar doesn't move nor do movies have audio in quicktime. Ther

  • Video Doesn't Work...Why?

    I keep getting "there was a communications error in your chat" Here is the first half of the error message... Date/Time: 2008-12-19 21:28:12.428 -0500 OS Version: 10.5.6 (Build 9G55) Report Version: 4 iChat Connection Log: 2008-12-19 21:27:34 -0500:

  • New IPhone 4 charger charges when plugged into computer but not found in ITunes

    I recently bought a Reiko Iphone 4 charger and when I plugged it into my computer it charges the phone but is not found on itunes or IPhoto..how can I fix this?

  • TREX on Portal-Server also used for search/index for SAP Records Management

    Hi all, can a installation of the TREX on the Portal-Server (or as separate Server) used for Portal Index/search and also in parallel for searching of Content in an SAP Records Management (means full text research of records/ dossier in the SAP RM) ?

  • The cartridge directory could not be found.

    Error: "We couldn't get data from the Data Model.  Here's the error message we got: The cartridge directory could not be found.  Use the Windows Installer to repair the application.  Exception of type 'Microsoft.Office.PowerPivot.BackEnd.StorageExcep