The XSLT/XQuery Input View

The structure of the XML document associated to the edited XSLT stylesheet , or of the source documents of the edited XQuery is displayed in a tree form in a view called XSLT/XQuery Input. The tree nodes represent the elements of the documents.

 The XSLT Input View

If you click on a node, the corresponding template from the stylesheet will be highlighted. A node can be dragged and dropped in the editor area for quickly inserting xsl:template, xsl:for-each or other XSLT elements with the match / select / test attribute already filled with the correct XPath expression referring to the dragged tree node and based on the current editing context of the drop spot.

 

Figure 4.91. XSLT input view

XSLT input view

For example for the following XML document

<personnel>
    <person id="Big.Boss">
        <name>
            <family>Boss</family>
            <given>Big</given>
        </name>
        <email>chief@oxygenxml.com</email>
        <link subordinates="one.worker"/>
    </person>
    <person id="one.worker">
        <name>
            <family>Worker</family>
            <given>One</given>
        </name>
        <email>one@oxygenxml.com</email>
        <link manager="Big.Boss"/>
    </person>
</personnel>
                

and the following XSLT stylesheet

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        version="2.0">
    <xsl:template match="personnel">
        <xsl:for-each select="*">
            
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
                

if you drag the given element and drop it inside the xsl:for-each element a popup menu will be displayed.

 

Figure 4.92. XSLT Input drag and drop popup menu

XSLT Input drag and drop popup menu

Select for example Insert xsl:value-of and the result document will be:

 

Figure 4.93. XSLT Input drag and drop result

XSLT Input drag and drop result