Link to home
Start Free TrialLog in
Avatar of DevSupport
DevSupport

asked on

get resource values from xml

Please see the attached XML, there are multiple resources,

I want to be able to find the resource whose name is "jdbc/PegaRULES" and create a new xml file which has only that resource.

For example: newfile.xml should be like:

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
	
<Resource
			auth="Container"
			name="jdbc/PegaRULES"
			type="javax.sql.DataSource"
			maxActive="100"
			maxIdle="30"
			maxWait="10000"
			username="user1"
			password="password1!"
			driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
			url="jdbc:sqlserver://server1;databaseName=db1;SelectMethod=cursor;SendStringParametersAsUnicode=false"
		/>

<Environment name="prconfig/database/databases/PegaRULES/defaultSchema" value="rulesval1" type="java.lang.String" /> 
  <Environment name="prconfig/database/databases/PegaDATA/defaultSchema" value="dataval2" type="java.lang.String" />
<!--
		<Environment name="url/initialization/explicittempdir" value="D:/PegaTempDir" type="java.lang.String" />
-->
</Context>

Open in new window


Wondering if this can be done using bash.

Thanks
context_doesnotwork.xml
ASKER CERTIFIED SOLUTION
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial