0

I am currently trying to create a xml output based on a xsd. The tool i am using is Visual studio 2012. I have pragmatic works installed in it. So I am trying to make use of the TF XML output destination to generate my XML. The problem i am running into is I want a single element to be generated three times with different values mapped to it. Since the transform i am using is a one to one transform , i need to have the xsd to show the element three times. I am pretty new to this. Any help would be appreciated. I did some research and it is asking me to add the minOccurs as 3. But inside the transform tool , it just occurs only once. I need it to appear thrice , so i will be able to map the values. Please can someone guide me and tell if it is possible or guide me in other alternatives.

The xsd snip which i am trying to make it appear three times is

<xs:element name="primarysource">
<xs:complexType >
<xs:sequence>
<xs:element name="reportergivename" type="xs:string"></xs:element>
<xs:element name="reporterfamilyname" type="xs:string"></xs:element>
<xs:element name="reporterstreet" type="xs:string"></xs:element>
</xs:sequence>     
</xs:complexType >      
</xs:element>

The expected output is (something like this so i can map different values to tags in the transform)
(the below is something i am conceptualizing and i am pretty sure its wrong but can something similar to that can be done and it should have the same element name)

<xs:element name="primarysource">
<xs:complexType >
<xs:sequence>
<xs:element name="reportergivename" type="xs:string"></xs:element>
<xs:element name="reporterfamilyname" type="xs:string"></xs:element>
<xs:element name="reporterstreet" type="xs:string"></xs:element>
</xs:sequence>     
<xs:sequence>
<xs:element name="reportergivename" type="xs:string"></xs:element>
<xs:element name="reporterfamilyname" type="xs:string"></xs:element>
<xs:element name="reporterstreet" type="xs:string"></xs:element>
</xs:sequence> 
<xs:sequence>
<xs:element name="reportergivename" type="xs:string"></xs:element>
<xs:element name="reporterfamilyname" type="xs:string"></xs:element>
<xs:element name="reporterstreet" type="xs:string"></xs:element>
</xs:sequence> 
</xs:complexType >      
</xs:element>
Dino
  • 1
  • This is the first time i am dealing with either xml or xsd. So i apologize in advance if this is a very silly question – Dino Jun 22 '16 at 16:52
  • i finally found the answer http://stackoverflow.com/questions/38334603/defining-an-xsd-with-same-attribute-and-element-name/38338870#38338870 – Dino Jul 12 '16 at 21:06

0 Answers0