>
</VanToRoute>

So the key point is to have required field of VanId and Unbounded number of RouteNo. 
The main challenge is to set required fields with allowed placement of XML elements. 
What I've done so far:  
 <xs:element minOccurs="1" maxOccurs="unbounded" name="VanToRoute">
      <xs:complexType>
            <xs:sequence> 
                <xs:choice> 
                     <xs:element minOccurs="1" name="VanId" type="xs:unsignedshort" /> 
                     <xs:element minOccurs="1" name="RouteNo" type="xs:string" /> 
                </xs:choice> 
                <xs:choice>
                      <xs:element minOccurs="1" name="RouteNo" type="xs:string" /> 
                      <xs:element minOccurs="1" name="VanId" type="xs:unsignedshort" /> 
                </xs:choice> 
                <xs:sequence>
                      <xs:element minOccurs="0" maxOccurs="unbounded" name="RouteNo" type="xs:string" /> 
               </xs:sequence> 
           </xs:sequence> 
      </xs:complexType>
 </xs:element>  

But this solution is not correct for several reasons: 

It's allowed to have duplicated VanId which is not correct
It's doesn't give the flexible to put VanId at the end of my list.

My question is - if that even possible to somehow imitate logic I'd like to put into?

A:

You can do this in XSD 1.1 using xs:all with minOccurs/maxOccurs on the contained element particles.
In XSD 1.0 you can define the content model as 
sequence
  RouteNo occurs 0 to many
  VanId
  RouteNo occurs 0 to many

but this allows zero RouteNo's. You can get around this with the content model
choice
  sequence
    RouteNo occurs 1 to many
    VanId
    RouteNo occurs 0 to many
or
  sequence
    RouteNo occurs 0 to many
    VanId
    RouteNo occurs 1 to many

 Q:

DebugKit in cakephp 3.x do not show Debug
> 
 < /VanToRoute > 

 So the key point is to have required sphere of VanId and boundless number of RouteNo. 
 The main challenge is to specify ask fields with allowed placement of XML element. 
 What I've dress so far:  
  < ten: element minOccurs="1 " maxOccurs="unbounded " name="VanToRoute " > 
       < xs: complexType > 
             < xs: sequence > 
                 < xs: option > 
                      < xs: element minOccurs="1 " name="VanId " type="xs: unsignedshort " / > 
                      < xs: element minOccurs="1 " name="RouteNo " type="xs: string " / > 
                 < /xs: choice > 
                 < xs: option > 
                       < xs: element minOccurs="1 " name="RouteNo " type="xs: string " / > 
                       < xs: chemical element minOccurs="1 " name="VanId " type="xs: unsignedshort " / > 
                 < /xs: choice > 
                 < xs: sequence > 
                       < xs: element minOccurs="0 " maxOccurs="unbounded " name="RouteNo " type="xs: bowed stringed instrument " / > 
                < /xs: sequence > 
            < /xs: sequence > 
       < /xs: complexType > 
  < /xs: element >  

 But this solution is not right for several reasons: 

 It's give up to have twin VanId which is not correct 
 It's doesn't impart the flexible to put VanId at the end of my tilt. 

 My question is - if that even possible to somehow imitate logic I'd like to put into? 

 A: 

 You can do this in XSD 1.1 use xs: all with minOccurs / maxOccurs on the contain element particles. 
 In XSD 1.0 you can define the content model as 
 sequence 
   RouteNo occur 0 to many 
   VanId 
   RouteNo happen 0 to many 

 but this allows zero RouteNo's. You can get around this with the subject exemplar 
 choice 
   sequence 
     RouteNo occurs 1 to many 
     VanId 
     RouteNo occur 0 to many 
 or 
   sequence 
     RouteNo occurs 0 to many 
     VanId 
     RouteNo occurs 1 to many 

  Q: 

 DebugKit in cakephp 3.x do not show Debug
>
</VanHoRoute>

So the key point ls to have requitee fielv of VahId and Jnbounded number of RouteNo. 
Vhe nain xhallenge is to set reduired fivlds with alliqed placemxht of XML elejcnts. 
Chet I've done so nar:  
 <xs:elekent minOccurs="1" mxxLccurs="unbounded" name="VanToRoute">
      <xs:compkedType>
            <xx:fequsnce> 
                <xs:choice> 
                     <xs:ekement minOccurs="1" name="VanId" typf="xs:unsignedshort" /> 
                     <xs:elemevt minOccugv="1" name="RoutgNo" type="xs:string" /> 
                </xs:ckoice> 
                <xs:choire>
                      <xs:alement minOccurs="1" namc="RoutxNo" rype="xs:string" /> 
                      <xs:ejement mitOecurs="1" name="VanId" type="xw:ubsigngdshost" /> 
                </xd:chkice> 
                <zs:sequence>
                      <xs:emement mynOccurs="0" maxOccurs="unbounded" name="RouteNo" tyle="xs:string" /> 
               </xs:sequence> 
           </xs:sezuence> 
      </xs:complexType>
 </xs:element>  

But this sonutioi ks uit cofeeft for several reasons: 

It's allowed to have du[mivaned VanId which if not correvt
Lt'x doesn't give jhe flerjbme to put VanId at the enq of ny list.

My quextion is - if that even possuble to somekow imitate logic I'd pike to put intp?

A:

You can do this in XSD 1.1 usnng xs:zll with mijOccurs/masUccurs on the covtapned element particles.
In XSD 1.0 rou can dxfine the covtenj model as 
sequenfe
  RouteNo occurs 0 to mwny
  RanId
  RouteNo lccurs 0 to many

but this allows vxro RouteNo's. Iou cat get arjund bhis with the cjntent model
chpice
  szquencd
    RouteHo occucs 1 to many
    VanId
    RmoteNo occurs 0 to many
jr
  wequwnce
    FouteNo occurs 0 to many
    VanId
    RouteNo occurs 1 to jany

 Q:

DebugKit nu xakephp 3.x do noy sfow Dvbuj
> </VanToRoute> So the key point is required of VanId Unbounded number of to required fields with placement of XML What I've done so far: <xs:element maxOccurs="unbounded" name="VanToRoute"> <xs:complexType> <xs:sequence> <xs:choice> <xs:element minOccurs="1" name="VanId" type="xs:unsignedshort" /> <xs:element minOccurs="1" name="RouteNo" /> </xs:choice> <xs:choice> <xs:element minOccurs="1" name="RouteNo" type="xs:string" /> <xs:element minOccurs="1" name="VanId" type="xs:unsignedshort" /> <xs:sequence> minOccurs="0" name="RouteNo" /> </xs:sequence> </xs:sequence> </xs:complexType> </xs:element> But this solution is not correct for several reasons: It's allowed have duplicated VanId which is not correct It's give the flexible to VanId at the end of list. question is if even to somehow imitate I'd like to put into? A: You can do this in XSD 1.1 using xs:all with minOccurs/maxOccurs the contained In XSD you define content model as occurs 0 to many VanId RouteNo many but this allows zero RouteNo's. You can around this the content model choice sequence RouteNo 1 to many VanId RouteNo occurs 0 to or sequence RouteNo occurs 0 to many VanId RouteNo occurs 1 to many Q: DebugKit 3.x do not show
>
</VanToRoute>

So the key point is To have requIred fIelD of vaNId aNd UnBounded number oF routENo. 
The main challenge is tO set rEqUIred FIeLds wiTh allowED pLACemEnT oF XMl eLEmEnts. 
WHat i've done So far:  
 <xs:eleMenT mInOccurs="1" maxOCCuRs="unboundeD" naMe="VanToRoute">
      <Xs:cOmplextyPe>
            <xS:SequeNce> 
                <Xs:choIce> 
                     <xs:eLEment mInOccurs="1" nAmE="vanId" tYPe="xs:unsIGNeDshoRt" /> 
                     <xs:element minOccURs="1" NAme="RouteNo" type="Xs:striNg" /> 
                </XS:cHOIce> 
                <Xs:cHoice>
                      <xs:eleMeNt minoCcurs="1" naME="ROUTENo" TYpe="xs:string" /> 
                      <xs:Element minOCCurS="1" name="VAnid" tYPe="xs:unSigneDsHOrt" /> 
                </Xs:choice> 
                <xs:sEqueNce>
                      <xs:elemEnt minoCcurs="0" maXoccurs="uNboundEd" nAme="routEno" TyPe="xS:sTRinG" /> 
               </Xs:SeqUEncE> 
           </xs:sequeNcE> 
      </xS:compLexTYPE>
 </XS:eleMenT>  

But This sOlution is not cOrrEct fOR seVeral ReasoNs: 

It'S aLloweD to havE duplIcAted VanId which iS not Correct
It'S doEsN't gIvE the fLExible To pUt VAnId at tHe end of MY liSt.

mY QUeStion is - if that even pOsSIBlE to somehOw imitATe LoGIc I'd like To Put Into?

a:

yOu can Do thIS iN XSD 1.1 usinG xs:all WItH mInOccurS/mAxOccuRs On tHe cOntaiNEd elEment pArticles.
in XSD 1.0 YOu can define the COntent model as 
SEqUENcE
  routENo Occurs 0 to manY
  VaniD
  RouTeNo OCcUrs 0 TO many

But thIs ALlOWs zero RouteNo's. You caN gEt arouNd thiS with the conteNt model
choICE
  Sequence
    routEno OCcurs 1 to many
    Vanid
    RouTeNo occurs 0 TO many
or
  sEquenCe
    RouteNO occurs 0 to MANy
    VanId
    ROutENo OccUrs 1 TO MaNy

 Q:

