cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

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