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. XSLT of data extracted via XPath?

XSLT of data extracted via XPath?

Scheduled Pinned Locked Moved XML / XSL
xmlhelpquestioncsharp
2 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.
  • A Offline
    A Offline
    AndrewCherry
    wrote on last edited by
    #1

    I know this really shouldn't be defeating me, but... I have a page where i'm using XSLT to transform a simple XML document (forum postings). This works fine, but if I want to display just one topic, i'm finding myself stuck. Using c# I can create an XmlNodeList containing the XML that I want, by performing a SelectNodes on an XmlDocument. This gives me the right data back, my XPath expression is fine. But! How do I then apply an XSL transform to that resulting nodelist? XSLT on seems to like XMLDocs, etc. Can I convert a NodeList to a Doc? I'm really stuck! Am I going about this the wrong way? Any help, or hints, anything, would be very gratefully received!

    A 1 Reply Last reply
    0
    • A AndrewCherry

      I know this really shouldn't be defeating me, but... I have a page where i'm using XSLT to transform a simple XML document (forum postings). This works fine, but if I want to display just one topic, i'm finding myself stuck. Using c# I can create an XmlNodeList containing the XML that I want, by performing a SelectNodes on an XmlDocument. This gives me the right data back, my XPath expression is fine. But! How do I then apply an XSL transform to that resulting nodelist? XSLT on seems to like XMLDocs, etc. Can I convert a NodeList to a Doc? I'm really stuck! Am I going about this the wrong way? Any help, or hints, anything, would be very gratefully received!

      A Offline
      A Offline
      avnrao
      wrote on last edited by
      #2

      You can use for-each statement in xslt and loop thru in xslt. But anyway you have to pass XMLDocument, not XMLNodeList. Pass the XPath as a parameter to XSLT or you can hardcode in xslt if it doesnt change. You can check MSND for how to use for-each statement and Passing parameters to XSLT.

      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