I am doing an EDI app in BizTalk. I am not proficient in XSLT, so I'm attempting to use VB.NET to create what I need. I have an XML format that I am translating data into in this format:
<L11>
<L1101/>
<L1102/>
</L11>
I have figured out that it will take an xmlElement object data type. I have the following code:
dim x as xml.xmlelement
dim y as xml.xmlelement
doc as new system.xml.xmldocument
x= doc.createelement("L11")
'Loop that builds a string that's not relevant this part works.
y=doc.CreateElement("L1101", "L1101")
y.innertext = sFirst 'One of the built strings.
x.appendchild
y=doc.CreateElement("L1102", "L1102")
y.innertext = sLast 'One of the built strings.
x.appendchild
sFirst=""
sLast=""
'End Loop
Oh and at the end the function returns X
My problem is that when I direct the output of this to my XML document, I get this:
<L11>18553818TN10072709SI1452354CN</L11>
Instead of:
<L11>
<L1101>18553818</L1101>
<L1102>TN</L1102>
<L1101>10072709</L1101>
<L1102>SI</L1102>
<L1101>1452354</L1101>
<L1102>CN</L1102>
</L11>
Am I missing some property or something that I need to set in the XML element object?
Thanks,
Brian
<L11>
<L1101/>
<L1102/>
</L11>
I have figured out that it will take an xmlElement object data type. I have the following code:
dim x as xml.xmlelement
dim y as xml.xmlelement
doc as new system.xml.xmldocument
x= doc.createelement("L11")
'Loop that builds a string that's not relevant this part works.
y=doc.CreateElement("L1101", "L1101")
y.innertext = sFirst 'One of the built strings.
x.appendchild
y=doc.CreateElement("L1102", "L1102")
y.innertext = sLast 'One of the built strings.
x.appendchild
sFirst=""
sLast=""
'End Loop
Oh and at the end the function returns X
My problem is that when I direct the output of this to my XML document, I get this:
<L11>18553818TN10072709SI1452354CN</L11>
Instead of:
<L11>
<L1101>18553818</L1101>
<L1102>TN</L1102>
<L1101>10072709</L1101>
<L1102>SI</L1102>
<L1101>1452354</L1101>
<L1102>CN</L1102>
</L11>
Am I missing some property or something that I need to set in the XML element object?
Thanks,
Brian