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. C#
  4. XML Parsing in Windows Phone 8

XML Parsing in Windows Phone 8

Scheduled Pinned Locked Moved C#
comxmljsonquestion
3 Posts 2 Posters 3 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.
  • J Offline
    J Offline
    Junaid Javed
    wrote on last edited by
    #1

    Hi, I want to get the inner text of this single line xml. I have parsed a properly written xml document, but I can't figure out how can I parse this single line.

    <double xmlns="http://www.somewebservice.com/">168.0543</double>

    OriginalGriffO 1 Reply Last reply
    0
    • J Junaid Javed

      Hi, I want to get the inner text of this single line xml. I have parsed a properly written xml document, but I can't figure out how can I parse this single line.

      <double xmlns="http://www.somewebservice.com/">168.0543</double>

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Try a regex:

      (?<=\<.+\>)([^<]+)(?=\<.*\>)

      Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      J 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Try a regex:

        (?<=\<.+\>)([^<]+)(?=\<.*\>)

        Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

        J Offline
        J Offline
        Junaid Javed
        wrote on last edited by
        #3

        Thanks a lot. I had to modify it a bit and it worked. :thumbsup: The new regex loked like this

        "(?<=\">)(.*)(?=<)"

        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