Ayuda de codificación xPathEstoy intentando aprender/usar xPath para recuperar elementos de JMP Display Output.Para mi aprendizaje, tengo una salida bivariada muy simple y estoy intentando recuperar la fórmula de predicción, directamente desde la salida de la pantalla.

El JSL
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" )} )
);
La cuestión:
Puedo recuperar fácilmente la fórmula usando la llamada Mostrar árbol de
zap = report(ow)["Linear Fit"][TextBox(1)] << get text;
También puedo acceder a él recuperando el texto del cuarto cuadro de texto desde una recuperación de xPath.
zip = (report(ow) << XPath("//TextEditBox"))[4] << get text ;
Pero dado que el valor de 4 para el subíndice, puede cambiar si se agregan ajustes adicionales, etc.Me gustaría usar xPath para recuperar el primer cuadro de texto después de un cuadro de contorno que tiene el valor de "Ajuste lineal"
¿Alguno de ustedes, expertos en xPath, tiene una solución?
Automatización y secuencias de comandosExploración y visualización de datosIngeniería de Calidad y ProcesosRe: Ayuda con codificación xPathPUEDES abordarlo de esa manera, Jim, pero esa manera subvierte el objetivo del lenguaje XPath. Se supone que debe hacer todo el trabajo por usted.
Re: Ayuda con codificación xPathAquí hay algunas otras expresiones xpath que me han resultado útiles para navegar por la estructura de árbol.
// 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 << xpath("//OutlineBox[text()='Summary of Fit']/*");
// Gets all descendants of the Outlinebox (TableBox AND all of its ColBoxes)
rpt << 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 << xpath("//OutlineBox[text()='Summary of Fit']/following-sibling::*")
// Gets preceding elements at the same level of the tree (TextEditBox with formula)
rpt << xpath("//OutlineBox[text()='Summary of Fit']/preceding-sibling::*")
// Gets ancestors of the box (ListBox, OutlineBox["Linear Fit"], IfBox, OutlineBox["Bivariate Fit..."])
rpt << xpath("//OutlineBox[text()='Summary of Fit']/ancestor::*")Esta es la estructura de árbol por la que se navega en los ejemplos.

Este cartel tiene aún más ejemplos. https://community.jmp.com/t5/Discovery-Summit-2015/JMP-Discovery-2015-Mining-JMP-Reports-v10-pdf/ta-p/22595
Re: Ayuda con codificación xPath¡Muchas gracias!Re: Ayuda con codificación xPathrpt=ow<<REPORT></REPORT>
Re: Ayuda con codificación xPathSúper......
Sigo pensando que debe haber una manera de devolver el valor de un TextEditBox después de detectar un OutlineBox específico, es decir, devolver el primer cuadro de texto después de un Outline Box específico.
Re: Ayuda con codificación xPath¡Ajá! ¡Esta sintaxis funciona!
biv rep << XPath( "//TextEditBox[contains(text(),\!"=\!")]/text()" );
Re: Ayuda con codificación xPathDeberías poder hacerlo todo con XPath. El primer ejemplo te da todos los textos. El segundo ejemplo intenta utilizar una función XPath, pero no consigo que la sintaxis funcione.
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = dt << Bivariate( Y( :weight ), X( :height ), Fit Line( 1 ) );
biv rep = biv << Report;
// get all texts in a list
biv rep << XPath( "//TextEditBox/text()" );
// get specific text
target = "=";
biv rep << XPath( "//TextEditBox/[contains(text(),target)]/text()" );