http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2661 *** shadow/2661 Tue Jul 17 14:53:14 2001 --- shadow/2661.tmp.638 Tue Jul 17 14:53:14 2001 *************** *** 0 **** --- 1,103 ---- + +============================================================================+ + | template parameters missing illegal character remapping | + +----------------------------------------------------------------------------+ + | Bug #: 2661 Product: XalanJ2 | + | Status: NEW Version: CurrentCVS | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: org.apache.xalan.xsltc | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Here's the trusty mk031.xsl, apply to mk031.xml liberally with hot compresses: + + XSL + --- + + <?xml version='1.0' encoding='utf-8' ?> + <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xsl:version="1.0"> + + <!-- Test FileName: mk031.xsl --> + <!-- Source Attribution: + This test was written by Michael Kay and is taken from + 'XSLT Programmer's Reference' published by Wrox Press Limited in 2000; + ISBN 1-861003-12-9; copyright Wrox Press Limited 2000; all rights + reserved. + Now updated in the second edition (ISBN 1861005067), http://www.wrox.com. + No part of this book may be reproduced, stored in a retrieval system or + transmitted in any form or by any means - electronic, electrostatic, + mechanical, + photocopying, recording or otherwise - without the prior written + permission of + the publisher, except in the case of brief quotations embodied in + critical articles or reviews. + --> + <!-- Example: opera.xml, composers.xsl --> + <!-- Chapter/Page: 4-316 --> + <!-- Purpose: Getting the result of call-template in a variable --> + + <xsl:template match="/"> + <xsl:variable name="list"> + <xsl:call-template name="make.list"> + <xsl:with-param name="na.mes" + select="/programme/composer/fullname"/> + </xsl:call-template> + </xsl:variable> + This week's composers are: + <xsl:value-of select="translate($list, ',', ';')"/> + </xsl:template> + + <xsl:template name="make.list"> + <xsl:param name="na.mes"/> + <xsl:for-each select="$na.mes"> + <xsl:value-of select="."/> + <xsl:if test="position()!=last()">, </xsl:if> + <xsl:if test="position()=last()-1">and </xsl:if> + </xsl:for-each> + </xsl:template> + + </xsl:stylesheet> + + OUTPUT + ------ + + Runtime Error: Invalid conversion from 'reference' to 'node-set'. + + COMPILED TRANSLET + ----------------- + + ... + public void make$list(DOMAdapter domadapter, NodeIterator nodeiterator, + TransletOutputHandler transletoutputhandler, int i) { + Object object = this.addParameter("na_mes", "", true); + int i_0_ = i; + NodeIterator nodeiterator_1_ = nodeiterator; + nodeiterator = BasisLibrary.referenceToNodeSet(object).reset(); + ... + this.pushParamFrame(); + this.addParameter( + "na.mes", + new AbsoluteIterator( + new StepIterator( + new StepIterator( + domadapter.getTypedAxisIterator(3, 7), + domadapter.getTypedAxisIterator(3, 8) + ), + domadapter.getTypedAxisIterator(3, 9)) + ).setStartNode(i), + false); + make$list(domadapter, nodeiterator, transletoutputhandler, i); + this.popParamFrame(); + ... + + EXPECTED TRANSLET + ----------------- + + That the na.mes parameter name should be remapped to na_mes before being + stuffed into the parameter stack. The callee expects such a mapping.