This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 113532

Summary: Support for xsl:template in the XSLT editor
Product: soa Reporter: pvarghese <pvarghese>
Component: XSLTAssignee: Sergey Lunegov <slunegov>
Status: RESOLVED INCOMPLETE    
Severity: blocker CC: alexeyyarmolenko, gbadescu, kevan1138, mpottlapelli
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description pvarghese 2007-08-22 16:45:16 UTC
XSLT editor should support the creation of templates for the xsl file.
It should have support for both matched and named templates as shown

1. Matched template:

<xsl:template match="ns1:Order">
   <ns:CustomerHistoryEntry>
      <ns:OrderLookupInfo>
         <xsl:apply-templates select="ns1:OrderItems/ns1:item/ns1:ITM_NUMBER"/>
      </ns:OrderLookupInfo>
   </ns:CustomerHistoryEntry>
</xsl:template>

with the template for the “ITM_NUMBER” element in the source tree as follows

<xsl:template match="ns1:ITM_NUMBER">
   <ns:ITM_NUMBER>
      <xsl:value-of select="."/>
   </ns:ITM_NUMBER>
</xsl:template>

3. Named template: with the ability to pass parameters

<xsl:template name=”CreateCustomerEntry”>
   <xsl:param name=”OrderParam”>
   <ns:CustomerHistoryEntry>
      <ns:OrderLookupInfo>
         <xsl:apply-templates 		     select="$OrderParam/ns1:OrderItems/ns1:item/ns1:ITM_NUMBER"/>
      </ns:OrderLookupInfo>
 </ns:CustomerHistoryEntry>

where when calling this template the 'Order' parameter is passed in as shown.

<xsl:template match=”ns1:Orders”>
   <ns:CustomerHistoryEntries>	
      <xsl:call-template name=”CreateCustomerEntry”>
         <xsl:with-param name=”OrderParam” select=”ns1:Order”>
      </xsl:call-template>
   </ns:CustomerHistoryEntries>
</xsl:template>
Comment 1 ceklock 2011-09-19 21:33:45 UTC
Maybe you can provide some more information about this enhancement.