Forum Replies Created
-
AuthorReplies
-
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}]
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.
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 }
}}
I already tried -1 but it seems not to work (tested with Testing Tool) Best Regards,
Klaus Wais
-
AuthorReplies