<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: xPath coding help in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326457#M57578</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rpt=ow&amp;lt;&amp;lt;report;
actText=(rpt &amp;lt;&amp;lt; xpath("//OutlineBox[text()='Linear Fit']//TextEditBox"))[1]&amp;lt;&amp;lt;get text;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Oct 2020 12:13:30 GMT</pubDate>
    <dc:creator>tonya_mauldin</dc:creator>
    <dc:date>2020-10-26T12:13:30Z</dc:date>
    <item>
      <title>xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326222#M57538</link>
      <description>&lt;P&gt;I am attempting to learn/use xPath in retrieving elements from the JMP Display Output.&amp;nbsp; For my learning, I have a very simple Bivariate output, and I am attempting to retrieve the Prediction formula, directly from the display output.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xpath.PNG" style="width: 286px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27646iA6779D6DC4942754/image-dimensions/286x539?v=v2" width="286" height="539" role="button" title="xpath.PNG" alt="xpath.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The JSL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = Open("$Sample_Data/big class.jmp");

ow = Bivariate(
	Y( :weight ),
	X( :height ),
	Fit Line( {Line Color( "Medium Dark Green" )} )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The Issue:&lt;/P&gt;
&lt;P&gt;I can easily retrieve the formula using the Display Tree call of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;zap = report(ow)["Linear Fit"][TextBox(1)] &amp;lt;&amp;lt; get text;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I can also access it by retrieving the text from the 4th TextBox from an xPath retrieval&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;zip = (report(ow) &amp;lt;&amp;lt; XPath("//TextEditBox"))[4] &amp;lt;&amp;lt; get text ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But since the value of 4 for the subscript, may change if additional fits are added etc.&amp;nbsp; I would like to use xPath to retrieve the 1st textbox after an outlinebox that has the value of "Linear Fit"&lt;/P&gt;
&lt;P&gt;Do any of you xPath experts have a solution.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:41:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326222#M57538</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-06-09T23:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326246#M57544</link>
      <description>&lt;P&gt;You should be able to do it all with XPath. The first example gives you all the texts. The second example tries to use an XPath function, but&amp;nbsp;I can't get the syntax to work, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

biv = dt &amp;lt;&amp;lt; Bivariate( Y( :weight ), X( :height ), Fit Line( 1 ) );

biv rep = biv &amp;lt;&amp;lt; Report;

// get all texts in a list
biv rep &amp;lt;&amp;lt; XPath( "//TextEditBox/text()" );

// get specific text
target = "=";
biv rep &amp;lt;&amp;lt; XPath( "//TextEditBox/[contains(text(),target)]/text()" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Oct 2020 19:50:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326246#M57544</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-10-24T19:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326248#M57546</link>
      <description>&lt;P&gt;Aha! This syntax works!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;biv rep &amp;lt;&amp;lt; XPath( "//TextEditBox[contains(text(),\!"=\!")]/text()" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Oct 2020 20:04:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326248#M57546</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-10-24T20:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326249#M57547</link>
      <description>&lt;P&gt;Super......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am still thinking there must be a way to return the value from a TextEditBox after detecting a specific OutlineBox, i.e.return the first text box after a specified Outline Box&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 02:30:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326249#M57547</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-25T02:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326457#M57578</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rpt=ow&amp;lt;&amp;lt;report;
actText=(rpt &amp;lt;&amp;lt; xpath("//OutlineBox[text()='Linear Fit']//TextEditBox"))[1]&amp;lt;&amp;lt;get text;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Oct 2020 12:13:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326457#M57578</guid>
      <dc:creator>tonya_mauldin</dc:creator>
      <dc:date>2020-10-26T12:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326458#M57579</link>
      <description>Thank you very much!</description>
      <pubDate>Mon, 26 Oct 2020 13:06:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326458#M57579</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-26T13:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326500#M57581</link>
      <description>&lt;P&gt;Here are some other xpath expressions that I've found helpful for navigating the tree structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Note: the * in these examples can also be replaced by the class of
// the element you are looking for e.g. TableBox, OutlineBox

rpt = report(ow);

// Gets immediate children of the Outlinebox (ItsTableBox)
rpt &amp;lt;&amp;lt; xpath("//OutlineBox[text()='Summary of Fit']/*");

// Gets all descendants of the Outlinebox (TableBox AND all of its ColBoxes)
rpt &amp;lt;&amp;lt; xpath("//OutlineBox[text()='Summary of Fit']//*"); 

// Gets following elements at the same level of the tree
//(Lack of Fit, Analysis of Variances, Parameter Estimates OutlineBoxes)
rpt &amp;lt;&amp;lt; xpath("//OutlineBox[text()='Summary of Fit']/following-sibling::*")

// Gets preceding elements at the same level of the tree (TextEditBox with formula)
rpt &amp;lt;&amp;lt; xpath("//OutlineBox[text()='Summary of Fit']/preceding-sibling::*")

// Gets ancestors of the box (ListBox, OutlineBox["Linear Fit"], IfBox, OutlineBox["Bivariate Fit..."])
rpt &amp;lt;&amp;lt; xpath("//OutlineBox[text()='Summary of Fit']/ancestor::*")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is the tree structure being navigated in the examples.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ben_ph_0-1603721356327.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27657i6FB2430BCAEB9F6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ben_ph_0-1603721356327.png" alt="ben_ph_0-1603721356327.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This poster has even more examples &lt;A href="https://community.jmp.com/t5/Discovery-Summit-2015/JMP-Discovery-2015-Mining-JMP-Reports-v10-pdf/ta-p/22595" target="_blank"&gt;https://community.jmp.com/t5/Discovery-Summit-2015/JMP-Discovery-2015-Mining-JMP-Reports-v10-pdf/ta-p/22595&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 14:28:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326500#M57581</guid>
      <dc:creator>ben_ph</dc:creator>
      <dc:date>2020-10-26T14:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: xPath coding help</title>
      <link>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326509#M57585</link>
      <description>&lt;P&gt;You CAN approach it that way, Jim, but that way subverts the point of XPath language. It is supposed to do all the work for you.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 16:06:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/xPath-coding-help/m-p/326509#M57585</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-10-26T16:06:21Z</dc:date>
    </item>
  </channel>
</rss>

