- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Update XML File
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 12:44 PM
09-29-2009 12:44 PM
Update XML File
We have a certain set of tools in production that need to be access controlled through an xml file.
The format of the xml file is attached and I need a way to automate the update to this xml file when a user needs to be added and removed.
There are some 15 tools and the scenarios to consider here while adding a user is that -
1) User that needs a limited set of access to a few tools and not all.
2) Super user with all the access (*)
Thanks,
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 01:26 PM
09-29-2009 01:26 PM
Re: Update XML File
> I need a way to automate the update to this xml file when a user needs to be added and removed.
And so what do you want updated and/or deleted? Do we presume the '
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 01:35 PM
09-29-2009 01:35 PM
Re: Update XML File
Regards,
Allan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 01:50 PM
09-29-2009 01:50 PM
Re: Update XML File
I would certainly use Perl. CPAN has a number of XML parsing modules to do the heavy lifting.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 02:23 PM
09-29-2009 02:23 PM
Re: Update XML File
Thanks,
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 05:29 PM
09-29-2009 05:29 PM
Re: Update XML File
I figured a way to design this and implement in bash ...
Plan to have a few intermediate files before the actual xml is uploaded.
One of the intermediate files would be a xml template file which has the required XML for adding a user. This template file would have sample data which would be replaced by "sed -e" and populated to a txt file and appended to the target xml access file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 04:20 AM
09-30-2009 04:20 AM
Re: Update XML File
> I figured a way to design this and implement in bash ...Plan to have a few intermediate files before the actual xml is uploaded. One of the intermediate files would be a xml template file which has the required XML for adding a user. This template file would have sample data which would be replaced by "sed -e" and populated to a txt file and appended to the target xml access file.
That sounds like a viable solution.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2009 03:01 PM
10-06-2009 03:01 PM
Re: Update XML File
I was able to make the script and got it working, Can you review it and suggest any improvements in coding.
I am not very happy with the multiple sed's, can you modify in someway so that I can avoid multiple sed's.
Attaching the script for your perusal.
Thanks,
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2009 04:32 PM
10-06-2009 04:32 PM
Re: Update XML File
Currently this is how it works
1) Gets the user that needs to be added along with the tools that he will have access to from a file(1).(wget and get the file1)
2) I replace the values in a template file(2) ( which is currently has fields for one user only) with the values from file(1) and generate a append file(3).
3)The append-file is appended to the target xml file(4).
This solves for adding a user but not for deleting or any other scenario - lets say a user who is already added needs access to few more tools or he needs to be deleted.
My question is how can I make changes to make current script so that if I get file(1) with multiple users it can handle that and generates a brand new XML file instead of appending it.