Skip to content

Instantly share code, notes, and snippets.

@nielsvanderbeke
Last active December 28, 2015 09:49
Show Gist options
  • Save nielsvanderbeke/7482297 to your computer and use it in GitHub Desktop.
Save nielsvanderbeke/7482297 to your computer and use it in GitHub Desktop.
xmllint and weblogic config.xml parsing
one-liner
=======================
echo "cat //*[local-name()='domain']/*[local-name()='server']/*[local-name()='name']/text()"| xmllint --shell config.xml | grep -v "/ >" | grep -v " -------"
in shell mode
=======================
xmllint --shell config.xml
/ > setns x=http://xmlns.oracle.com/weblogic/domain
domain > dir x:name/text()
TEXT
content=wlsBplUatDomain
domain > dir x:server[*]/x:name/text()
TEXT
content=wlsBplAdminServer
TEXT
content=wlsBplMngdA1
TEXT
activesync.connect.telenet.be
content=wlsBplMngdB1
/ > exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment