jdhackett
asked on
XML Writer - two elements in one line
I'm using XMLWriter in VB.Net 2005.
I'm trying to get an XML output that looks like:
<Employees>
<NumberEmployed Category="111">1</NumberEm ployed>
<NumberEmployed Category="006">1</NumberEm ployed>
</Employees>
But I can't figure out what I must do. My existing code is below, which gives me an output like
<NumberEmployed Category="111" N="1" />
What must I change?
Thanks
I'm trying to get an XML output that looks like:
<Employees>
<NumberEmployed Category="111">1</NumberEm
<NumberEmployed Category="006">1</NumberEm
</Employees>
But I can't figure out what I must do. My existing code is below, which gives me an output like
<NumberEmployed Category="111" N="1" />
What must I change?
Thanks
Private Sub Add_NumberEmployed(ByVal iNumEmps As Integer, ByVal stCategory As String)
' Add number employed for the Category
With HB_Writer
.WriteStartElement("NumberEmployed")
.WriteAttributeString("Category", stCategory)
.WriteAttributeString("N", iNumEmps)
.WriteEndElement()
End With
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.