Hello,
I would like to add Page Break to All Oneway OutlineBoxes in my Journal.
Sort Of
(jrn << XPath("//OutlineBox[contains(./title(), 'Oneway Analysis')]")) << Prepend (Page Break Box());
What is the right expression?
Thank you.
I think "//OutlineBox[@helpKey='Oneway Report']" is what you are looking for:
Names default to here( 1 );
dt = Open ( "$Sample_data/iris.jmp" );
(ow1 = ( dt << Oneway( Y( :Sepal length ), X( :Species ) ) ) ) << Journal;
(ow2 = ( dt << Oneway( Y( :Sepal width ), X( :Species ) ) ) ) << Journal;
(ow3 = ( dt << Oneway( Y( :Petal length ), X( :Species ) ) ) ) << Journal;
(ow4 = ( dt << Oneway( Y( :Petal width ), X( :Species ) ) ) ) << Journal;
{ ow1, ow2, ow3, ow4 } << Close Window;
//By text:
( Current Journal() << XPath("//OutlineBox[contains( text(), 'Oneway')]") ) << Prepend (Page Break Box());
//By helpkey (better):
( Current Journal() << XPath("//OutlineBox[@helpKey='Oneway Report']") ) << Prepend ( Page Break Box() );
Edited to use the helpkey attribute (more robust than title), thank you Justin for the links.
I think "//OutlineBox[@helpKey='Oneway Report']" is what you are looking for:
Names default to here( 1 );
dt = Open ( "$Sample_data/iris.jmp" );
(ow1 = ( dt << Oneway( Y( :Sepal length ), X( :Species ) ) ) ) << Journal;
(ow2 = ( dt << Oneway( Y( :Sepal width ), X( :Species ) ) ) ) << Journal;
(ow3 = ( dt << Oneway( Y( :Petal length ), X( :Species ) ) ) ) << Journal;
(ow4 = ( dt << Oneway( Y( :Petal width ), X( :Species ) ) ) ) << Journal;
{ ow1, ow2, ow3, ow4 } << Close Window;
//By text:
( Current Journal() << XPath("//OutlineBox[contains( text(), 'Oneway')]") ) << Prepend (Page Break Box());
//By helpkey (better):
( Current Journal() << XPath("//OutlineBox[@helpKey='Oneway Report']") ) << Prepend ( Page Break Box() );
Edited to use the helpkey attribute (more robust than title), thank you Justin for the links.
Thank you.
Is there some documentation/tutorial/book with Xpath rules and syntax in JMP?
If you've not seen it, take a look at the Discovery Paper by @Phil_Brown
I would recommend checking out W3School's documentation on XPath for information about specific XPath syntax.
I typically tackle XPath problems by looking at the display tree's underlying XML by sending the Get XML() message to the report layer. Showing the XML in the log, I can see all of the attributes available, even ones that you cannot see by just looking at a report, like the helpKey or charID, which can be helpful for identifying the display objects you need. You can copy the XML into something like xpathtester.com or just use the XML within the XPath Query() JSL function to test out your query, without needing the report to be created.