|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: TOUGH ONE: All Grandmasters - how- iteratable key-
At 2003-09-13 20:01 -0500, SANWAL, ABHISHEK (HP-Houston) wrote:
(ROUGH SKETCH): The above is meaningless. A variable's scope is its following siblings and their descendents. Also, variables must be named with proper XML names (and may even be qualified in a namespace). Or like this ( as shown on DPawsons FAQ as picked up from ) - http://www.biglist.com/lists/xsl-list/archives/200004/msg00714.html (Also the example test.xsl and class.xsl don't seem to work for me.. to even test it out.. anyone suggest any fixes so I can see how it works) The above is fine in global scope, because one can use the document() function to get at the fixed value. so that I can pick up the values for the COLUMN WIDTHS for ANY and EVERY "Matrix or Table" in that Section by iterating through that array or whatever other structure/variable I can use (xsl or non-xsl namespace) but LOCAL to the Section. You *cannot* get at such a local run-time definition using XSLT 1.0. Using a vendor-supplied node-set() function, or XSLT 2.0, you can access a variable of node sets. I don't really care how this is done as I am not sure if I can define any such structure, keep it local as well as be able to ITERATE through it to pull values. Not in XSLT 1.0 ... you cannot define a result tree fragment in a template and then access it with XPath. In XSLT 1.0 XPath will only access the source node tree. You can have it access the global-scope result tree fragments of a stylesheet by opening up the stylesheet *as* a source file, by using the document() function. Any genius solve this one ?? :) I get the feeling you are repeatedly trying to apply programming concepts to a templating language. Certainly XSLT 1.0 is Turing complete, but there are restrictions on data types and the use of XPath. XPath can *only* be used on the source node tree. The only way around this is to use a vendor extension or use XSLT 2.0. Please don't try to treat XSLT 1.0 as a general-purpose programming language, or you will, indeed, get nowhere. As I said in my last post, the idea in XSLT 1.0 is to revisit the source node tree any time you need a value. In your column width calculations, you will be doing some calculation to evaluate each of your widths ... just redo those calculations when you need the values again. There are *no* array-like data types in XSLT 1.0 or XPath 1.0 ... so you will have to follow the language to get what you want. I hope this helps to make these principles clear to you. .......................... Ken
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-11-X Practical Formatting Using XSL-FO Member of the XML Guild of Practitioners: http://XMLGuild.info Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








