Klaus Wais

Forum Replies Created

Viewing 4 replies – 1 through 4 (of 4 total)
  • Author
    Replies
  • in reply to: parsing xml with grm – fetching attribute #64962
    Klaus Wais
    Participant

      Jim,

      thanks for the hint to look at the XML tester …I haven’t thought about this.

      I’ll use a loop for the repeated tags.

      I have found the path to access the attribute by the XML tester.

      e.g for ;

      set gh [grmcreate -msg $mh xml $package $type]

      set dh [grmfetch $gh {MyType.FileName($idx).&Type}]

      set val [datget $dh VALUE]

      The only thing I’m wondering about is if there is a difference in retrieving the tag content. For the 1st occurance of all 3 versions of the path with grmfetch seem to work the same way.

      Any comments about the usage of the “.#text” ?

      set dh [grmfetch $gh {MyType.FileName}]

      set dh [grmfetch $gh {MyType.FileName(0)}]

      set dh [grmfetch $gh {MyType.FileName(0).#text}]

      in reply to: parsing xml with grm – fetching attribute #64961
      Klaus Wais
      Participant

        Jim,

        I looked up the forum and there is a post that deals with repetitions (increment counter) but I hoped there is a solution to use a foreach {}.

        The real challenge is still to access the xml attribute:

        I can retrieve the content of the tag but I’ve no idea how to address an attribute.

        in reply to: HRL Segment Repeat #60599
        Klaus Wais
        Participant

          sure

          This is the HRL for the GDT message (up til now I set the repeats to 999)

          # Record Layout: gdt_msg.hrl

          #

          prologue

             who: Admin

             date: February 9, 2007 3:39:32 PM CET

             type: hrl

             version: 3.0

          end_prologue

          #

          # Include Files

          #

          #

          # Field declarations

          #

          {NAME Segment} {TYPE fmt} { FMT {

             { RECORD gdt.hrl }

             { RECORD_TYPE hrl }

             { REPEATS 999 }

          }}

          The only segment is another HRL gdt.hrl:

          # Record Layout: gdt.hrl

          #

          prologue

             who: Admin

             date: February 7, 2007 1:00:02 PM CET

             type: hrl

             version: 3.0

          end_prologue

          #

          # Include Files

          #

          #

          # Field declarations

          #

          {NAME HEADER} {TYPE fmt} { FMT {

             { RECORD gdt_head.frl }

             { RECORD_TYPE frl }

          }}

          {NAME BODY} {TYPE fmt} { FMT {

             { RECORD gdt_value.vrl }

             { RECORD_TYPE vrl }

          }}

          in reply to: HRL Segment Repeat #60597
          Klaus Wais
          Participant

            I already tried -1 but it seems not to work (tested with Testing Tool)

            Best Regards,

            Klaus Wais

          Viewing 4 replies – 1 through 4 (of 4 total)