Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-14-2009, 10:17 AM
Hess_Joel Hess_Joel is offline
Registered User
 
Join Date: 04-06-2004
Posts: 11
Write XML Element if not exist

I want to query a file for an element with a specific attribute, and if it doesn't exist, add a new element. I keep getting this error:

This name may not contain the '[' character:File-->[<--@FileName='Test']

Attached is an example of what I'm trying,
Attached Files
File Type: bld writexmltest.bld (953 Bytes, 1448 views)
Reply With Quote
  #2  
Old 12-14-2009, 10:32 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
So you want the file

<UpdatedFiles>
<File FileName="PNet.GlobalConstants.dll" From="1.6.3.73" To="1.6.2.16"/>
</UpdatedFiles>

to be updated like this?

<UpdatedFiles>
<File FileName="PNet.GlobalConstants.dll" From="1.6.3.73" To="1.6.2.16"/>
<File FileName="somefilename.ext" />
</UpdatedFiles>

The Write XML action doesn't support creating a new element and attribute like that. You could write some script code in a Run Script action to do the specific query and update you want to do.
http://www.google.com/search?q=msxml+vbscript
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 11:58 AM.


Copyright © 1999-2023 Kinook Software, Inc.