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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. XML / XSL
  4. SAX in C#

SAX in C#

Scheduled Pinned Locked Moved XML / XSL
csharpxmlquestion
3 Posts 3 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.
  • N Offline
    N Offline
    Noodnik
    wrote on last edited by
    #1

    I've got a big and deep XML file I want to extract values from. My webservice is currently entirely in C#. I thought to use SAX because I just want to build up a two-column dataset from my XML file: the PATH and the TEXT VALUE. E.g.: /root= /root/node=2 /root/node/sub=SomeText /root/node2=3 /root/node2/sub=Some More Text Since I've used SAX before to easily build up the "path" part, I searched for a SAX parser in .NET and on the net and am VERY surprised that I can't find one!! Anyways, I'm new to XSLT et. al. and suspect there's a quick way for me to do what I want there (e.g. to build up this two column file WITHOUT knowing the names of the nodes). Can anyone suggest how, or even a small stylesheet to do this?? Thanks for any [good] advice!

    P J 2 Replies Last reply
    0
    • N Noodnik

      I've got a big and deep XML file I want to extract values from. My webservice is currently entirely in C#. I thought to use SAX because I just want to build up a two-column dataset from my XML file: the PATH and the TEXT VALUE. E.g.: /root= /root/node=2 /root/node/sub=SomeText /root/node2=3 /root/node2/sub=Some More Text Since I've used SAX before to easily build up the "path" part, I searched for a SAX parser in .NET and on the net and am VERY surprised that I can't find one!! Anyways, I'm new to XSLT et. al. and suspect there's a quick way for me to do what I want there (e.g. to build up this two column file WITHOUT knowing the names of the nodes). Can anyone suggest how, or even a small stylesheet to do this?? Thanks for any [good] advice!

      P Offline
      P Offline
      Philip Fitzsimons
      wrote on last edited by
      #2

      in xslt use the name() function, and to get paths just use the parent axis..


      "When the only tool you have is a hammer, a sore thumb you will have."

      1 Reply Last reply
      0
      • N Noodnik

        I've got a big and deep XML file I want to extract values from. My webservice is currently entirely in C#. I thought to use SAX because I just want to build up a two-column dataset from my XML file: the PATH and the TEXT VALUE. E.g.: /root= /root/node=2 /root/node/sub=SomeText /root/node2=3 /root/node2/sub=Some More Text Since I've used SAX before to easily build up the "path" part, I searched for a SAX parser in .NET and on the net and am VERY surprised that I can't find one!! Anyways, I'm new to XSLT et. al. and suspect there's a quick way for me to do what I want there (e.g. to build up this two column file WITHOUT knowing the names of the nodes). Can anyone suggest how, or even a small stylesheet to do this?? Thanks for any [good] advice!

        J Offline
        J Offline
        Jeremy Kimball
        wrote on last edited by
        #3

        I'd have to think about it a bit, but my guy tells me what you're looking for is to subclass XmlReader, which is basically a SAX parser that doesn't toss events; it's all manual. If I think of anything better, I'll add to this... Jeremy Kimball

        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