Nucleus handler tools › Docs › Context › ChangeXmlAttributeValue
Context.ChangeXmlAttributeValue
Open in the workbench (search, and try it in a handler)
Context.ChangeXmlAttributeValue(
path: string | number | boolean,
xpath: string | number | boolean,
attributeName: string | number | boolean,
attributeValue: string | number | boolean
): boolean
Opens the XML file path (environment variables like %APPDATA% are expanded), sets attribute attributeName to attributeValue on every node matching the XPath xpath, and saves the file. Throws if the file doesn't exist or a matching node lacks that attribute (it doesn't create attributes); returns true.
✎ AI-written, based on Nucleus GenericContext.cs (ChangeXmlAttributeValue). Not from the official docs. Is it wrong? Tell us
path: Full path of the XML file; %VARIABLES% are expanded. The file is saved in place.xpath: XPath selecting the element(s) whose attribute to change, e.g. "//Graphics"; every match is changed.attributeName: Name of an existing attribute on every matched element; a match without it throws.attributeValue: New value for the attribute.
✎ Parameters: AI-written from the Nucleus source.
Is this right?
Tell us what's wrong