0

Hello I want to dynamically add the branch element which you can see in the XML code down 1 to N times to the code. This will depend on the numbers of branches the company is in.

<branch key=<%= propertycheck(xml, "branch") %>/>

But I did not find out yet how to add an element which looks like this

<branch/>

I only found ways to add elements like this :

<branch></branch> 

My Plan was to add the branch elements first and after that the Attributes. But If i can create both in one operation, its also good^^

Cheers Steven

<address
        firstname=<%= attributecheck(xml, "firstname") %>
        lastname2=<%= attributecheck(xml, "lastname2") %>
        lastname=<%= attributecheck(xml, "lastname") %>>
    <function key=<%= propertycheck(xml, "function") %>/>
    <position key=<%= propertycheck(xml, "position") %>/>
    <saluation key=<%= propertycheck(xml, "saluation") %>/>
    <nameaddition key=<%= propertycheck(xml, "nameaddition") %>/>
    <acadtitle key=<%= propertycheck(xml, "acadititle") %>/>
    <departmentcode key=<%= propertycheck(xml, "departmentcode") %>/>
    <language key=<%= propertycheck(xml, "langauge") %>/>
    <branch key=<%= propertycheck(xml, "branch") %>/>
    <country key=<%= propertycheck(xml, "country") %>/>
    <addresssource key=<%= propertycheck(xml, "addresssource") %>/>
    <addresslock key=""/>
</address>
JoelC
  • 3,664
  • 9
  • 33
  • 38
steve
  • 123
  • 1
  • 14

1 Answers1

0

I'm not seeing the problem. The following code outputs the branch element as you want:

Dim k As String = Nothing
Dim x = <address><branch key=<%= k %>/></address>
Console.WriteLine(x.ToString())

Output is:

<address>
  <branch />
</address>
BlueMonkMN
  • 25,079
  • 9
  • 80
  • 146