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. msxml get element line / position

msxml get element line / position

Scheduled Pinned Locked Moved XML / XSL
xmlhelp
6 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.
  • B Offline
    B Offline
    Brian van der Beek
    wrote on last edited by
    #1

    I want to be able to get the line and position of an element in a xml document, so when when there is an error (not a parse error!, but e.g. attribute verification error)I can display the user the position in the document.

    M P 2 Replies Last reply
    0
    • B Brian van der Beek

      I want to be able to get the line and position of an element in a xml document, so when when there is an error (not a parse error!, but e.g. attribute verification error)I can display the user the position in the document.

      M Offline
      M Offline
      Michael Flanakin
      wrote on last edited by
      #2

      Good luck. I don't think this will be possible without custom parsing. But, who knows. Michael Flanakin Web Log

      B 1 Reply Last reply
      0
      • M Michael Flanakin

        Good luck. I don't think this will be possible without custom parsing. But, who knows. Michael Flanakin Web Log

        B Offline
        B Offline
        Brian van der Beek
        wrote on last edited by
        #3

        That's really sucks... that way there is no way of telling a user where they made the mistake... (I'm not going to do all that effort just to find a line/position).

        M 1 Reply Last reply
        0
        • B Brian van der Beek

          That's really sucks... that way there is no way of telling a user where they made the mistake... (I'm not going to do all that effort just to find a line/position).

          M Offline
          M Offline
          Michael Flanakin
          wrote on last edited by
          #4

          Actually, you might be able to rig something up. If you can cache the XML, do your value-checking, and if you find an invalid value, insert some bad XML into your cached version. Then, run a validator on that, capture the output, and voila, you should have a line number. Now, this is all just theoretical. I don't know if it's 100% possible. And, there might be something that I don't know about that would make finding the line number easier. Besides, this all seems like a lot of work for a line number. Good luck, though! Michael Flanakin Web Log

          1 Reply Last reply
          0
          • B Brian van der Beek

            I want to be able to get the line and position of an element in a xml document, so when when there is an error (not a parse error!, but e.g. attribute verification error)I can display the user the position in the document.

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

            have you tried using an xml schema..


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

            B 1 Reply Last reply
            0
            • P Philip Fitzsimons

              have you tried using an xml schema..


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

              B Offline
              B Offline
              Brian van der Beek
              wrote on last edited by
              #6

              I thought of that, but the validation of the attributes and relations is much to complex to be checked in a xml scheme.

              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