I am trying to extract data from XML files.
They all look like this:
<?xml version="1.0" encoding="UTF-8"?><?xml-st
<document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<!--subchilds go here-->
I need to get the following out from this XML and into Variables:
- the version number: 1.0
- the endoding: UTF-8
- the stylesheet href: http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl
- the document xmlns: urn:hl7-org:v3
- the document xmlns:xsi: http://www.w3.org/2001/XMLSchema-instance
- the document xsi:schemaLocation: urn:hl7-org:v3 http://www.accessdata.fda.gov/spl/schema/spl.xsd
From what I understand, my source XML must be checked against a business rules engine. Unfortunately the rules engine is not part of hte script and must be called upon separately.
To answer this, I am writing the six values to a text file.
I have all of the steps done, except the actual extraction from the xml.
How do I proceed? I am using XMLLINT, but the solaris version which does not have the --xpath extension, but I can do cat calls in XMLLINT.
I am open to other options.