This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Detecting a break in data


Tom,
	It sounds like you got the gist of what I need to do.  The
individual records are in numbered sequence, and must be reported as such,
but then are in blocks of either 'KEY_DATA' or 'RECnn' type lines (each
block of RECnn is always preceeded by its own KEY_DATA).  The basic
structure is something like...

Rule 1: RecordTy (Key_Data in Type_01) = "1"
Rule 2: RemitID (Key_Data in Type_01) = NONE
Rule 3: CompNum (Key_Data in Type_01) = NONE
Rule 4: Sequence (Key_Data in Type_01) = Index
Rule 5: Vmhkey (Rec01 in Type_01) = SPXVDR SP_Field:In1
Rule 6: Activsw1 (Rec01 in Type_01) = IF( SPSUST SP_Field:In1=" ","N","Y" )
.
.
.
Rule 60: Vmorigin (Rec01 in Type_01) = NONE
Rule 61: VendorID (Key_Data in Type_02) = SPXVDR SP_Field:In1
Rule 62: RecordTy (Key_Data in Type_02) = "2"
Rule 63: RemitID (Key_Data in Type_02) = SPXRMT SP_Field:In1
Rule 64: CompNum (Key_Data in Type_02) = NONE
Rule 65: Sequence (Key_Data in Type_02) = Index
Rule 66: Vrvendid (Rec02 in Type_02) = SPXVDR SP_Field:In1
Rule 67: Vrremid (Rec02 in Type_02) = SPXRMT SP_Field:In1

...and I want to display this as...

Rule 1: RecordTy (Key_Data in Type_01) = "1"
Rule 2: RemitID (Key_Data in Type_01) = NONE
Rule 3: CompNum (Key_Data in Type_01) = NONE
Rule 4: Sequence (Key_Data in Type_01) = Index
---
Rule 5: Vmhkey (Rec01 in Type_01) = SPXVDR SP_Field:In1
Rule 6: Activsw1 (Rec01 in Type_01) = IF( SPSUST SP_Field:In1=" ","N","Y" )
.
.
.
Rule 60: Vmorigin (Rec01 in Type_01) = NONE

---

Rule 61: VendorID (Key_Data in Type_02) = SPXVDR SP_Field:In1
Rule 62: RecordTy (Key_Data in Type_02) = "2"
Rule 63: RemitID (Key_Data in Type_02) = SPXRMT SP_Field:In1
Rule 64: CompNum (Key_Data in Type_02) = NONE
Rule 65: Sequence (Key_Data in Type_02) = Index
---
Rule 66: Vrvendid (Rec02 in Type_02) = SPXVDR SP_Field:In1
Rule 67: Vrremid (Rec02 in Type_02) = SPXRMT SP_Field:In1

The form of the actual XML is...

    <MapRule rulenumber="4">
      <objectset>Sequence Key_Data Field:Type_01 Record:Out</objectset>
      <objectrule>=Index</objectrule>
    </MapRule>
    <MapRule rulenumber="5">
      <objectset>Vmhkey Rec01 Field:Type_01 Record:Out</objectset>
      <objectrule>=SPXVDR SP_Field:In1</objectrule>
    </MapRule>

... from which I am using for-each MapRule, @rulenumber, the first word of
objectset (aFieldname), the second word of objectset (Key/Record label), and
objectrule (RuleData) to produce the lines seen in the first sample above.

Because the records are already in the correct order, all I need to do is
detect any change in the value of the second word in objectset between two
adjacent MapRules.  Also notice that the Key_Data label is the same for the
Rec01 MapRules as it is for the Rec02 MapRules, so I can't use this field
for sorting.

Does this make my position any clearer, or just confuse you further?
Perhaps I need to push this data out to an intermediate XML file, and then
reprocess it - can this be done and the result viewed by double-clicking
only on the source XML file?

Thanks,
Graham.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]