DaneBigham
asked on
Create a single tag XML element using VBA
I have an MS Access application that generates XML, using the MSXML2 DOM object. I have code that looks like this:
Which creates output like this:
<FieldName>UNIT="in" VALUE="0.13529"</FieldName >
However, I'd like the output to result in a single tag, looking like this:
<FieldName UNIT="in" VALUE="0.13529" />
Is there a setting or attribute I can tweak to get the desired result?
Thanks in advance.
Set objSubElem = objDoc.createElement("FieldName")
objElem.appendChild objSubElem
objSubElem.Text = "UNIT=""in"" VALUE=""" & rs("Field1") & """"
Which creates output like this:
<FieldName>UNIT="in" VALUE="0.13529"</FieldName
However, I'd like the output to result in a single tag, looking like this:
<FieldName UNIT="in" VALUE="0.13529" />
Is there a setting or attribute I can tweak to get the desired result?
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER