cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
john_madden
Level VI

XPath Query() and XML namespaces

I have a bunch of XML documents that I want to put into a data column. I want to use XPath expressions to pull out values from them, by appending columns that contain formulas that make use of the XPath Query() function.

 

Some of my documents have XML-namespace qualified element names. For example, one might look like this:

 

<?xml version="1.0" encoding="UTF-8"?>
<synopsis xmlns="http://www.cap.org/pert/2009/01/" xmlns:colon="http://www.cap.org/pert/2009/01/colon/">
    <clinical>
        <clinicalFindings>
            <clinicalFinding value="mass"/>
        </clinicalFindings>
    </clinical>
    <specimen>
        <procedures>
            <colon:procedure value="segmental colectomy"/>
        </procedures>
        <sites>
            <colon:site value="cecum" primary="true"/>
        </sites>
        <tumorLocations>
            <colon:tumorLocation value="cecum"/>
        </tumorLocations>
    </specimen>
</synopsis>

It appears that Xpath Query() can't understand namespace-qualified names. It gives an XPath error for an XPath of  "/synopsis/specimen/sites/colon:site/@value" or of "/default:synopsis/default:specimen/default:sites/colon:site/@value".

 

If I remove all namespace qualification, it seems to do okay. Unfortunately for me, my documents use XML namespaces a lot.

 

 

Does anyone have experience with the XPath Query() function? Is there a way to make it XML-namespace aware?

0 REPLIES 0

Recommended Articles