[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Variable confusion
Tim, it is hard to say what the problem is without seeing more of the XSLT stylesheet and the two XML source documents. A couple quick things: Be certain that there is no other <xsl:variable> named 'pageNum' defined at template-scope which would hide the top-level <xsl:variable> of the same name. Try stripping down the problem case: radically simplify the XML source documents and XSLT stylesheet document until either (1) you spot the problem or (2) you have a very small set of documents that illustrate the problem and nothing else. Do it in a couple of steps, so you can tell what you changed and put it back when the behavior changes. Divide and conquer. If that doesn't solve your problem, post a short example that illustrates the problem. Observe that your global variable uses the XPath expression "/storpres/est/general/trans-page" whereas the alert evaluates this expression "storpres/est/general/trans-page". The first expression begins at the root node, the second expression is relative to the context in which it is evaluated (no leading /). Is that the problem? What is the <!DOCTYPE storpres> declaration doing in the stylesheet document? The root element of this document is <xsl:stylesheet>, not <storpres>. See the XML spec, 2.8 Prolog and Document Type Declaration (http://www.w3.org/TR/2000/REC-xml-20001006#sec-prolog-dtd), the paragraph marked Validity constraint: Root Element Type. Cheers, Stuart 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
|