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. Trying to write a filter

Trying to write a filter

Scheduled Pinned Locked Moved XML / XSL
questionxmljson
6 Posts 4 Posters 18 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.
  • C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #1

    I have an XML document which I need to turn into a new format, where a small portion of it gets put in tags, the rest does not. There is a LOT of XML on this page. I've got the first half done, easy enough. Now I want to write a filter which, instead of saying 'include these tags and children', I want to say 'EXCLUDE these tages and children, include everything else'. How do I do that ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

    M 1 Reply Last reply
    0
    • C Christian Graus

      I have an XML document which I need to turn into a new format, where a small portion of it gets put in tags, the rest does not. There is a LOT of XML on this page. I've got the first half done, easy enough. Now I want to write a filter which, instead of saying 'include these tags and children', I want to say 'EXCLUDE these tages and children, include everything else'. How do I do that ? Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

      M Offline
      M Offline
      MS le Roux
      wrote on last edited by
      #2

      Which language and parser are you using to process the XML?

      C 1 Reply Last reply
      0
      • M MS le Roux

        Which language and parser are you using to process the XML?

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        I'm using XSL, I got it working this afternoon - thanks. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

        P 1 Reply Last reply
        0
        • C Christian Graus

          I'm using XSL, I got it working this afternoon - thanks. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

          P Offline
          P Offline
          Paul Watson
          wrote on last edited by
          #4

          Christian Graus wrote: I got it working this afternoon - thanks. How did you do it? I might run into that problem one day and need to know how, thanks :) regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront

          M C 2 Replies Last reply
          0
          • P Paul Watson

            Christian Graus wrote: I got it working this afternoon - thanks. How did you do it? I might run into that problem one day and need to know how, thanks :) regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront

            M Offline
            M Offline
            Michael A Barnhart
            wrote on last edited by
            #5

            My first pass would have been to use the count(tag) function and only processed if it returned 0. Good ideas are not adopted automatically. They must be driven into practice with courageous patients. -Admiral Rickover. ...

            1 Reply Last reply
            0
            • P Paul Watson

              Christian Graus wrote: I got it working this afternoon - thanks. How did you do it? I might run into that problem one day and need to know how, thanks :) regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge Sonork ID: 100.9903 Stormfront

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              The trick is that a more generic filter will only include items that were not included in a more specific filter. I wrote specific filters for the tages I needed, then a generic filter, and it excluded all the items that the specific tags caught. If that's not clear LMK, I can post the code from work tomorrow. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

              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