locked
Get text before start tag in xml file using xpath in c# RRS feed

All replies

  • Hi Soniya,

    XML files have a very particular structure:

    1. Byte Order Mark (BOM), optional.
    2. XML Prolog, optional.
    3. Root tag, mandatory to be a well-formed.
    4. Everything else.

    Please clarify what you need and provide your XML sample.

    Friday, August 26, 2016 2:09 PM
  • Hi Soniya Singh,

    I would suggest that you read the following about Select Nodes Using XPath Navigation.

    https://msdn.microsoft.com/en-us/library/d271ytdx(v=vs.110).aspx

    I hope it helps.

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Sunday, August 28, 2016 6:56 AM
    Moderator
  • i need to get text before tag like:

    <section>text sample1<p>U.S. Department of Health; and ;Human Services</p>
    <p>540 Gaither (Road</p>text sample2
    <p>Rockville[ MD 20850</p>
    <p>text sample3<ext-link xlink:href="www.ahrq.gov" ext-link-type="uri">www.ahrq.gov</ext-link></p>
    <p><bold>Contract No. 290-2012-00009-I</bold>unwanted text sample</p>text sample4

    <body>
    <p>text sample5<bold>Prepared by:</bold></p>
    <p>Vanderbilt Evidence-based Practice Center</p>
    text sample6<p>Nashville, TN</p>
    <p>text sample7<bold>Investigators:</bold>unwanted text sample</p>
    </body>unwanted text sample</section>

    here,

    we need to get all highlighted words i.e "text sample" from root node without "unwanted text sample "

    can you please tell me how to get it



    Monday, August 29, 2016 4:43 AM
  • please reply me
    Wednesday, August 31, 2016 4:33 AM
  • Please elaborate and give just a few lines that focus on your problem. What do you want to acheive?


    Best regards, George

    Thursday, September 1, 2016 3:32 PM