Home »
Public Forums »
archive »
modify the attribute value within a tag container
modify the attribute value within a tag container [message #73504] |
Tue, 09 November 2010 12:21 |
Truong Le
Messages: 42 Registered: September 2010
|
Member |
|
|
Hi All,
I want to modify the attributes in the element tag container and I
successfully modify
and save them. However, the position of the tag container that I
modified always move
up to the previous line.
For example:
old_file.xml:
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<name creator="me">
<firstname>jonh</firstname>
</name>
after I go into the old_file and modify the attribute from creator =
'me' to 'you' and
save to a new file, the content of the new file looks like this
new_file.xml:
<?xml version="1.0" encoding="utf-8" standalone="no" ?><name
creator="you">
<firstname>jonh</firstname>
</name>
I want the structure to remain the same as the old_file and just have
the creator
attribute changes from "me" to "you".
this is how I did it.
; Get the xml file
doc = OBJ_NEW('IDLffXMLDOMDocument', FILENAME=old_file.xml)
docElement = doc->GetDocumentElement()
; Get the creator attribute
creatorText = docElement->GetAttributeNode('creator')
creatorText->SetValue, 'you'
; Save the input msdb to a new filepathname
doc->Save, FILENAME = 'new_file.xml'
Any helps is greatly appreciated.
Thanks
|
|
|
Current Time: Fri Oct 10 10:16:11 PDT 2025
Total time taken to generate the page: 0.23967 seconds