Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Generate missing XML

Generate missing XML

Scheduled Pinned Locked Moved XML / XSL
xmlhtmlquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lea Hayes
    wrote on last edited by
    #1

    Hi, I am using an XSL file to format a document for display on my website. A content block has a title, and contains HTML content. The references section always appears at the bottom of the rendered document (regardless of its location within the XML file). ... ... In the XSL I want to create a contents for the document. I have managed to get the content sections listed in the contents. But I find myself duplicating a large chunk of XSL just to add the references section to the contents. Is there a way to do something along the lines of the following? concatenate ?? Get list of content nodes "/mydoc/content" ?? with ... so that I can: and also: Many thanks, Lea Hayes

    F 1 Reply Last reply
    0
    • L Lea Hayes

      Hi, I am using an XSL file to format a document for display on my website. A content block has a title, and contains HTML content. The references section always appears at the bottom of the rendered document (regardless of its location within the XML file). ... ... In the XSL I want to create a contents for the document. I have managed to get the content sections listed in the contents. But I find myself duplicating a large chunk of XSL just to add the references section to the contents. Is there a way to do something along the lines of the following? concatenate ?? Get list of content nodes "/mydoc/content" ?? with ... so that I can: and also: Many thanks, Lea Hayes

      F Offline
      F Offline
      Frank Horn
      wrote on last edited by
      #2

      It's probably easy in XSLT 2, but if you're using XSLT 1 like most of us who are relying on Microsoft tools, avoiding duplicated xsl code ist hard. Using a workaround pattern I've sometimes applied in such cases it would look like this: Contents References This is not nice, and can be further refined, but the only way I know to avoid duplicating the logic contained in the for-each statement. I don't have the patience right now to adjust the tabs and spaces which don't look right in the preview. And please be aware that I just copied and pasted it from some old stylesheets of mine and your fragments and have not tested it. There may be syntax errors, but I'm sure you get the gist. And if any one points out a better pattern, I'll add my thanks to yours.

      L 1 Reply Last reply
      0
      • F Frank Horn

        It's probably easy in XSLT 2, but if you're using XSLT 1 like most of us who are relying on Microsoft tools, avoiding duplicated xsl code ist hard. Using a workaround pattern I've sometimes applied in such cases it would look like this: Contents References This is not nice, and can be further refined, but the only way I know to avoid duplicating the logic contained in the for-each statement. I don't have the patience right now to adjust the tabs and spaces which don't look right in the preview. And please be aware that I just copied and pasted it from some old stylesheets of mine and your fragments and have not tested it. There may be syntax errors, but I'm sure you get the gist. And if any one points out a better pattern, I'll add my thanks to yours.

        L Offline
        L Offline
        Lea Hayes
        wrote on last edited by
        #3

        Hi, Thanks for your advice! This has helped me to solve the problem! Best regards, Lea Hayes :-D

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups