1

We are using Xmlwriter object to create xml and using below code to write an attribute: xmlWriter.WriteAttributeString("UIVersion", GetWorkflowAssociationUIVersion(wfa, xmlWriter));

Now after this we execute some lines of code and based on some conditional code our requirement is to change the value of attribute "UIVersion" again. now we cannot use xmlWriter.WriteAttributeString("UIVersion", foldername) as it will create a new attribute. Any inputs on how can we update the attribute

2
  • 2
    Possible duplicate of Modify XML existing content in C# Commented Jul 19, 2017 at 6:00
  • 1
    From the documentation: XmlWriter Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data. Since it's forward-only you can't rewind and rewrite the attribute you previously wrote. Instead, use one of XML editing APIs suggested in the answer linked by @dnickless. Or, just don't write the attribute until you know what you want to write. Commented Jul 19, 2017 at 6:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.