LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading xsd file

Hello to all,
 
i need help, i have to read a *.xsd file to labview the problem that i can see that some of the parameters range is impposible to prahse easly,
 
for exsample one parameter's range is :
 
<xs:element name="xxxxx" default="2350.75" nillable="true">
                    <xs:simpleType>
                     <xs:restriction base="xs:decimal">
                      <xs:pattern value="230[2-9].(5|625|75|875)0*"/>
                      <xs:pattern value="230[3-9].(0|125|25|375)0*"/>
                      <xs:pattern value="230[3-9]"/>
                      <xs:pattern value="23[1-4][0-9]"/>
                      <xs:pattern value="23[1-4][0-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="235[0-7]"/>
                      <xs:pattern value="235[0-6].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="2357.(0|125|25|375|5)0*"/>
                      <xs:pattern value="249[8-9].(5|625|75|875)0*"/>
                      <xs:pattern value="2499.(0|125|25|375)0*"/>
                      <xs:pattern value="25[0-9][0-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="26[0-7][0-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="268[0-6].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="2687.(0|125|25|375|5)0*"/>
                      <xs:pattern value="3402.(5|625|75|875)0*"/>
                      <xs:pattern value="340[3-9].(0|125|25|375|5|625|75|875)"/>
                      <xs:pattern value="34[1-9][0-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="35[0-8][0-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="359[0-6].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="3597.(0|125|25|375|5)0*"/>
                      <xs:pattern value="3602.(5|625|75|875)0*"/>
                      <xs:pattern value="360[3-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="36[1-9][0-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="37[0-8][0-9].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="379[0-6].(0|125|25|375|5|625|75|875)0*"/>
                      <xs:pattern value="3797.(0|125|25|375|5)0*"/>
 
how can i understand this!?!? i am just thinking of the number of "mach pattern" i will need i am getting sick...
please someone can help me?
What i can say is that the range should be {2302.500-2357.500; 2498.500-2687.500;3402.500-3597.500;3602.500-3797.500} in steps of 0.125 how can i fillter automaticly those patterns i have no idea.
0 Kudos
Message 1 of 12
(3,893 Views)
no one can help me?
0 Kudos
Message 2 of 12
(3,878 Views)
Those are regular expressions, the match regular expression vi should be able to use those.

I'm not sure what your trying to do, are you trying to generate those patterns or use them to verify something?
I can explain what some of patterns mean if that's what you want. But regular expressions are very useful to know if you ever deal with any kind of text processing. So you might be better off just reading up on them, especially if there's more of these patterns in there.

Matt W


0 Kudos
Message 3 of 12
(3,875 Views)
what i am trying to do is to read all the parameters in the schema and thier range, some parameters have easy ranges like min and max, but in some cases as you can see the range is complecated, how can i read this value and from that to get the range?
i understand the logic of the schema range but there are to many possiblites so i cant use any mach to help me its a problem....
 
0 Kudos
Message 4 of 12
(3,869 Views)
Do you need every number within that range (could be pretty hard), or do you just need to figure whether a given number is within that range (much easier)?
0 Kudos
Message 5 of 12
(3,866 Views)

from all this "crap"  i need to have " {2302.500-2357.500; 2498.500-2687.500;3402.500-3597.500;3602.500-3797.500} in steps of 0.125"

 

0 Kudos
Message 6 of 12
(3,859 Views)
Since it's a holiday season and I wanted an excess to not clean up, here's something that works with the given example, it makes a lot of assumptions on how your schema is defined (mainly that all the patterns constist only of simple [] or (|) structures). Has no error handling, not optimized for speed, and could mess up pretty baddly on unexpected inputs. But it works for the given example and you could use it for ideas.

It needs the openg array and string palletes.


Message Edited by Matt W on 12-24-2007 05:52 AM
0 Kudos
Message 7 of 12
(3,848 Views)
Thanks for the work!
just one more qst, where can i get the openGL files?
0 Kudos
Message 8 of 12
(3,839 Views)
0 Kudos
Message 9 of 12
(3,836 Views)
The problem does not seem too hard.

{top down design}

Thank me for doing this.
A printf function that generates the final human language string.
A printf function inside a for loop that accumulates the string inside the "{" "}".
A for loop that takes the min and max of an array of arrays.
A for loop that divides a sorted array of numbers into an array of arrays where the members of the divisions have the relationship F(N) + 0.125 = F(N+1).
A step to sort an array of numbers.
A function in a for loop that expands a regular expression into an array of numbers and appends this array to a master array in a shift register.
In the function, a routine that adds an array of integer parts to an array of fractional parts resulting in one array where each integer has been added to each fraction. 
In the function, a parser that creates an array of fractional parts, such as spreadsheet string to array.
In the function, a parser that reduces the integer part by examining the integer regular expression from left to right and expanding the integer into an array of integers as square brackets are encountered.
In the function, a parser that divides the expression at the decimal point into two expressions.

I have included a function that reduces the decimal part of the expression, but I have not fully tested it.

You're Welcome.


PS obviously, we alread know that 0.125 is the increment.
0 Kudos
Message 10 of 12
(3,834 Views)