Community
    • Login

    Collapse XMl tags for all the XMLS in a file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 7.9k Views 1 Watching
    Loading More Posts
    • 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.
    • ? Offline
      A Former User
      last edited by

      
      I have a list of XMls in a file.
      
      eg: 
      
      <ns:topic>
      <ns:location>asfsafs</ns:location>
      <ns:locationevent>yyyy</ns:locationevent>
      <Period>
      <ns:ProcessYear>1</ns:ProcessYear>
      <ns:Status>Processed</ns:Status>
      </Period>
      <Period>
      <ns:ProcessYear>2</ns:ProcessYear>
      <ns:Status>Pending</ns:Status>
      </Period>
      <Period>
      <ns:ProcessYear>3</ns:ProcessYear>
      <ns:Status>UnProcessed</ns:Status>
      </Period>
      <ns:Action>
      <ns:name>abc</ns:name>
      </ns:Action>
      <ns:Action>
      <ns:name>def</ns:name>
      </ns:Action>
      <ns:Coverage>
      <ns:Action>
      <ns:name>def</ns:name>
      </ns:Action>
      </ns:Coverage>
      <ns:ID>12233</ns:ID>
      </ns:topic>
      
      <ns:topicc>
      <ns:location>asfsafs</ns:location>
      <ns:locationevent>yyyy</ns:locationevent>
      <Period>
      <ns:ProcessYear>1</ns:ProcessYear>
      <ns:Status>Processed</ns:Status>
      </Period>
      <Period>
      <ns:ProcessYear>2</ns:ProcessYear>
      <ns:Status>Pending</ns:Status>
      </Period>
      <Period>
      <ns:ProcessYear>3</ns:ProcessYear>
      <ns:Status>UnProcessed</ns:Status>
      </Period>
      <ns:Action>
      <ns:name>abc</ns:name>
      </ns:Action>
      <ns:Action>
      <ns:name>def</ns:name>
      </ns:Action>
      <ns:Coverage>
      <ns:Action>
      <ns:name>def</ns:name>
      </ns:Action>
      </ns:Coverage>
      <ns:ID>12223</ns:ID>
      </ns:topic>
      
      I want to collapse certain tags(eg:  <period>,<ns:Action> and <ns:Coverage> and its subelements), to check, if expected Id values is present in the `<ns:ID>` subelement from the XML node. By a single command, is there any possibility to do this without going to specific places. I need a solution which should applicable to all the XMLS which are in the file.
      
      
      1 Reply Last reply Reply Quote -2
      • PeterJonesP Offline
        PeterJones
        last edited by PeterJones

        @vijay-S ,

        This is not your personal XML support forum.

        You have been given plenty (dozens!) of regex examples to manipulate XML, and @guy038 has selflessly iterated through your ever-changing requirements to try to satisfy you.

        I have previously explained to you that you need to read documentation (which I linked to), and show what you’ve tried, and basically you need to show some effort.

        Notepad++ has builtin XML language syntax highlighting and code folding, and View > Collapse Level / Uncollapse Level will help you hide and unhide various levels of your XML hierarchy.

        There are plugins for Notepad++ – noteably, XML Tools – which will help you with validation, syntax checking, etc.

        @Peter-Brand has recommended that you use XSLT to do your XML transformations.

        There are programming languages out there with libraries that will help you extract just the information you want from your XML files.

        Please show some effort

        1 Reply Last reply Reply Quote 3

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors