Notifications
Clear all

[Closed] adding an array inside an attribute using xmlwriter

I’m trying to include this array inside an xml based on this: http://enemcee.com/blog/?p=86


boneUsed_array = #("Head", "LeftArm", "LeftFoot", "LeftForeArm", "LeftHand", "LeftHandIndex1", "LeftHandIndex2", "LeftHandIndex3", "LeftHandMiddle1", "LeftHandMiddle2", "LeftHandMiddle3", "LeftHandPinky1", "LeftHandPinky2", "LeftHandPinky3", "LeftHandRing1", "LeftHandRing2", "LeftHandRing3", "LeftHandThumb1", "LeftHandThumb2", "LeftHandThumb3")

using those:

  
 local xmlFormatter = dotnetobject "System.Xml.XmlWriterSettings"
    xmlFormatter.Indent = true
 
    local XMLWriter = dotnetclass "System.Xml.XmlWriter"
    XMLWriter = XMLWriter.Create xmlFile xmlFormatter

but when I use:

XmlWriter.WriteAttributeString "Name" (boneUsed_array as string )

I get:

<BoneUsed Name="#("Head", "LeftArm", "LeftFoot", "LeftForeArm", "LeftHand",

I get that i’m that im converting my array to a string it things get messed up but I searched the various methods but wasnt able to find a good lead.

so far only the writevalue methods gave the desired results but would it be better to store the array inside an attribute or just leave it in a blank value?

1 Reply

nvm, solution found.