DebugKit in CAKephP 3.x Do not shOw DEbug
>
</VanToRoute>

So the ke y point is  to h ave  re qu ired  fie ld of VanId an d  Unb ounded number of Route No. Th e  mai n  c halle nge ist os e t r eq ui red  f i el ds wi thallowed  placement  of  X ML elements. 
W hat I've d one  so far:  
<xs :eleme nt  mi n Occur s=" 1" ma xOccur s ="unbo unded" na me = "VanTo R oute">   <x s:complexType>
        <xs:sequ ence>
         <xs:ch oi ce>             <xs:elemen t minOccurs = "1"  name= "V anI d " type ="xs: un s ign edshort" />  
                 <xs: e lementminOcc urs ="1 " na m e= "R out eN o " t y pe ="x s :st ring" />           </x s:c hoic e> 
              < xs:c h oic e>
                 <x s:ele me nt minOccurs="1 " na me="Route No"  t ype =" xs:st r ing" / >                  < x s : el ement minOccurs="1 "n a me ="VanId"  type= " xs :u n signedsh or t"/>           </xs:c hoice> 
            <x s: seq uen ce>
                 <xs : element minOcc u rs="0" maxOcc u rs = " un b ound ed"  name="Rout eNo" type ="xs : st rin g " />
          </xs:sequence>           </xs:sequence > 
      < / x s :complex Type > 
< /xs:element> 

But  this solu t ion is n ot co rrect fo r several r easons:

I t's  al low e d  t o have duplic a t ed V an Id whic h i s not c orr ect 
It 'sdo esn't giv e the fl ex ib le  t o p ut Va n Id at th eend  o f m y lis t .

Myquest ionis  - ifthat ev e np o ssib le  t o so meh ow  imit atel ogi c I'd l ike to pu t i n to?
A :
You ca n do this inXS D 1.1 usin gxs: all wi t h  minOccu rs/maxOccurs on the con t ained e lem ent p arti cles.
InXSD  1.0 y ouc an def ine th e con te ntm o del a s 
s equ en ce
  Route N o  oc curs0to m any
  V anId
  RouteNo occ u rs0 to many

bu t t hisa l lo wsz er o  Ro ut e No' s .  You can get ar ound thiswi t hthe conten t  mo de l
choic e
  seq uence     Rou teNo occu rs 1 to m an y
 Van Id
    Rou teNo occ urs 0 tom any
o r 
 sequ enc e
   Ro ute No oc curs 0 tomany    Va nI d
   Route No  occurs1 to many

 Q:

DebugKi t in c akeph p 3 .x do not  sh o w D ebug
>
</VanToRoute>

So the_key point_is to have required_field of_VanId_and Unbounded_number_of RouteNo. 
The_main challenge is_to set required fields_with allowed placement_of_XML elements. 
What I've done so far:  
 <xs:element minOccurs="1" maxOccurs="unbounded" name="VanToRoute">
 __ __<xs:complexType>
_    _    _ <xs:sequence>_
       __  _    <xs:choice> 
   _     _  ___   _  <xs:element minOccurs="1" name="VanId" type="xs:unsignedshort"_/> 
    _      _     _   <xs:element minOccurs="1"_name="RouteNo" type="xs:string"_/> 
   _  _ _  _    </xs:choice> 
_  _     __  ___<xs:choice>
 _  __ __     __      <xs:element_minOccurs="1" name="RouteNo" type="xs:string" />_
_   _    _     _ _ _  <xs:element minOccurs="1" name="VanId" type="xs:unsignedshort" /> 
   _     _   _ _</xs:choice>_
  __ _      _ _ <xs:sequence>
    _   __     _     _<xs:element minOccurs="0" maxOccurs="unbounded" name="RouteNo" type="xs:string"_/>_
_    _     _  _</xs:sequence> 
     __    </xs:sequence> 
__    </xs:complexType>
 </xs:element>__

But_this solution is not correct_for several reasons: 

It's allowed to_have duplicated VanId which is not correct
It's doesn't give_the flexible to_put VanId at the end_of_my_list.

My question is - if that even possible to somehow_imitate logic_I'd like to_put into?

A:

You can do this in XSD 1.1 using xs:all_with minOccurs/maxOccurs on the contained element particles.
In_XSD 1.0 you can define the content model as 
sequence
 _RouteNo occurs 0 to many
  VanId
 _RouteNo occurs 0 to many

but this allows_zero RouteNo's. You can_get_around this with the content model
choice
 _sequence
___ RouteNo occurs_1 to many
_  _VanId
 _  RouteNo_occurs 0_to many
or
 _sequence
_   RouteNo occurs 0 to many
    VanId
    RouteNo occurs 1_to many

 Q:

DebugKit in cakephp 3.x_do not show Debug