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 95669 - Mapper doesn't take into accout the context when binds elements within xsl:for-each structure
Summary: Mapper doesn't take into accout the context when binds elements within xsl:fo...
Status: NEW
Alias: None
Product: soa
Classification: Unclassified
Component: XSLT (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Alexey Yarmolenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-15 13:02 UTC by Andrei Chistiakov
Modified: 2007-12-07 16:35 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Chistiakov 2007-02-15 13:02:25 UTC
Reproduced in build 070214_22.

To reproduce the bug:

- create the xsl transformation of one PO schema to another PO schema;
- in order to process a set of <item> elements, use xsl:for-each rule in Mapper;
- in Mapper, bind the subcomponents of the source <item> element to the
corresponding components of the target <item>.

Notice that the generated xsl source looks like:
        <xsl:element name="ns:newPurchaseOrder">
            <xsl:element name="ns:items">
                <xsl:for-each select="/ns1:purchaseOrder/Items/item">
                    <xsl:element name="ns:item">
                        <xsl:attribute name="ns:partNum">
                            <xsl:value-of
select="/ns1:purchaseOrder/Items/item/@partNum"/>
                        </xsl:attribute>
                        <xsl:element name="ns:productName">
                            <xsl:value-of
select="/ns1:purchaseOrder/Items/item/productName"/>
                        </xsl:element>
                        <xsl:element name="ns:quantity">
                            <xsl:value-of
select="/ns1:purchaseOrder/Items/item/quantity"/>
                        </xsl:element>
                    </xsl:element>
                </xsl:for-each>
            </xsl:element>
        </xsl:element>

Mapper creates the absolute XPath expressions (starting with the root element).
The correct expressions should be related to the current node context, i.e.
        <xsl:element name="ns:newPurchaseOrder">
            <xsl:element name="ns:items">
                <xsl:for-each select="/ns1:purchaseOrder/Items/item">
                    <xsl:element name="ns:item">
                        <xsl:attribute name="ns:partNum">
                            <xsl:value-of select="@partNum"/>
                        </xsl:attribute>
                        <xsl:element name="ns:productName">
                            <xsl:value-of select="productName"/>
                        </xsl:element>
                        <xsl:element name="ns:quantity">
                            <xsl:value-of select="quantity"/>
                        </xsl:element>
                    </xsl:element>
                </xsl:for-each>
            </xsl:element>
        </xsl:element>
Comment 1 Alexey Yarmolenko 2007-02-16 08:58:54 UTC
We still have no handling for relative locationPath. To implement it we also
have to track the "current" node for XPath expression owner.