C# XML attribute being created improperly

putr4

New Member
I'm creating a node programmatically, however one of the attributes comes out differently than what I specified in the code:\[code\] XmlNode xResource = docXMLFile.CreateNode(XmlNodeType.Element, "resource", docXMLFile.DocumentElement.NamespaceURI); XmlAttribute xRefIdentifier = docXMLFile.CreateAttribute("identifier"); XmlAttribute xRefADLCP = docXMLFile.CreateAttribute("adlcp:scormtype"); XmlAttribute xRefHREF = http://stackoverflow.com/questions/10884924/docXMLFile.CreateAttribute("href"); XmlAttribute xRefType = docXMLFile.CreateAttribute("type"); xRefIdentifier.Value = "http://stackoverflow.com/questions/10884924/RES-" + strRes; xRefADLCP.Value = "http://stackoverflow.com/questions/10884924/sco"; xRefHREF.Value = http://stackoverflow.com/questions/10884924/dataRow["launch_url"].ToString().ToLower(); xRefType.Value = "http://stackoverflow.com/questions/10884924/webcontent"; xResource.Attributes.Append(xRefIdentifier); xResource.Attributes.Append(xRefADLCP); xResource.Attributes.Append(xRefHREF); xResource.Attributes.Append(xRefType);\[/code\]This ends up creating a line like the following. Note that 'adlcp:scormtype' has morphed into 'scormtype' which is not what I specified. Any ideas how to get it to show what I put in the CreateAttribute?\[code\] <resource identifier="RES-CDA68F64B849460B93BF2840A9487358" scormtype="sco" href="http://stackoverflow.com/questions/10884924/start.html" type="webcontent" />\[/code\]
 
Back
Top