I try to get a numbering on the contacts
I've got following :
---
// remark other fields from the xml that are not from the contacts I left out to shorten this post on stackoverflow
<ns0:contacts recordnr="0">
<ns0:name/>
<ns0:tel/>
<ns0:gsm/>
<ns0:fax/>
<ns0:email/>
<ns0:website/>
</ns0:contacts>
<ns0:contacts recordnr="1">
<ns0:name/>
<ns0:tel/>
<ns0:gsm/>
<ns0:fax/>
<ns0:email/>
<ns0:website/>
</ns0:contacts>
<ns0:contacts recordnr="2">
<ns0:name/>
<ns0:tel/>
<ns0:gsm/>
<ns0:fax/>
<ns0:email/>
<ns0:website/>
</ns0:contacts>
---
I would want to change it like this :
// remark other fields from the xml that are not from the contacts I left out to shorten this post on stackoverflow
---
<ns0:contacts>
<ns0:name/>
<ns0:tel/>
<ns0:gsm/>
<ns0:fax/>
<ns0:email/>
<ns0:website/>
</ns0:contacts>
<ns1:contacts>
<ns1:name/>
<ns1:tel/>
<ns1:gsm/>
<ns1:fax/>
<ns1:email/>
<ns1:website/>
</ns1:contacts>
<ns2:contacts>
<ns2:name/>
<ns2:tel/>
<ns2:gsm/>
<ns2:fax/>
<ns2:email/>
<ns2:website/>
</ns2:contacts>
---
Or if not possible on each separated field, at least a different number on the contacts section, like for the 3th contact :
<ns2:contacts>
<ns0:name/>
<ns0:tel/>
<ns0:gsm/>
<ns0:fax/>
<ns0:email/>
<ns0:website/>
</ns2:contacts>
My XSD type for the Contacts looks like this :
<xsd:complexType name="ContactsType">
<xsd:sequence>
<xsd:element name="name" maxOccurs="1" minOccurs="0"
type="xsd:string"/>
<xsd:element name="tel" maxOccurs="1" minOccurs="0"
type="xsd:string"/>
<xsd:element name="gsm" maxOccurs="1" minOccurs="0"
type="xsd:string"/>
<xsd:element name="fax" maxOccurs="1" minOccurs="0"
type="xsd:string"/>
<xsd:element name="email" maxOccurs="1" minOccurs="0"
type="xsd:string"/>
<xsd:element name="website" maxOccurs="1" minOccurs="0"
type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="recordnr" type="int"/>
</xsd:complexType>
My XSD type (adminstakeholder) that includes the XSD Contacts looks like this :
<xsd:complexType name="AdminStakeholderType">
<xsd:sequence>
<xsd:element name="ashId" maxOccurs="1" minOccurs="1"
type="xsd:long"/>
<xsd:element name="isLegalPerson" type="xsd:boolean"
minOccurs="1" maxOccurs="1"/>
<xsd:element name="naturalPerson" maxOccurs="1"
minOccurs="0" type="tns:NaturalPersonType"/>
<xsd:element name="legalPerson" maxOccurs="1" minOccurs="0"
type="tns:LegalPersonType"/>
<xsd:element name="category" maxOccurs="1" minOccurs="0"
type="tns:CategoryType"/>
<xsd:element name="orafinNumber" maxOccurs="1" minOccurs="0"
type="xsd:string"/>
<xsd:element name="address" maxOccurs="1" minOccurs="0"
type="tns:AddressType"/>
<xsd:element name="contacts" maxOccurs="10"
minOccurs="0"
type="tns:ContactsType"/>
<xsd:element name="synonyms" maxOccurs="1"
minOccurs="0" type="tns:SynonymsType"/>
<xsd:element name="kbo" maxOccurs="1" minOccurs="0"
type="tns:KboType"/>
</xsd:sequence>
</xsd:complexType>
This schema is used : xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
In the examples I left out the real data values, just showing the empty fields.
Basically what I need is the prefix "ns" is to be followed by a incrementing or unique number for each record of Contact. I order to get this, I created a attribute "recordnr" but that's not conform the business requirements. I do not want to see the recordnr attribute in the output XLK. I need the value from that recordnr following the prefix "ns" or, not using the recordnr but a autoincrementing number.
Anyone has a suggestion ?
All help appreciated