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. Read TEXT from within 2 xml nodes (tricky I think ...)

Read TEXT from within 2 xml nodes (tricky I think ...)

Scheduled Pinned Locked Moved C#
questionjavascriptphpxmlhelp
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.
  • S Offline
    S Offline
    sodevrom
    wrote on last edited by
    #1

    Hello, The question is simple but I found it tricky to accomplish. I want to extract all the text from within the default.code node:

    < default.code >
    <!--
    google_ad_client = "<?php echo($adsense_pubid);?>";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "image";
    google_ad_channel = "";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "245917";
    google_color_text = "555555";
    google_color_url = "555555";
    google_ui_features = "rc:6";
    //-->
    < /default.code >

    The problem is that when I read it, the is also considered a XML node. I simply want to extract the javascript code block. How can I do this ? Thanks

    C 1 Reply Last reply
    0
    • S sodevrom

      Hello, The question is simple but I found it tricky to accomplish. I want to extract all the text from within the default.code node:

      < default.code >
      <!--
      google_ad_client = "<?php echo($adsense_pubid);?>";
      google_ad_width = 728;
      google_ad_height = 90;
      google_ad_format = "728x90_as";
      google_ad_type = "image";
      google_ad_channel = "";
      google_color_border = "FFFFFF";
      google_color_bg = "FFFFFF";
      google_color_link = "245917";
      google_color_text = "555555";
      google_color_url = "555555";
      google_ui_features = "rc:6";
      //-->
      < /default.code >

      The problem is that when I read it, the is also considered a XML node. I simply want to extract the javascript code block. How can I do this ? Thanks

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

      The script tag IS an XML node. However you can select the default.code and select the InnerXml ( from memory ) to get the script blocks with the XML tags which also happen to be script tages.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      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