What do book bulbs think of e-books
Walkthrough: Debugging an XSLT Stylesheet
The steps in this walkthrough show how to use the XSLT debugger. Steps include showing variables, setting breakpoints, and stepping through the code. You can use the debugger to run code one line at a time.
In preparation for this walkthrough, first copy the two sample files to your local computer. One of the files is the stylesheet and the other is the XML file that we will use as input to the stylesheet. In this walkthrough, the stylesheet used finds any books that cost less than the average book price.
The XSLT debugger is only available in the Visual Studio editions "Professional" and "Enterprise".
Select in the menu file the path to open > file out.
Find the file below-average.xsl, and choose to open out.
The stylesheet opens in the XML editor.
In the Document Properties window, click in the box input click the browse button ( ... ). (If the window properties does not appear, right-click anywhere in the open file in Notepad, then select properties out.)
Find the file books.xml, and then select to open out.
This defines the source document file that is used for the XSLT transformation.
Set a breakpoint on line 12 of the file below-average.xsl firmly. There are several ways to do this:
In line 12, click on the edge of the editor.
Click anywhere on row 12, and then press F9.
Right-click the startup tag, and then select Breakpoint > Insert breakpoint out.
Select on the menu bar XML > Start XSLT debugging off (or press OLD+F5).
The debug process will start.
In the editor, the debugger is located on the element of the stylesheet. Another file called below-average.xml opens in the editor. This is the output file that will be populated while each node is in the input file books.xml are processed.
The window automobile, Local and Monitor 1 appear at the bottom of the Visual Studio window. In the window Local all local variables are displayed with their current values. This includes the variables defined in the stylesheet as well as variables that the debugger uses to track the nodes that are currently in context.
We add the window Monitor 1 add two variables so we can check their values when the input file is processed. (You can also use the window Local to check values if the variables to be monitored already exist.)
Select in the menu Debug the path window > monitoring > Monitor 1 out.
The window Monitor 1 is displayed.
Enter in the field Surname then press the ENTER.
The value of the variable is in the field value displayed.
On the next line, type in the field Surname then press the ENTER.
is an XPath expression that evaluates the current context node. The value of the -XPath expression is the first book node. This changes in the course of the transformation.
Expand the node, and then expand the node with the value.
You can view the value of the book price for the current book node and compare it to the value. Since the book price is below average, the condition should be met before you continue debugging.
Step through the code
Press F5, to continue.
Since the first book node fulfills the condition, the book node becomes the output file below-average.xml added. The debugger continues until it is back at the element in the stylesheet. The debugger is now on the second book account in the file books.xml.
In the window Monitor 1 changes the value in the second book node. By evaluating the value for the price element, you can see that the price is above average and, as a result, the condition fails.
Press F5, to continue.
Since the second book node does not meet the condition, the book node does not become an output file below-average.xml added. The debugger continues until it is back at the element in the stylesheet. The debugger is now on the third node in the file books.xml.
In the window Monitor 1 the value is changed to the third book node. By evaluating the value for the element, you can see that the price is below average. The condition should be met.
Press F5, to continue.
Since the condition was met, the third book becomes the output file below-average.xml added. All books in the XML document have been processed and the debugger will exit.
The walkthrough uses the following two files.
Is this page helpful?
- What does fused cast AZS block mean
- What great things can we achieve alone
- Quantum radar is based on which technology
- Confusion can be caused by fear
- How many years is college in England
- What is Accidental Food Additive
- How many tribes are there in Jamaica
- Which is the most comfortable sofa bed
- Is erosion an effect of aging
- Christianity advocates racism
- Can wear warm skin tones cool lipstick
- Seek the truth as a moral imperative
- What is Lagrange
- Apache Pig leaves the market
- Can someone with low calcium donate blood
- What are the best safe looking websites
- Computer mouse can cause electric shock
- Did Smoking Marijuana Help Your Asthma?
- How do I understand Euler's identity
- Why do plasters have small holes?
- Is the Antichrist an NPC
- What are Indian voters promised
- When was the banana bread invented?
- Bite spiders people