Getting debugging view to show context node?

Here should go questions about transforming XML with XSLT and FOP.
RBVanDyke
Posts: 45
Joined: Wed Feb 11, 2015 11:25 pm
Location: San Francisco, California USA
Contact:

Getting debugging view to show context node?

Post by RBVanDyke » Fri Mar 29, 2019 2:50 am

For oXygen 21.

As part of learning XSLT I'm doing examples from a book. But oXygen XML, debug view, Nodes/Values Set panel isn't displaying the transform's context node.

Here's the target XML:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<menu>
<appetizers title="Work up an Appetite">
<dish id="1" price="8.95">Crab Cakes</dish>
<dish id="2" price="9.95">Jumbo Prawns</dish>
<dish id="3" price="10.95">Smoked Salmon and Avocado Quesadilla</dish>
<dish id="4" price="6.95">Caesar Salad</dish>
</appetizers>
<entrees title="Chow Time!">
<dish id="5" price="19.95">Grilled Salmon</dish>
<dish id="6" price="17.95">Seafood Pasta</dish>
<dish id="7" price="16.95">Linguini al Pesto</dish>
<dish id="8" price="18.95">Rack of Lamb</dish>
<dish id="9" price="16.95">Ribs and Wings</dish>
</entrees>
<desserts title="To Top It Off">
<dish id="10" price="6.95">Dame Blanche</dish>
<dish id="11" price="5.95">Chocolat Mousse</dish>
<dish id="12" price="6.95">Banana Split</dish>
</desserts>
</menu>
Here's the XSLT (which transforms as expected):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/menu/appetizers"> -<xsl:value-of
select="dish[1]/ancestor::*[1]/@title"/> -<xsl:value-of
select="dish[1]/ancestor::menu/entrees/@title"/>
</xsl:template>

<xsl:template match="/menu/entrees"/>
<xsl:template match="/menu/desserts"/>

</xsl:stylesheet>
I've read the HELP topic Tree View for Presenting Node Set Values.

But for whatever reason -- probably because I don't know what I'm doing -- NOTHING appears in the Nodes/Values Set panel.

As part of learning and future debugging, how can I get oXygen XML Editor to tell me what the current context node[\i] is?

Thanks as always,
Riley
SFO

adrian
Posts: 2577
Joined: Tue May 17, 2005 4:01 pm

Re: Getting debugging view to show context node?

Post by adrian » Fri Mar 29, 2019 10:09 am

Hello,

If you are looking for the context node during debugging, you should try the Context view.
The Nodes/Values Set view, located in the right side panel, is meant to show a detailed (tree) view of what is selected in the left side panel from the XWatch or Variables views.

Not sure why the "the current context node value" is mentioned explicitly on the web site info page that you found. I guess you could use . (current context) in XWatch and when you select it you would actually see the current context node in the Nodes/Values Set view. Other than that the Nodes/Values Set has nothing to do with the context node.
I've logged an issue to correct the misleading web page info.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

RBVanDyke
Posts: 45
Joined: Wed Feb 11, 2015 11:25 pm
Location: San Francisco, California USA
Contact:

Re: Getting debugging view to show context node?

Post by RBVanDyke » Sat Mar 30, 2019 12:21 am

Thanks as always, Adrian.

Good to know my question will contribute to tidying up the HELP page a bit, too.

Cheers, Riley SFO

Post Reply