2 Replies Latest reply: Feb 7, 2013 5:38 PM by vladodias RSS

    XSL Transformation between arrays

    saeed zamani
      Dear all
      I create to XSD for my variables:

      <?xml version="1.0" encoding="UTF-8" ?>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:ns="http://www.asre-andishe.com/Inspec/General"
      targetNamespace="http://www.asre-andishe.com/Inspec/General"
      elementFormDefault="qualified">
      <xsd:complexType name="AgentArrayType">
      <xsd:sequence>
      <xsd:element name="Agent" type="ns:AgentType" maxOccurs="unbounded"/>
      </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="AgentType">
      <xsd:sequence>
      <xsd:element name="user" type="xsd:string"/>
      </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="Agent" type="ns:AgentType"></xsd:element>
      <xsd:element name="AgentsArray" type="ns:AgentArrayType"></xsd:element>

      </xsd:schema>

      and the other one:

      <?xml version="1.0" encoding="UTF-8" ?>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:ns="http://www.asre-andishe.com/Inspec/DetermineInspec/retrive/relam"
      targetNamespace="http://www.asre-andishe.com/Inspec/DetermineInspec/retrive/relam"
      elementFormDefault="qualified">
      <xsd:complexType name="RelamAgentType">
      <xsd:sequence>
      <xsd:element name="user" type="xsd:string" maxOccurs="unbounded"/>
      </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="RelamAgents" type="ns:RelamAgentType"></xsd:element>
      </xsd:schema>
      ----------------------------

      I create two empty variable and then initialized the second variable

      <RelamAgents>
      <user>john</user>
      <user>david</user>
      <user>jack</user>
      </RelamAgents>

      after that i use a transformation XSL and the second variable has been filled without no problem.

      <AgentsArray>
      <ns0:Agent>
      <ns0:user>john</ns0:user>
      </ns0:Agent>
      <ns0:Agent>
      <ns0:user>david</ns0:user>
      </ns0:Agent>
      <ns0:Agent>
      <ns0:user>jack</ns0:user>
      </ns0:Agent>
      </AgentsArray>

      but when i fill the first variable by receiving the output parameter from a service call, the XSL transformation did not work at all and the second variable remains empty.
      I have checked the first variable and i am sure that it is not null and it has the same vale:
      <RelamAgents>
      <user>john</user>
      <user>david</user>
      <user>jack</user>
      </RelamAgents>

      Would anybody please help me with this problem?
      Thank you very much