[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

"mode" not working as expected

Subject: "mode" not working as expected
From: "Dick Penny" <d_penny@xxxxxxx>
Date: Thu, 08 Jul 2010 10:34:59 -0700
 "mode" not working as expected
Am using XSLT 1.0 and XML NotePad2007 on a Windows XP PC.

I get the expected output displayed from variable $step1out with the XSLT
below(with the two ???? obiviously deleted). However, when I replace the two
???? with mode="abc" my template that generates the attribute xx never
executes. Instead, I get six copies of the namespace agg in variable
$step1out. To my way of thinking, adding a mode simply further guarantees
execution of this template.

What is going on? I cannot imagine what copied the namespace into $step1out.
What fundamental idea am I missing? I've poured over MKs and JTs books on
filtering & selecting, nothing seems to fit this. This is tough when you only
do it once every 3-4 months.

My input data is:
======================================
<dsQueryResponse>
    <Rows agg:source="Audit_Stages"
xmlns:agg="http://schemas.microsoft.com/sharepoint/aggregatesource">
      <Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="3-Reporting"
PlanStartDate="2010-07-21T07:00:00Z" PlanEndDate="" />
      <Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="4-Remediation &amp; Follow up Audits" />
      <Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="4-Remediation &amp; Follow up Audits" />
      <Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="4-Remediation &amp; Follow up Audits" />
      <Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="4-Remediation &amp; Follow up Audits" />
      <Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="1-Planning" PlanStartDate="" PlanEndDate=""
/>
    </Rows>
    <Rows agg:source="Findings"
xmlns:agg="http://schemas.microsoft.com/sharepoint/aggregatesource">
      <Row Title="DEMO7" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Risk="Medium"  Recommendations="This is test #1" />
      <Row Title="DEMO8" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Risk="Medium"  Recommendations="This is test #2" />
      <Row Title="DEMO9" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Risk="Medium"  Recommendations="This is test #3" />
      <Row Title="DEMO10" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Risk="Medium" Recommendations="This is test #4" />
      <Row Title="DEMO11" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Risk="OBS"    Recommendations="This is test #5" />
      <Row Title="DEMO12" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Risk="OBS"    Recommendations="This is test #6" />
    </Rows>
    <Rows  agg:source="Header"
xmlns:agg="http://schemas.microsoft.com/sharepoint/aggregatesource">
      <Row Title="DEMO_DP" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
AuditID="DEMO" RiskTheme="" />
    </Rows>
  </dsQueryResponse>
=================================

My XSLT is:
==================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
					xmlns:agg="http://schemas.microsoft.com/sharepoint/aggregatesource"
                       xmlns:msxsl="urn:schemas-microsoft-com:xslt" >
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />


<xsl:template match="/">

<xsl:variable name="step1out" >
<xsl:apply-templates  ????
select="dsQueryResponse/Rows[@agg:source='Audit_Stages']" />
</xsl:variable>

<xsl:apply-templates select="msxsl:node-set($step1out)" mode="show.debug" />

</xsl:template>

<xsl:template match="node() | @*" >
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="Row" ???? >
<xsl:copy>
<xsl:attribute name="xx">
<xsl:value-of select="26"/>
</xsl:attribute>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="*" mode="show.debug">
<xmp><xsl:copy-of select="*" /></xmp>
</xsl:template>

</xsl:stylesheet>
==================================

Thanks in advance.

Dick Penny

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.