xslt - complex type with sequence arrangement -


below xslt , there nested complex type.

<xs:complextype name="onlineexpressremitservice">                 <xs:sequence>                     <xs:element minoccurs="0" name="return" type="tns:onlineexpressremitresponse"/>                 </xs:sequence>             </xs:complextype>             <xs:complextype name="onlineexpressremitresponse">                  <xs:complexcontent>                                  <xs:extension base="tns:endpointresponse">                         <xs:sequence>                             <xs:element minoccurs="0" name="description" type="xs:string"/>                             <xs:element minoccurs="0" name="hostresponsecode" type="xs:string"/>                         </xs:sequence>                     </xs:extension>                 </xs:complexcontent>             </xs:complextype>   <xs:complextype name="endpointresponse">                 <xs:sequence>                      <xs:element minoccurs="0" name="response" type="tns:endpointresponseheader"/>                 </xs:sequence>             </xs:complextype>              <xs:complextype name="endpointresponseheader">                 <xs:sequence>                      <xs:element minoccurs="0" name="requesttimestamp" type="xs:string"/>                     <xs:element minoccurs="0" name="responsetimestamp" type="xs:string"/>                     <xs:element name="statuscode" type="xs:int"/>                  </xs:sequence>             </xs:complextype> 

my input xml

   <return>                   <response>                     <requesttimestamp>2015-05-18t11:20:40.201+0800</requesttimestamp>                     <responsetimestamp>2015-05-18t11:20:40.218+0800</responsetimestamp>                     <statuscode>1</statuscode>                  </response>                 <description>successful</description>                 <hostresponsecode>000</hostresponsecode>             </return> 

there no error input xml, not want, expected input description tag , hostresponsecode tag located @ above of response tag

   <return>      <description>successful</description>     <hostresponsecode>000</hostresponsecode>     <response>         <requesttimestamp>2015-05-18t11:20:40.201+0800</requesttimestamp>         <responsetimestamp>2015-05-18t11:20:40.218+0800</responsetimestamp>         <statuscode>1</statuscode>      </response>  </return> 

i did try nested complextype, nested sequence, not working @ all.i lost @ moments, need guidance, please lets me know if others information needed.

when define 1 complex type derived extension, additional elements can go @ end. if want support content model describing, can't extending base complex type in way.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -