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 & Follow up Audits" />
<Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="4-Remediation & Follow up Audits" />
<Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="4-Remediation & Follow up Audits" />
<Row Title="" FiscalYr="FY08" Region="GLOBAL" AuditName="DEMO"
Grade="N/A" RiskTheme="" Stage="4-Remediation & 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[(_at_)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
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--