Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

xml xmlns namespace and xsi_type extractions from xml using bash

Greetings.
I need to know how to pull the values from XML header information:
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
<document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://www.accessdata.fda.gov/spl/schema/spl.xsd">

Open in new window


In addition, in several areas I have tags with xsi_type: attributes in it.  They do not show up in XPATH locations.  (ie. <tag xsi_type="CE" ... />

I am obligated to pull the xmlns, xmlns:xsi, xsi:schemaLocation and the specific tag (assuming I know the xpath to the tag) into a bash variable to do something with it.  Is this possible?

Thanks.
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
<document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://www.accessdata.fda.gov/spl/schema/spl.xsd">
   

Open in new window

Avatar of ahoffmann
ahoffmann
Flag of Germany image

which value in which header?
can you please give an example what to extract from where
Avatar of Evan Cutler

ASKER

I need all of them.
I need to put them into a variable in BASH so I can put it somewhere.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of wilcoxon
wilcoxon
Flag of United States of America 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
Thanks for helping.  I am still looking for answers...but I appreciate the attempt.