Project

Profile

Help

Revision a18fd9ca

Added by Michael Kay almost 10 years ago

Fix bug 3462470 and 3462473 (XSLT Trace output)

View differences:

latest9.4/hej/net/sf/saxon/style/StyleElement.java
1537 1537
					// because of xml:space="preserve"
1538 1538
					Expression text = new ValueOf(new StringLiteral(node.getStringValue()), false, false);
1539 1539
					text.setLocationId(allocateLocationId(getSystemId(), lineNumber));
1540
                    text = makeTraceInstruction(mostRecent, text);
1541
//						text = getPreparedStylesheet().getCompilerInfo().getCodeInjector().injecttext, text);
1542
//						text.setLocationId(allocateLocationId(getSystemId(), lineNumber));
1540

  
1541
                    CodeInjector injector = getPreparedStylesheet().getCompilerInfo().getCodeInjector();
1542
                    if (injector != null) {
1543
                        Expression tracer = injector.inject(text, getStaticContext(), StandardNames.XSL_TEXT, null);
1544
                        tracer.setLocationId(text.getLocationId());
1545
                        text = tracer;
1546
                    }
1547

  
1543 1548
					contents.add(text);
1544 1549
				}
1545 1550

  
......
1620 1625
	 */
1621 1626

  
1622 1627
	protected static Expression makeTraceInstruction(StyleElement source, Expression child) {
1623
		if (child instanceof TraceExpression) {
1628
		if (child instanceof TraceExpression && !(source instanceof StylesheetProcedure)) {
1624 1629
			return child;
1625 1630
			// this can happen, for example, after optimizing a compile-time xsl:if
1626 1631
		}

Also available in: Unified diff