Thread: Re: [Servingxml-help] pos file repeating sections to nested XML
Brought to you by:
danielaparker
From: Brewer, K. <ken...@pe...> - 2005-11-26 19:15:06
|
Thanks for such prompt response and solution! I'll try the new release. The workaround script you provided worked perfectly. That leads to me another question - big surprise huh. What if there are multiple repeating sections scattered throughout the record - how do I specify how many times it repeats or where it ends and regular fields start again? Here's an example of the record with some attempted ascii-art annotation(view with non-truetype font), the actual record begins with 'JANE'. S | T | R | U | C | T |----------------------------------------- U || |(repeating)| | |(repeating) R || |-----------| | |---------------- E || | | | | | | | | | | --|JANEENGLC-MATHA+1972BLUECHICAGOILATLANTAGA F || | | | | | | | | | | I |N S G S G Y C C S C S E |a u r u r e o i t i t L |m b a b a a l t a t a D |e j d j d r o y t y t S | e e e e B r e e | c c o | t t r | n example disired output: <StudentGrades> <StudentGrade> <Name>JANE</Name> <SubjectGrade> <Subject>ENGL</Subject> <Grade>C-</Grade> </SubjectGrade> <SubjectGrade> <Subject>MATH</Subject> <Grade>A+</Grade> </SubjectGrade> <YearBorn>1972</YearBorn> <Color>BLUE</FavoriteColor> <Address> <City>CHICAGO</City> <State>IL</City> </Address> <Address> <City>ATLANTA</City> <State>GA</City> </Address> </StudentGrade> <StudentGrade> <!-- this 2nd record omitted for brevity --> </StudentGrade> </StudentGrades> Thanks again, -Ken > This issue reported below has been fixed in 0.3.1b. You can download it > from here: > http://sourceforge.net/project/showfiles.php?> group_id=95689&package_id=102046&release_id=369842 > An example resources-students.xml script has been added to the flatfile > samples. > Regards, > Daniel Parker ----- Original Message ----- From: "Daniel Parker" <dan...@sy...> To: "Brewer, Ken" <ken...@pe...>; <ser...@li...> Sent: Friday, November 25, 2005 11:59 PM Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > Hello Ken, > > Thanks for the feedback, the support for repeating groups is quite new, so > I'm pleased that it's being exercised. > > The resources script should look like this: > > <?xml version="1.0"?> > <sx:resources xmlns:sx="http://www.servingxml.com/core"> > > <sx:service name="students"> > <sx:serialize> > <sx:transform> > <sx:content ref="students-content"/> > </sx:transform> > </sx:serialize> > </sx:service> > > <sx:recordContent name="students-content"> > <sx:flatFileReader> > <sx:urlSource url="data/students.txt"/> > <sx:flatFile ref="students-file"/> > </sx:flatFileReader> > <sx:recordMapping ref="students-mapping"/> > </sx:recordContent> > > <sx:flatFile name="students-file"> > <sx:flatFileBody> > <sx:flatRecordType name="student"> > <sx:positionalField name="name" width="4"/> > <sx:repeatingGroup> > <sx:flatRecordType name="subject-grade"> > <sx:positionalField name="subject" width="4"/> > <sx:positionalField name="grade" width="1"/> > </sx:flatRecordType> > </sx:repeatingGroup> > </sx:flatRecordType> > </sx:flatFileBody> > </sx:flatFile> > > <sx:recordMapping name="students-mapping"> > <StudentGrades> > <sx:onRecord> > <StudentGrade> > <sx:fieldElementMap field="name" element="Name"/> > <SubjectGrade> > <sx:onRecord> > <sx:fieldElementMap field="subject" element="Subject"/> > <sx:fieldElementMap field="grade" element="Grade"/> > </sx:onRecord> > </SubjectGrade> > </StudentGrade> > </sx:onRecord> > </StudentGrades> > </sx:recordMapping> > > </sx:resources> > > However, you've uncovered a bug. The name field appearing before the > repeating group is being skipped. There is a workaround - you can get > this to work by enclosing the student record type definition in an > sx:flatRecordTypeChoice, with one choice, like this: > > <sx:flatFile name="students-file"> > <sx:flatFileBody> > <sx:flatRecordTypeChoice> > <sx:positionalField name="name" width="4"/> > <sx:when test="1=1"> > <sx:flatRecordType name="student"> > <sx:positionalField name="name" width="4"/> > <sx:repeatingGroup> > <sx:flatRecordType name="subject-grade"> > <sx:positionalField name="subject" width="4"/> > <sx:positionalField name="grade" width="1"/> > </sx:flatRecordType> > </sx:repeatingGroup> > </sx:flatRecordType> > </sx:when> > </sx:flatRecordTypeChoice> > </sx:flatFileBody> > </sx:flatFile> > > I've tested this this and it works (it's now like the comptest example, > which does work.) > > I'll have a fix for the straightforward implementation soon, and add your > example to the examples in the documentation. > > -- Daniel > > > ----- Original Message ----- > From: "Brewer, Ken" <ken...@pe...> > To: <ser...@li...> > Sent: Friday, November 25, 2005 10:15 PM > Subject: [Servingxml-help] pos file repeating sections to nested XML > > >> I'm new to serving xml, it's quite impressive, thanks! >> >> I'm trying convert a fixed width(positional) flat file, with repeating >> groups, to XML with nested elements. Can serving xml do this? I've made >> several attempts based on some of the examples but I still haven't been >> able >> to get the desired output. >> >> The flat file looks like this: >> >> JANEENGLCMATHA >> JOHNSCIEBHISTB >> >> and this is the XML output I'd like: >> >> <StudentGrades> >> <StudentGrade> >> <Name>JANE</Name> >> <SubjectGrade> >> <Subject>ENGL</Subject> >> <Grade>C</Grade> >> </SubjectGrade> >> <SubjectGrade> >> <Subject>MATH</Subject> >> <Grade>A</Grade> >> </SubjectGrade> >> </StudentGrade> >> <StudentGrade> >> <Name>JOHN</Name> >> <SubjectGrade> >> <Subject>SCIE</Subject> >> <Grade>B</Grade> >> </SubjectGrade> >> <SubjectGrade> >> <Subject>HIST</Subject> >> <Grade>B</Grade> >> </SubjectGrade> >> </StudentGrade> >> </StudentGrades> >> >> Thanks, >> >> -Ken >> >> **************************************************************************** >> This email may contain confidential material. >> If you were not an intended recipient, >> Please notify the sender and delete all copies. >> We may monitor email to and from our network. >> **************************************************************************** >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. Do you grep through log >> files >> for problems? Stop! Download the new AJAX search engine that makes >> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >> _______________________________________________ >> Servingxml-help mailing list >> Ser...@li... >> https://lists.sourceforge.net/lists/listinfo/servingxml-help >> > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Servingxml-help mailing list > Ser...@li... > https://lists.sourceforge.net/lists/listinfo/servingxml-help > **************************************************************************** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. **************************************************************************** |
From: Brewer, K. <ken...@pe...> - 2005-11-27 03:51:35
|
Daniel, There is no delimiter to identify the end of a repeating group in my file. Instead, the documentation for the import file indicates how many times a group repeats and suggests doing the math to determine where the repeating group ends. For example, if the address section repeats 10 times, then the whole repeating group is 90 characters wide(based on my example record below) and the next normal field begins after that. It seems like the pattern matching approach could be buggy i.e. if the repeating group fields and the subsequent normal field(to match on) were all numbers i.e. 19721964 where 1-2 and 3-4 are fields of a 2 field repeating group but 5-8 is a normal field. Ideally though, it would be nice if there was a more finite way i.e. if the repeatingGroup element honored an attribute such as 'count="10"'. The example I gave below is not my exact record layout and I have several files with similar problems. I will take a second look at the docs for them, maybe the datatypes of the fields adjacent to the repeating group are different than the repeating group such that pattern matching would work reliably. Can servingxml perform multiple passes e.g. if we know that address repeats 10 times for a total of 90 characters, can we parse it out as one 90 character field then, in a 2nd pass, parse that as a separate record where the whole record is one repeating group? Even if servingxml doesn't support this directly, it seems like it could be done by driving servingxml from Java(embedded mode) with multiple resource scripts(or services) by passing the 1st service the whole record, then passing the 90 character address group to a 2nd service, and so on. Maybe more work and less ideal but still much better than writing the whole thing myself! Thanks again, Ken > Ken, > > Currently, support is limited to a single repeating group at the tail of a > record. The items in the group may be heterogenous and have different > record types, if a test evaluated against the leading fields of an item can > reveal the type, see the segments example. But that doesn't cover your case > below. > > Mixing multiple repeating groups with fields means we need to be able to > determine where the group ends. One way is to allow repeating groups to be > separated by field delimiters (we actually support that with an older, no > longer documented, approach), but that also won't cover your case below. > Your case would require separating repeating groups based on pattern matching on a field, in particular, a field recognizable as a year field. > > Can you just confirm that in your requirements, there is no delimiter as > such to identify the end of the group, but that the end must be determined > by characteristics of the next field value? > > Thanks, > Daniel ----- Original Message ----- From: "Brewer, Ken" <ken...@pe...> To: <ser...@li...>; "'Daniel Parker '" <dan...@sy...> Sent: Saturday, November 26, 2005 2:15 PM Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > Thanks for such prompt response and solution! I'll try the new release. > The > workaround script you provided worked perfectly. That leads to me another > question - big surprise huh. What if there are multiple repeating sections > scattered throughout the record - how do I specify how many times it > repeats > or where it ends and regular fields start again? > > Here's an example of the record with soI've me attempted ascii-art > annotation(view with non-truetype font), the actual record begins with > 'JANE'. > > S | > T | > R | > U | > C | > T |----------------------------------------- > U || |(repeating)| | |(repeating) > R || |-----------| | |---------------- > E || | | | | | | | | | | > --|JANEENGLC-MATHA+1972BLUECHICAGOILATLANTAGA > F || | | | | | | | | | | > I |N S G S G Y C C S C S > E |a u r u r e o i t i t > L |m b a b a a l t a t a > D |e j d j d r o y t y t > S | e e e e B r e e > | c c o > | t t r > | n > > > example disired output: > > <StudentGrades> > <StudentGrade> > <Name>JANE</Name> > <SubjectGrade> > <Subject>ENGL</Subject> > <Grade>C-</Grade> > </SubjectGrade> > <SubjectGrade> > <Subject>MATH</Subject> > <Grade>A+</Grade> > </SubjectGrade> > <YearBorn>1972</YearBorn> > <Color>BLUE</FavoriteColor> > <Address> > <City>CHICAGO</City> > <State>IL</City> > </Address> > <Address> > <City>ATLANTA</City> > <State>GA</City> > </Address> > </StudentGrade> > <StudentGrade> > <!-- this 2nd record omitted for brevity --> > </StudentGrade> > </StudentGrades> > > Thanks again, > > -Ken > **************************************************************************** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. **************************************************************************** |
From: Daniel P. <dan...@sy...> - 2005-11-28 03:11:14
|
Ken, Okay, I understand your requirement. Adding a count attribute to sx:repeatingGroup is easy. Supporting multiple repeating groups intermixed with field definitions is a little more work. I don't have much time this week, but I should be able to put out a release in the following week that implements these features. -- Daniel ----- Original Message ----- From: "Brewer, Ken" <ken...@pe...> To: <ser...@li...>; "'Daniel Parker '" <dan...@sy...> Sent: Saturday, November 26, 2005 10:51 PM Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > Daniel, > > There is no delimiter to identify the end of a repeating group in my file. > Instead, the documentation for the import file indicates how many times a > group repeats and suggests doing the math to determine where the repeating > group ends. For example, if the address section repeats 10 times, then the > whole repeating group is 90 characters wide(based on my example record > below) and the next normal field begins after that. > > It seems like the pattern matching approach could be buggy i.e. if the > repeating group fields and the subsequent normal field(to match on) were > all > numbers i.e. 19721964 where 1-2 and 3-4 are fields of a 2 field repeating > group but 5-8 is a normal field. Ideally though, it would be nice if there > was a more finite way i.e. if the repeatingGroup element honored an > attribute such as 'count="10"'. The example I gave below is not my exact > record layout and I have several files with similar problems. I will take > a > second look at the docs for them, maybe the datatypes of the fields > adjacent > to the repeating group are different than the repeating group such that > pattern matching would work reliably. > > Can servingxml perform multiple passes e.g. if we know that address > repeats > 10 times for a total of 90 characters, can we parse it out as one 90 > character field then, in a 2nd pass, parse that as a separate record where > the whole record is one repeating group? > > Even if servingxml doesn't support this directly, it seems like it could > be > done by driving servingxml from Java(embedded mode) with multiple resource > scripts(or services) by passing the 1st service the whole record, then > passing the 90 character address group to a 2nd service, and so on. Maybe > more work and less ideal but still much better than writing the whole > thing > myself! > > Thanks again, > > Ken > |
From: Brewer, K. <ken...@pe...> - 2005-11-28 16:40:39
|
Sounds great. I have about 30 different files to import/export. I think this is one of the more exotic requirements but it's still likely that I'll encounter another need for a tweak later on. I'd like to understand how I might go about making tweaks like this myself if necessary. Can you give me a brief description? Thanks, -Ken -----Original Message----- From: Daniel Parker [mailto:dan...@sy...] Sent: Sunday, November 27, 2005 9:11 PM To: Brewer, Ken; ser...@li... Subject: Re: [Servingxml-help] pos file repeating sections to nested XML Ken, Okay, I understand your requirement. Adding a count attribute to sx:repeatingGroup is easy. Supporting multiple repeating groups intermixed with field definitions is a little more work. I don't have much time this week, but I should be able to put out a release in the following week that implements these features. -- Daniel ----- Original Message ----- From: "Brewer, Ken" <ken...@pe...> To: <ser...@li...>; "'Daniel Parker '" <dan...@sy...> Sent: Saturday, November 26, 2005 10:51 PM Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > Daniel, > > There is no delimiter to identify the end of a repeating group in my file. > Instead, the documentation for the import file indicates how many times a > group repeats and suggests doing the math to determine where the repeating > group ends. For example, if the address section repeats 10 times, then the > whole repeating group is 90 characters wide(based on my example record > below) and the next normal field begins after that. > > It seems like the pattern matching approach could be buggy i.e. if the > repeating group fields and the subsequent normal field(to match on) were > all > numbers i.e. 19721964 where 1-2 and 3-4 are fields of a 2 field repeating > group but 5-8 is a normal field. Ideally though, it would be nice if there > was a more finite way i.e. if the repeatingGroup element honored an > attribute such as 'count="10"'. The example I gave below is not my exact > record layout and I have several files with similar problems. I will take > a > second look at the docs for them, maybe the datatypes of the fields > adjacent > to the repeating group are different than the repeating group such that > pattern matching would work reliably. > > Can servingxml perform multiple passes e.g. if we know that address > repeats > 10 times for a total of 90 characters, can we parse it out as one 90 > character field then, in a 2nd pass, parse that as a separate record where > the whole record is one repeating group? > > Even if servingxml doesn't support this directly, it seems like it could > be > done by driving servingxml from Java(embedded mode) with multiple resource > scripts(or services) by passing the 1st service the whole record, then > passing the 90 character address group to a 2nd service, and so on. Maybe > more work and less ideal but still much better than writing the whole > thing > myself! > > Thanks again, > > Ken > **************************************************************************** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. **************************************************************************** |
From: Daniel P. <dan...@sy...> - 2005-11-29 03:31:27
|
Currently, if the built-in record parsing does not do what you want, you have one other option. You can define some leading fields in the flatRecordType section, and then define one additional delimited field that uses the default field delimiter, which will give the rest of the record as a single field. Then you can define a customRecordFilter, supplying a record filter that you write in Java. In that filter, you can access the fields defined previously, parse the remaining part of the record yourself in Java code, and build a new record using a RecordBuilder, and then pass that new record down the pipeline. Have a look at the "hot 1" example for an example of implementing a custom record filter. Some time in the future I may refactor the file parsing to expose customizable event handling, but not now. -- Daniel ----- Original Message ----- From: "Brewer, Ken" <ken...@pe...> To: "'Daniel Parker'" <dan...@sy...>; <ser...@li...> Sent: Monday, November 28, 2005 11:40 AM Subject: RE: [Servingxml-help] pos file repeating sections to nested XML > Sounds great. I have about 30 different files to import/export. I think > this > is one of the more exotic requirements but it's still likely that I'll > encounter another need for a tweak later on. I'd like to understand how I > might go about making tweaks like this myself if necessary. Can you give > me > a brief description? > > Thanks, > > -Ken > > -----Original Message----- > From: Daniel Parker [mailto:dan...@sy...] > Sent: Sunday, November 27, 2005 9:11 PM > To: Brewer, Ken; ser...@li... > Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > > Ken, > > Okay, I understand your requirement. > > Adding a count attribute to sx:repeatingGroup is easy. Supporting > multiple > repeating groups intermixed with field definitions is a little more work. > I > > don't have much time this week, but I should be able to put out a release > in > > the following week that implements these features. > > -- Daniel > > ----- Original Message ----- > From: "Brewer, Ken" <ken...@pe...> > To: <ser...@li...>; "'Daniel Parker '" > <dan...@sy...> > Sent: Saturday, November 26, 2005 10:51 PM > Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > > >> Daniel, >> >> There is no delimiter to identify the end of a repeating group in my >> file. >> Instead, the documentation for the import file indicates how many times a >> group repeats and suggests doing the math to determine where the >> repeating >> group ends. For example, if the address section repeats 10 times, then >> the >> whole repeating group is 90 characters wide(based on my example record >> below) and the next normal field begins after that. >> >> It seems like the pattern matching approach could be buggy i.e. if the >> repeating group fields and the subsequent normal field(to match on) were >> all >> numbers i.e. 19721964 where 1-2 and 3-4 are fields of a 2 field repeating >> group but 5-8 is a normal field. Ideally though, it would be nice if >> there >> was a more finite way i.e. if the repeatingGroup element honored an >> attribute such as 'count="10"'. The example I gave below is not my exact >> record layout and I have several files with similar problems. I will take >> a >> second look at the docs for them, maybe the datatypes of the fields >> adjacent >> to the repeating group are different than the repeating group such that >> pattern matching would work reliably. >> >> Can servingxml perform multiple passes e.g. if we know that address >> repeats >> 10 times for a total of 90 characters, can we parse it out as one 90 >> character field then, in a 2nd pass, parse that as a separate record >> where >> the whole record is one repeating group? >> >> Even if servingxml doesn't support this directly, it seems like it could >> be >> done by driving servingxml from Java(embedded mode) with multiple >> resource >> scripts(or services) by passing the 1st service the whole record, then >> passing the 90 character address group to a 2nd service, and so on. Maybe >> more work and less ideal but still much better than writing the whole >> thing >> myself! >> >> Thanks again, >> >> Ken >> > > > **************************************************************************** > This email may contain confidential material. > If you were not an intended recipient, > Please notify the sender and delete all copies. > We may monitor email to and from our network. > **************************************************************************** > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Servingxml-help mailing list > Ser...@li... > https://lists.sourceforge.net/lists/listinfo/servingxml-help > |
From: Daniel P. <dan...@sy...> - 2005-12-19 04:13:01
|
Version 0.3.2, just released, now supports a count attribute for repeating groups, and supports multiple repeating groups mixed with fields. See the "students-fix" example in the on-line documentation. -- Daniel ----- Original Message ----- From: "Brewer, Ken" <ken...@pe...> To: "'Daniel Parker'" <dan...@sy...>; <ser...@li...> Sent: Monday, November 28, 2005 11:40 AM Subject: RE: [Servingxml-help] pos file repeating sections to nested XML > Sounds great. I have about 30 different files to import/export. I think > this > is one of the more exotic requirements but it's still likely that I'll > encounter another need for a tweak later on. I'd like to understand how I > might go about making tweaks like this myself if necessary. Can you give > me > a brief description? > > Thanks, > > -Ken > > -----Original Message----- > From: Daniel Parker [mailto:dan...@sy...] > Sent: Sunday, November 27, 2005 9:11 PM > To: Brewer, Ken; ser...@li... > Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > > Ken, > > Okay, I understand your requirement. > > Adding a count attribute to sx:repeatingGroup is easy. Supporting > multiple > repeating groups intermixed with field definitions is a little more work. > I > > don't have much time this week, but I should be able to put out a release > in > > the following week that implements these features. > > -- Daniel > > ----- Original Message ----- > From: "Brewer, Ken" <ken...@pe...> > To: <ser...@li...>; "'Daniel Parker '" > <dan...@sy...> > Sent: Saturday, November 26, 2005 10:51 PM > Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > > >> Daniel, >> >> There is no delimiter to identify the end of a repeating group in my >> file. >> Instead, the documentation for the import file indicates how many times a >> group repeats and suggests doing the math to determine where the >> repeating >> group ends. For example, if the address section repeats 10 times, then >> the >> whole repeating group is 90 characters wide(based on my example record >> below) and the next normal field begins after that. >> >> It seems like the pattern matching approach could be buggy i.e. if the >> repeating group fields and the subsequent normal field(to match on) were >> all >> numbers i.e. 19721964 where 1-2 and 3-4 are fields of a 2 field repeating >> group but 5-8 is a normal field. Ideally though, it would be nice if >> there >> was a more finite way i.e. if the repeatingGroup element honored an >> attribute such as 'count="10"'. The example I gave below is not my exact >> record layout and I have several files with similar problems. I will take >> a >> second look at the docs for them, maybe the datatypes of the fields >> adjacent >> to the repeating group are different than the repeating group such that >> pattern matching would work reliably. >> >> Can servingxml perform multiple passes e.g. if we know that address >> repeats >> 10 times for a total of 90 characters, can we parse it out as one 90 >> character field then, in a 2nd pass, parse that as a separate record >> where >> the whole record is one repeating group? >> >> Even if servingxml doesn't support this directly, it seems like it could >> be >> done by driving servingxml from Java(embedded mode) with multiple >> resource >> scripts(or services) by passing the 1st service the whole record, then >> passing the 90 character address group to a 2nd service, and so on. Maybe >> more work and less ideal but still much better than writing the whole >> thing >> myself! >> >> Thanks again, >> >> Ken >> > > > **************************************************************************** > This email may contain confidential material. > If you were not an intended recipient, > Please notify the sender and delete all copies. > We may monitor email to and from our network. > **************************************************************************** > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Servingxml-help mailing list > Ser...@li... > https://lists.sourceforge.net/lists/listinfo/servingxml-help > |
From: Daniel P. <dan...@sy...> - 2005-11-27 01:12:33
|
Ken, Currently, support is limited to a single repeating group at the tail of a record. The items in the group may be heterogenous and have different record types, if a test evaluated against the leading fields of an item can reveal the type, see the segments example. But that doesn't cover your case below. Mixing multiple repeating groups with fields means we need to be able to determine where the group ends. One way is to allow repeating groups to be separated by field delimiters (we actually support that with an older, no longer documented, approach), but that also won't cover your case below. Your case would require separating repeating groups based on pattern matching on a field, in particular, a field recognizable as a year field. Can you just confirm that in your requirements, there is no delimiter as such to identify the end of the group, but that the end must be determined by characteristics of the next field value? Thanks, Daniel ----- Original Message ----- From: "Brewer, Ken" <ken...@pe...> To: <ser...@li...>; "'Daniel Parker '" <dan...@sy...> Sent: Saturday, November 26, 2005 2:15 PM Subject: Re: [Servingxml-help] pos file repeating sections to nested XML > Thanks for such prompt response and solution! I'll try the new release. > The > workaround script you provided worked perfectly. That leads to me another > question - big surprise huh. What if there are multiple repeating sections > scattered throughout the record - how do I specify how many times it > repeats > or where it ends and regular fields start again? > > Here's an example of the record with soI've me attempted ascii-art > annotation(view with non-truetype font), the actual record begins with > 'JANE'. > > S | > T | > R | > U | > C | > T |----------------------------------------- > U || |(repeating)| | |(repeating) > R || |-----------| | |---------------- > E || | | | | | | | | | | > --|JANEENGLC-MATHA+1972BLUECHICAGOILATLANTAGA > F || | | | | | | | | | | > I |N S G S G Y C C S C S > E |a u r u r e o i t i t > L |m b a b a a l t a t a > D |e j d j d r o y t y t > S | e e e e B r e e > | c c o > | t t r > | n > > > example disired output: > > <StudentGrades> > <StudentGrade> > <Name>JANE</Name> > <SubjectGrade> > <Subject>ENGL</Subject> > <Grade>C-</Grade> > </SubjectGrade> > <SubjectGrade> > <Subject>MATH</Subject> > <Grade>A+</Grade> > </SubjectGrade> > <YearBorn>1972</YearBorn> > <Color>BLUE</FavoriteColor> > <Address> > <City>CHICAGO</City> > <State>IL</City> > </Address> > <Address> > <City>ATLANTA</City> > <State>GA</City> > </Address> > </StudentGrade> > <StudentGrade> > <!-- this 2nd record omitted for brevity --> > </StudentGrade> > </StudentGrades> > > Thanks again, > > -Ken > |