Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. TonyMarston

    How to iterate through a node's attributes

    Yes, that works. Thank you.
  2. TonyMarston

    How to iterate through a node's attributes

    I have a stylesheet with the following code: <xsl:for-each select="//structure/table/column"> <col> <xsl:if test="@width"> <xsl:attribute name="width" ><xsl:value-of select="@width" /></xsl:attribute> </xsl:if> <xsl:if test="@class"> <xsl:attribute...
  3. TonyMarston

    Error with client-side XSL when switching from HTTPS to HTTP

    This error only appears with IE. I have a demo application on my website at http://www.radicore.org/demo.php in which all HTML is built using XSL transformations. The page contains 2 links: http://www.radicore.org/demo/menu/logon.php for server-side transformations...
  4. TonyMarston

    How to get value of previous node in sorted order, not document order

    Here it is (for what it's worth): <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:saxon="http://icl.com/saxon" exclude-result-prefixes="msxsl...
  5. TonyMarston

    How to get value of previous node in sorted order, not document order

    My quick replies:- (1) Yes, all the code resides in a sungle XSL stylesheet. I only quoted the relevant snippets. (2) Yes, the variable does contain the OCC node, but it also contains other nodes, so I have to specify which one to process. The variable contains a tree structure just like the...
  6. TonyMarston

    How to get value of previous node in sorted order, not document order

    After a lot of playing around I eventually got it to work as follows: (1) Declare the following namespaces to deal with the 'node-set' extension: <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"...
  7. TonyMarston

    How to get value of previous node in sorted order, not document order

    I wish to process my XML data in a particular oder, so I am using the following code: <xsl:apply-templates select="SYSTEM/TABLE/OCC"> <xsl:sort select="FIELD3"/> <xsl:sort select="FIELD4"/> </xsl:apply-templates> Within the template I wish to obtain a value from the previous node...
  8. TonyMarston

    Cannot declare xsl:variable inside xsl:choose block

    Great answer. Thanks.
  9. TonyMarston

    Cannot declare xsl:variable inside xsl:choose block

    Here it is in its entirety. It is actrually in a template that is called from a number of stylesheets. <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;> <xsl:param name=&quot;curpage&quot;>2</xsl:param> <xsl:param...
  10. TonyMarston

    There is a code: &lt;?php $xsltproc

    When you specify parameters on the XSL transformation process you can only access thyem inside your XSL stylesheet using the following line: <xsl:param name=&quot;name&quot;>default</xsl:param> where the value 'default' will be overwritten by whatever you supply during the transformation process.
  11. TonyMarston

    Cannot declare xsl:variable inside xsl:choose block

    Whoops. That was a simple typo when constructing the post. The code I actually ran was syntactically correct, but I still get the error. I have tried the following XSL parsers: - the Sablotron extension in PHP - Komodo (XSL debugger) from Activestate - Microsoft's MSXML parser v4 The same...
  12. TonyMarston

    Cannot declare xsl:variable inside xsl:choose block

    Is there any good reason why the following code does not work? <xsl:choose> <xsl:when test=&quot;foo&quot;> <xsl:variable name=&quot;var&quot; select=&quot;'foo'&quot; /> </xsl/when> <xsl:otherwise> <xsl:variable name=&quot;var&quot; select=&quot;'something else'&quot; />...
  13. TonyMarston

    Can you pass a string literal with xsl:call-template?

    Bloody heck, that was simple. Why didn't I think of that? Problem solved, thank you very much.
  14. TonyMarston

    Can you pass a string literal with xsl:call-template?

    I have created the following template: <xsl:template name=&quot;column_hdg&quot;> <xsl:param name=&quot;item&quot;/> <xsl:param name=&quot;string&quot;/> <!-- create hyperlink to sort on this field --> <a><xsl:attribute name=&quot;href&quot;><xsl:value-of...
  15. TonyMarston

    How to compare current value with previous or next occurrence?

    After a lot of trial and error I have managed to find the solution: 1) Create a variable to hold the current value of position() 2) Create a variable to hold the data from an item in the previous/next occurrence 3) Compare the item data in the current occurrence with the contents of variable...
  16. TonyMarston

    How to compare current value with previous or next occurrence?

    I know how to get the number of the previous node, but I am trying to get the value of an item in the previous node so I can compare it with the value of the same item in the current node. What I am trying to do is step through a sorted list and perform some processing when a value changes...
  17. TonyMarston

    enforce line break in xsl

    If an item contains CrLf or groups of spaces that you want to preserve then enclose it in the HTML <pre>...</pre> tags.
  18. TonyMarston

    How to compare current value with previous or next occurrence?

    After sorting my XML data I want to detect when one of the values changes so that I can do something extra, such as insert another line break. I cannot find how to compare an item value with the previous or next occurrence in the structure. Can anyone help me please?
  19. TonyMarston

    How to use an element's position to create links

    A new XSL file for an MS XML parser would be helpful, thanks.
  20. TonyMarston

    How to use an element's position to create links

    I am trying to extract the value of an element's position in the XML file so that I can create references to the current, previous and next element. Can anyone give a newbie some advice? My XML file looks something like this: <?xml version=&quot;1.0&quot;?> <?xml-stylesheet...

Part and Inventory Search

Back
Top