Read the min and max occurrence from XSD

Hi,
I have a scenario where I have an XML, but not its XSD so my question is of two fold
1. Is it possible to create an XSD from that XML, if possible how?
2. Assume I get the XSD how do I read the min and max occurrence from that XSD?
PS: I am coding in java and pretty new to it, so it would be really helpful if I get the code snippets for the same :)
Edited by: Harsha.Hegde on Sep 2, 2008 5:49 AM

Harsha.Hegde wrote:
Hi,
I have a scenario where I have an XML, but not its XSD so my question is of two fold
1. Is it possible to create an XSD from that XML, yes
if possible how?by using a text editor, tools, etc.
2. Assume I get the XSD how do I read the min and max occurrence from that XSD?sigh
PS: I am coding in java and pretty new to itthen you should take some time to learn the basics, then work your way into XML after you have a grasp on things conceptually.
so it would be really helpful if I get the code snippets for the same :)sorry, no handouts here
do your own work
come back when you're written some Java and have a technical question

Similar Messages

  • Min and Max values from entire table

     Hi,
     i have requirement in which i need to find the min and max values from the entire table.
    See the sample data 
    create table test
    Sal1 int,
    Sal2 int,
    Sal3 int
    insert into test values (100,700,5700)
    insert into test values (200,3300,5300)
    insert into test values (4400,1200,3500)
    insert into test values (5400,5600,3100)
    i want the output as 100 and 5700.. how can i achieve this in a single query. Please through some light on this topic..!
    Thanking you in advance
    Regards,
    Balaji Prasad B
    Balaji - BI Developer

    Below is an example with a subquery for each of the queries Mohammad posted in order to return both min and max in a single result set.
    SELECT ( SELECT MAX(Maxx) AS Maxx
    FROM test UNPIVOT
    ( Maxx FOR E IN ( Sal1, Sal2, Sal3 ) ) AS unpvt
    ) AS Maxx
    , ( SELECT MIN(Minn) Minn
    FROM test UNPIVOT
    ( Minn FOR E IN ( Sal1, Sal2, Sal3 ) ) AS unpvt
    ) AS Minxx;
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • To find out the min and max memory been used by each parameter under SGA_MA

    Hi,
    Can any please tell me how to find out the min and max memory been used by each parameter under SGA_MAX and SGA_TARGET ? below is the db CRMS65T. If any such script is there please provide me
    SQL> select name from v$database;
    NAME
    CRMS65T
    SQL> show parameter sga
    NAME                                 TYPE        VALUE
    lock_sga                             boolean     FALSE
    pre_page_sga                         boolean     FALSE
    sga_max_size                         big integer 1000M
    sga_target                           big integer 1000MThanks in advance

    Can any please tell me how to find out the min and max memory been used by each parameter under SGA_MAX and SGA_TARGET ? below is the db CRMS65T. If any such script is there please provide meI guess your question is, each memory components of SGA? if so
    SQL> select * from v$sgainfo;
    NAME                                  BYTES RES
    Fixed SGA Size                      2088504 No
    Redo Buffers                       18882560 No
    Buffer Cache Size                 616562688 Yes
    Shared Pool Size                  301989888 Yes
    Large Pool Size                     4194304 Yes
    Java Pool Size                      4194304 Yes
    Streams Pool Size                         0 Yes
    Granule Size                        4194304 No
    Maximum SGA Size                  947912704 No
    Startup overhead in Shared Pool   125829120 No
    Free SGA Memory Available                 0Also check
    SQL> select COMPONENT,CURRENT_SIZE,MIN_SIZE,MAX_SIZE,USER_SPECIFIED_SIZE from v$sga_dynamic_components;
    shared pool                                                         301989888  301989888          0           209715200
    large pool                                                            4194304    4194304          0             4194304
    java pool                                                             4194304    4194304          0             4194304
    streams pool                                                                0          0          0                   0
    DEFAULT buffer cache                                                616562688  616562688          0           603979776
    KEEP buffer cache                                                           0          0          0                   0
    RECYCLE buffer cache                                                        0          0          0                   0
    DEFAULT 2K buffer cache                                                     0          0          0                   0
    DEFAULT 4K buffer cache                                                     0          0          0                   0
    DEFAULT 8K buffer cache                                                     0          0          0                   0
    DEFAULT 16K buffer cache                                                    0          0          0                   0
    DEFAULT 32K buffer cache                                                    0          0          0                   0
    ASM Buffer Cache                                                            0          0          0           603979776
    13 rows selected.
    SQL>Edited by: CKPT on Sep 19, 2011 8:55 AM

  • Calculating min and max value from number array

    I have array which is having return type Number.i want to calculate min and max value of this array..try to help asap..
    Thanks
    dhanu

    hi there,
    public class MinMax {
         int arr[]= { 27, 3, 42, 18, 243, -43, 6, -8 };
         int min, max;
         public MinMax() {
    // it's very bad way to do it.
    //          min=99999;
    //          max=-99999;
    // this must be as following
                    min = max = arr[0];
              search();
              System.out.println("The minimum value is: "+min);
              System.out.println("The maximum value is: "+max);
         private void search() {
    // and here we can search from <1> index instead of <0>
              for (int j=1; j<arr.length; j++) {
                   if (arr[j]<min) {
                        min=arr[j];
                   else if (arr[j]>max) {
                        max=arr[j];
         public static void main(String args[]) {
              new MinMax();
    there is a bug in the supplied code. Your homework is
    to figure out what it is without posting another
    message for help with your homework.well, i think it's a tragedy :(

  • How do I find the min and max of 4 ints?

    I can't get this to work
    int max = Math.max(enter1, Math.max(enter2, Math.max(enter3, enter4)));
    int min = Math.min(enter1, Math.min(enter2, Math.min(enter3, enter4)));                                                                                                                                                                                                                                                                                                                                                                   

    your code is ok, if you wanna try:
    public class JProof {
    public static void main(String args[]){
    int enter1=10;
    int enter2=15;
    int enter3=8;
    int enter4=9;
    int max = Math.max(enter1, Math.max(enter2, Math.max(enter3, enter4)));
    int min = Math.min(enter1, Math.min(enter2,Math.min(enter3,enter4)));
    System.out.println("the higher is: "+max);
    System.out.println("the lowest is: "+min);
    }

  • To Obtain Min and Max

    i am currently using labview 7.0 and working on agilent 4195A. i am working on this programme where i have to locate the min and max point from the graph so as to locate the resonance frequency. but i tried several derivatives but none of them succeed in helping me to locate my min and max. if anyone have any idea, please let me know. thank you.
    Attachments:
    mapping.vi ‏121 KB

    Hi tyl,
    well you are using LV7.1...
    I made some comments in your vi - please read the development style guide!
    Why don't you use the array min/max operation to get the strongest signal output?
    And please provide some test data - nobody here can test your vi without proper hardware, without your signal, with missing subvis...
    Message Edited by GerdW on 06-22-2007 10:30 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    mapping.vi ‏122 KB

  • Find min and max from a bunch of numbers

    hi,
    i have a bunch of numbers, and i need to find the min and max.
    so i have a arraylist which contains objects....whats the best way to find the min number and max number of all these objects?
    thanks

    You're close, but you can do them all at the same time without temp variables..
    double maximumX = 0;
    double minimumX = 0;
    double maximumY = 0;
    double minimumY = 0;
    for (int i = 0; i < myobjects.size(); i++) {
         mything d2d = (mything) myobjects.get(i);
         maximumX = Math.max(d2d.getBounds().getMaxX(), maximumX);
         minimumX= Math.min(d2d.getBounds().getMinX(), minimumX);
         maximumY = Math.max(d2d.getBounds().getMaxY(), maximumY);
         minimumY = Math.min(d2d.getBounds().getMinY(), minimumY);
    }Since you are dealing with rectangles, you could add them all to an Area and get the bounds of the Area, but that's probably slower.

  • QoS - Min and Max Thresholds

    Hello Everyone,
    I'm studying QoS and I'm wondering how does a Cisco Engineer find out what the best Minimum and Maximum Threshold rates are when using WRED?
    Where would one find these values?
    I'm under the impression that it requires a study that's based on the size of the queues, is that correct?
    But then, I come to the conclusion that even if the queues are big enough, application critical data like (VOIP) would suffer from delay..
    So, how do you calculate the min and max threshold values..
    Thanks ahead of time..
    PR

    Disclaimer
    The  Author of this posting offers the information contained within this  posting without consideration and with the reader's understanding that  there's no implied or expressed suitability or fitness for any purpose.  Information provided is for informational purposes only and should not  be construed as rendering professional advice of any kind. Usage of this  posting's information is solely at reader's own risk.
    Liability Disclaimer
    In  no event shall Author be liable for any damages whatsoever (including,  without limitation, damages for loss of use, data or profit) arising out  of the use or inability to use the posting's information even if Author  has been advised of the possibility of such damage.
    Posting
    Setting WRED parameters, for optimal performance, is (IMO) very tedious.  Lots of variables involved.
    For starters, it shouldn't normally be applied to traffic that's not rate-adaptive, such as VoIP.
    It works best for multiple large bulk data transfer TCP streams that are using dropped packets for their principle flow control.  Then it can be optimized to maximize their "goodput".
    To answer your question, you might study RED literature, and its many variants, found on the Internet.
    You also want to study, if you're not already very familiar, with how adaptive flow rate protocols, such as TCP, behave when packets are dropped.  (With TCP also be mindful of the different "flavors", i.e. Tahoe, Reno, New-Reno, etc.)
    If you have specific questions, post again to this thread, and I might be able to help.

  • Capturing min and max of a func. generated sine wave

    I need to identify (in real time) the min and max values of a continuous sine wave (whose amplitude may vary). I need to capture the value of each min and max and the time of each such occurrence.

    If the sine wave is in the form of a waveform data type, then all you have to use is the Waveform Min Max function. This does all that you want including returning the time values. There's even an example under Help>Fundamentals>Waveforms>Waveform Operations.

  • Difference of value of a dimension based on min and max

    Database: Oracle 10g
    BO-BOXIr3
    Let me explain the exact problem again.
    As per the below code, I have the data in this format in my table:
    Code:
    Date              Site ID     KWH
    1/2/2009 00:00     IN-1     22
    1/2/2009 01:00     IN-1     28
    1/3/2009 03:00     IN-2     25
    1/3/2009 04:00     IN-2     46
    1/4/2009 00:00     IN-3     28
    1/4/2009 10:00     IN-3     34
    1/5/2009 08:00     IN-4     31
    1/5/2009 09:00     IN-4     55
    1/5/2009 11:00     IN-4     77
    1/6/2009 00:00     IN-5     34
    Now want to build a report with following columns:
    Site     Count     KWH
    IN-1     2     6 (ex.-28-22)
    IN-2     2     21
    IN-3     2     6
    IN-4     3     46 (ex.-77-31)
    IN-5     2     34
    SITE- distinct site name.
    COUNT-count is number of repetitions of site id between min and max date.
    KWH -(Delta between the min and max date)
    To get the above result I have created 3 report from different queries since not able to get these al in a single report viz Count, Max Value and Min value. Well I have all these 3 reports or table on a single page.
    Count-this report will give the count between the dates
    Max Value-this report will give me the values of kwh for max dates for each site id
    Min Value-this report will give me the values of kwh for min dates for each site id
    Now want to create a single report based on these 3 reports which contains the column
    Site|Count|KWH
    IS IT POSSIBLE?
    Or
    Is it possible to build such report in a single one with all the required column which I mentioned?
    The variables which I created to get the max & min dates,
    Mx_dt= =Max([Query 2].[Hourly]) In ([Query 2].[SITE_ID])
    Mn_dt= =Min([Query 3 (12)].[Hourly]) In ([Query 3 (12)].[SITE_ID])
    For filtering on report used following variables:
    if_st_mn=If([mn_dt])=[Hourly] Then "ok" Else "no"
    if_st_mx =If([mx_dt])=[Hourly] Then "ok" Else "no"
    will filter on "ok" to get the max and min date values.
    rest of the variable in the snap are not usable.

    Yes, you can do it in one report.
    I created a sample report from efashion:
    Year | Lines | Sales Revenue
    2001 | Accessories | $250
    2003 | Accessories | $550
    2001 | City Skirts | $1050
    2003 | City Skirts | $1150...........
    Create 2 variables 1) Count and 2) Difference:
    1) Count  as formula - =Count([Lines]) In Report
    2) Difference as formula - =Sum([Sales revenue]) Where (Max([Year]) In Report = [Year]) - Sum([Sales revenue]) Where (Min([Year]) In Report = [Year])
    You can replace the formula with your report variables. Then just drag Site ID, Count and Difference variables to your report.
    Thanks
    Jai

  • Formula for MIN and MAX per range required in BW

    Good day
    Please assist with the following? I need to create a formula (CKF) in BW Query which will give me the same result as the following formula in Excel.
    What I have is one Key Figure and want to calculate a Score on that key figure.
    Score =Key figure/(MAX(range of ie. column B1 to B50 which contains data for the same KF)-MIN(range of ie. column B50 which contains data for the same KF).
    In excel it's easy, ie" Score =TD completed/(MAX(B28:B130)-MIN(B28:B130)
    If more information is required to assist, please let me know?
    Always appreciated.
    Cornelius

    Thank U so much for responding so fast.
    I did the MIN and MAX formula, but it is only taking the MIN or MAX from the single cell of the applicable key figure and not from a 'range' of cells. This is a further example of what I want to do:
    Cell: B1 = 10
            B2 = 12
            B3 = 15
            B4 = 0
    I want to display the MIN as '0' and the MAX as '15' and then do the calculation per row.
    We are in 3.2x. I want to stay away from structures as I have not done that before.
    Any other assistance will be highly appreciated.
    Cornelius

  • Global Change or filter based on Min and Max dates

    Hi Guys,
    Hopefully there is a genius out there that is an expert with filters and or global changes, I am after a solution and can’t work out if it is possible to do in P6.
    Based on a filter (using codes to select a group of activities) I want to write a value into two date UDF Fields can I:
    Run a global change to give the earliest and latest date in the group and write the result to all tasks in the group? or
    Is there a mindate maxdate option in Global change or filter? Or
    If these tasks were grouped in the activity view can a global change be written to fill down the dates that the summary level is displaying, which are essentially the min and max dates of the groups.  
    I could do this pretty easily in excel but I have over a 100 projects and doing the import one at a time is not feasible.
    I could create LOE’s but as my variables are constantly changing and due to the volume also not an option.
    Summary bars are not an option eithers as I am writing the UDF’s to get all the bars I want on one line, 
    An option for me might be to do it using Legare but I would prefer to see if I can get it done in P6 first.
    Cheers
    Rob

    Yes, you can do it in one report.
    I created a sample report from efashion:
    Year | Lines | Sales Revenue
    2001 | Accessories | $250
    2003 | Accessories | $550
    2001 | City Skirts | $1050
    2003 | City Skirts | $1150...........
    Create 2 variables 1) Count and 2) Difference:
    1) Count  as formula - =Count([Lines]) In Report
    2) Difference as formula - =Sum([Sales revenue]) Where (Max([Year]) In Report = [Year]) - Sum([Sales revenue]) Where (Min([Year]) In Report = [Year])
    You can replace the formula with your report variables. Then just drag Site ID, Count and Difference variables to your report.
    Thanks
    Jai

  • Min and Max in a series

    I am creating an application where I need a data structure that returns the min and max that I have in the series of data. Before I write my own I was wondering if there is a pre-built that does that. I don't want to re-invent the wheel.
    Thanks!

    Don't reinvent the wheel, but don't put racing tires on your dog cart...
    What about using java.util.Collections static max and min methods:
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#max(java.util.Collection)
    This will be simpler than sorting all the data or using a sorted tree.

  • About min and max fonction

    hello,
    i need to know the min and max for my signal but only on parts that i want to define by a trigger. The question is to know how i could(in my while loop) only analyse a aprt of my signal but not the whole one. i can't use a for loop because i need to see my signal all the time.
    thanks

    Guillaume Trager,
    For the triggering part of your application, there are several tutorials and example programs available to you at NI Developer Zone >> Development Library >> Measurement Hardware >> Analog Input/Output >> Analog Input >> Triggering.
    Once you have the proper triggering program, you can use the Waveform Min Max.vi or Waveform Peak detection.vi to analyze your peak data. The Trigger and Gate Express VI may also work as a software trigger.
    Good luck with your application.

  • Highlighting Min and Max Values on each line

    Hello,
    Is it possible to highlight the Min and Max values on each row of a Query. For example I have sales below by product line for the last seven quarters. The user
    would like the Max value (150) for Product Line ABC Highlighted as Green and the Min value (1055) color coded as Red. Like wise for each line - DEF 200 as green and 100 as red and GHI - 400 as green and 100 as red.
    FYQ Q207 Q307 Q407 Q108 Q208 Q308 Q408
    ABC     1500     1200     1400     1050     1100     1100     1100
    DEF     1550     1000     1560     1220     1340     1640     2000
    GHI     1000     2000     3000     4000     3250     2220     3750
    Is this possible using Exceptions? or may be any other means? We are on Bex 7.0
    Best Regards,
    Sanjiv

    Hello Sanjiv,  
    I think it can be done by JavaScript, but needs more effort
    [Use of JavaScript Functions|http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a853bc623c075e10000000a114084/content.htm]
    Try the exception available in the BW[BW Stylesheets|http://help.sap.com/saphelp_nw04/helpdata/en/3f/ca453afbf37b54e10000000a11402f/content.htm]
    SAPBEXformats - Formatting cell (scaling factors)
    SAPBEXexcGood1 - Exception with priority good 1
    SAPBEXexcGood2 - Exception with priority good 2
    SAPBEXexcGood3 - Exception with priority good 3
    SAPBEXexcCritical4 - Exception with priority critical 4
    SAPBEXexcCritical5 - Exception with priority critical 5
    SAPBEXexcCritical6 - Exception with priority critical 6
    SAPBEXexcBad7 - Exception with priority bad 7
    SAPBEXexcBad8 - Exception with priority bad 8
    SAPBEXexcBad9 - Exception with priority bad 9
    See this thread,
    Change the colour of a cell text depending on the value Web Reports (NW04s)
    Thanks
    Chandran
    Edited by: Chandran Ganesan on Mar 19, 2008 4:27 PM

Maybe you are looking for