servingxml-help Mailing List for ServingXML (Page 13)
Brought to you by:
danielaparker
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(11) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(9) |
Mar
(1) |
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(8) |
Nov
|
Dec
(2) |
2007 |
Jan
(2) |
Feb
|
Mar
(14) |
Apr
(25) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(5) |
Aug
(1) |
Sep
(4) |
Oct
(3) |
Nov
(3) |
Dec
(7) |
2010 |
Jan
(2) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(3) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
2011 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(20) |
Dec
(24) |
2015 |
Jan
(25) |
Feb
(20) |
Mar
(29) |
Apr
(12) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(3) |
Dec
(7) |
2016 |
Jan
(7) |
Feb
(5) |
Mar
(7) |
Apr
(5) |
May
(4) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(5) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Edgar De la C. S. <edg...@na...> - 2006-01-16 20:38:46
|
Hi I have a problem executing servingxml in embed mode. If my application runs in standalone mode all works fine, but adding this functionality to another application the program blocks itself in the line: service.execute(serviceContext, parameters, flow); and never finish. I have debugged the application with the source code and found that the problem is in this method from Pipeline class: public void execute(ContentHandler contentHandler) throws ServingXmlException { try { xmlReader.setContentHandler(contentHandler); xmlReader.parse(systemId); } catch (SAXException se) { Throwable cause = se; if (se.getException() != null) { cause = se.getException(); } if (cause instanceof ServingXmlException) { throw (ServingXmlException)cause; } else { throw new ServingXmlException(cause.getMessage(),cause); } } catch (java.io.IOException e) { throw new ServingXmlException(e.getMessage(),e); } } } The application is blocked in the line: xmlReader.parse(systemId); I don't know why if the same code runs fine outside. Thanks Edgar De la Cruz Salgado Desarrollador Sr. North American Software S.A. de C.V. <http://www.nasoft.com/> www.nasoft.com Bosques de Alisos # 47-B P.B. Bosques de las Lomas Mexico D.F. 05120 Cel. 04455 1320 8616 |
From: Daniel P. <dan...@sy...> - 2006-01-16 04:38:40
|
Version 0.3.3 has been released, which includes this example as "bookorders" in the "Flat to Flat" section of the on-line examples. Regards, Daniel Parker ----- Original Message ----- From: "Bala Murali" <sba...@ya...> To: "Daniel Parker" <dan...@sy...> Sent: Wednesday, January 11, 2006 10:08 PM Subject: Re: [Servingxml-help] Transformation on Flat files > Hi Daniel > > Please see the attached zip file > > 1.resources-testconversion.xml converts positional to > delimited > > 2.input-books-pos is the input file > > 3.output-books-delim is the output file if you run > with the existing resource-testconversion.xml > > 4.However the expected output is > expected-output-books-delim.txt. The expected output > file should have INV static text appended to InvoiceNo > and the date format of InvoiceDate is converted from > dd/MMM/YYY to dd/mm/YYYY. So we need a transformation > of concat and changeDate, similarly there could be > other use cases like trim, replace etc. > > Regards > > Bala > > --- Daniel Parker <dan...@sy...> wrote: > >> When I've received an example from you showing an >> original and expected file >> layout, that covers off your use cases, I'll have a >> look at it. In the >> meantime, you can use the other options mentioned in >> my response. >> >> Regards, >> Daniel Parker >> >> ----- Original Message ----- >> From: "Bala Murali" <sba...@ya...> >> To: "Daniel Parker" <dan...@sy...> >> Sent: Tuesday, January 10, 2006 11:38 PM >> Subject: Re: [Servingxml-help] Transformation on >> Flat files >> >> >> > Hi Daniel >> > >> > I was trying to modify your examples books to >> acheive >> > this, so there are no new sample files, I would of >> > course test them once you put in the release and >> let >> > you know my findings. I assume this is going to be >> a >> > generic record element which can take any >> operation >> > like concat, replace, trim etc with parameters via >> > sx:property >> > >> > Regards >> > >> > Bala >> > >> > >> > >> > --- Daniel Parker <dan...@sy...> >> wrote: >> > >> >> Hello Bala, >> >> >> >> Currently, flat to flat transformation as shown >> in >> >> the examples does not >> >> support transformations other than with a Java >> >> record filter. An >> >> alternative option would be to use the record >> >> mapping to XML followed by an >> >> inverse record mapping to flat, which would work, >> >> but might be a little >> >> excessive for the purpose at hand. It is, >> however, >> >> relatively easy to add a >> >> new element, say sx:changeRecordFilter, which >> would >> >> allow you to do these >> >> things simply. I'll put out a new release in >> about >> >> a week with the new >> >> element. The element could also be made >> available >> >> as a patch to your >> >> exisiting release. >> >> >> >> If possible, it would be appreciated if you could >> >> provide a simple example >> >> with an original and target flat file, to test >> that >> >> the element covers off >> >> all your cases. >> >> >> >> Regards, >> >> Daniel Parker >> >> >> >> ----- Original Message ----- >> >> From: "Bala Murali" <sba...@ya...> >> >> To: <ser...@li...> >> >> Sent: Tuesday, January 10, 2006 12:51 AM >> >> Subject: [Servingxml-help] Transformation on Flat >> >> files >> >> >> >> >> >> > Hi >> >> > >> >> > I am working on a flat file to flat file >> >> > transformation resource files where I would >> like >> >> to >> >> > apply multiple >> >> > functions like >> >> > >> >> > - concat >> >> > - Replace >> >> > - substring >> >> > - trim >> >> > etc. Is there a way to do this, I see this is >> >> possible >> >> > in xml with various sx:replace. >> >> > >> >> > Any help most welcome >> >> > >> >> > Thanks >> >> > >> >> > Bala >> >> > >> >> > >> >> > >> >> > __________________________________________ >> >> > Yahoo! DSL - Something to write home about. >> >> > Just $16.99/mo. or less. >> >> > dsl.yahoo.com >> >> > >> >> > >> >> > >> >> > >> >> >> > >> > ------------------------------------------------------- >> >> > 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 >> >> > >> >> >> >> >> >> >> > >> > >> > __________________________________________________ >> > Do You Yahoo!? >> > Tired of spam? Yahoo! Mail has the best spam >> protection around >> > http://mail.yahoo.com >> > >> >> >> >> >> > ------------------------------------------------------- >> 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 >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com |
From: Daniel P. <dan...@sy...> - 2006-01-11 13:41:43
|
When I've received an example from you showing an original and expected file layout, that covers off your use cases, I'll have a look at it. In the meantime, you can use the other options mentioned in my response. Regards, Daniel Parker ----- Original Message ----- From: "Bala Murali" <sba...@ya...> To: "Daniel Parker" <dan...@sy...> Sent: Tuesday, January 10, 2006 11:38 PM Subject: Re: [Servingxml-help] Transformation on Flat files > Hi Daniel > > I was trying to modify your examples books to acheive > this, so there are no new sample files, I would of > course test them once you put in the release and let > you know my findings. I assume this is going to be a > generic record element which can take any operation > like concat, replace, trim etc with parameters via > sx:property > > Regards > > Bala > > > > --- Daniel Parker <dan...@sy...> wrote: > >> Hello Bala, >> >> Currently, flat to flat transformation as shown in >> the examples does not >> support transformations other than with a Java >> record filter. An >> alternative option would be to use the record >> mapping to XML followed by an >> inverse record mapping to flat, which would work, >> but might be a little >> excessive for the purpose at hand. It is, however, >> relatively easy to add a >> new element, say sx:changeRecordFilter, which would >> allow you to do these >> things simply. I'll put out a new release in about >> a week with the new >> element. The element could also be made available >> as a patch to your >> exisiting release. >> >> If possible, it would be appreciated if you could >> provide a simple example >> with an original and target flat file, to test that >> the element covers off >> all your cases. >> >> Regards, >> Daniel Parker >> >> ----- Original Message ----- >> From: "Bala Murali" <sba...@ya...> >> To: <ser...@li...> >> Sent: Tuesday, January 10, 2006 12:51 AM >> Subject: [Servingxml-help] Transformation on Flat >> files >> >> >> > Hi >> > >> > I am working on a flat file to flat file >> > transformation resource files where I would like >> to >> > apply multiple >> > functions like >> > >> > - concat >> > - Replace >> > - substring >> > - trim >> > etc. Is there a way to do this, I see this is >> possible >> > in xml with various sx:replace. >> > >> > Any help most welcome >> > >> > Thanks >> > >> > Bala >> > >> > >> > >> > __________________________________________ >> > Yahoo! DSL - Something to write home about. >> > Just $16.99/mo. or less. >> > dsl.yahoo.com >> > >> > >> > >> > >> > ------------------------------------------------------- >> > 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 >> > >> >> >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > |
From: Daniel P. <dan...@sy...> - 2006-01-10 23:45:23
|
Hello Bala, Currently, flat to flat transformation as shown in the examples does not support transformations other than with a Java record filter. An alternative option would be to use the record mapping to XML followed by an inverse record mapping to flat, which would work, but might be a little excessive for the purpose at hand. It is, however, relatively easy to add a new element, say sx:changeRecordFilter, which would allow you to do these things simply. I'll put out a new release in about a week with the new element. The element could also be made available as a patch to your exisiting release. If possible, it would be appreciated if you could provide a simple example with an original and target flat file, to test that the element covers off all your cases. Regards, Daniel Parker ----- Original Message ----- From: "Bala Murali" <sba...@ya...> To: <ser...@li...> Sent: Tuesday, January 10, 2006 12:51 AM Subject: [Servingxml-help] Transformation on Flat files > Hi > > I am working on a flat file to flat file > transformation resource files where I would like to > apply multiple > functions like > > - concat > - Replace > - substring > - trim > etc. Is there a way to do this, I see this is possible > in xml with various sx:replace. > > Any help most welcome > > Thanks > > Bala > > > > __________________________________________ > Yahoo! DSL - Something to write home about. > Just $16.99/mo. or less. > dsl.yahoo.com > > > > ------------------------------------------------------- > 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: Bala M. <sba...@ya...> - 2006-01-10 05:52:04
|
Hi I am working on a flat file to flat file transformation resource files where I would like to apply multiple functions like - concat - Replace - substring - trim etc. Is there a way to do this, I see this is possible in xml with various sx:replace. Any help most welcome Thanks Bala __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com |
From: Bala M. <sba...@ya...> - 2005-12-30 04:29:12
|
Hi I would like to know is there any company which can partner us to support serving xml in our product. I am working for a banking product and would like to integrate serving xml in transformation process. Anybody interested please revert Thanks Bala __________________________________ Yahoo! for Good - Make a difference this year. http://brand.yahoo.com/cybergivingweek2005/ |
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-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: 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-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-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-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 > |
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: Daniel P. <dan...@sy...> - 2005-11-26 16:40:49
|
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 > |
From: Daniel P. <dan...@sy...> - 2005-11-26 04:59:49
|
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 > |
From: Brewer, K. <ken...@pe...> - 2005-11-26 03:15:24
|
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. **************************************************************************** |
From: Daniel P. <dan...@sy...> - 2005-11-10 13:48:12
|
Wonne, Have a look at the sx:removeEmptyElementFilter element in the element = reference and in the examples "CONV" and "multivalued" where it is used. = That will allow you to strip out the empty <info/> elements. -- Daniel ----- Original Message -----=20 From: Keysers Wonne=20 To: Daniel Parker=20 Sent: Thursday, November 10, 2005 8:33 AM Subject: RE: Multiple record types per row in flatfile Hi Daniel, Sorry to bother you again, but I encounter yet another issue in our = file that I cannot solve 'instantly'. Imagine that the persons.txt file contains 2 additional fields info1 = and info2 and that they need to go into the PersonInfo section of the = resulting file: <PersonInfos> <PersonInfo> <PersonId/> <Infos> <Info><value/><sequence/></Info> <Info><value/><sequence/></Info> </Infos> </PersonInfo> <PersonInfos> No problem so fa; the problem is that if info2 field is empty, the = <Info/> element should not be generated and I don't seem to be able to = do this with the grouping mechanism: <sx:recordMapping name=3D"infosMapping"> <PersonInfos> <sx:innerGroup> <sx:startGroup test=3D"sx:current//DataType=3D'P'"/> <sx:groupBy fields=3D"PersonId"> <PersonInfo> <sx:fieldElementMap field=3D"PersonId" = element=3D"PersonId"/> <Infos> <sx:groupChoice> <sx:innerGroup> <sx:startGroup test=3D"sx:current//info1!=3D''"/> <Info><sx:fieldElementMap field=3D"info1" = element=3D"Value"/></Info><Sequence>1</Sequence> </sx:innerGroup> <sx:innerGroup> <sx:startGroup test=3D"sx:current//info2!=3D''"/> <Info><sx:fieldElementMap field=3D"info2" = element=3D"Value"/></Info><Sequence>2</Sequence> </sx:innerGroup> </Infos> </sx:groupChoice> </PersonInfo> </sx:groupBy> </sx:innerGroup> </PersonInfos> </sx:recordMapping> Do you have a solution? Thanks Wonne -------------------------------------------------------------------------= ----- From: Daniel Parker [mailto:dan...@sy...] Sent: Mon 7/11/2005 3:44 To: Keysers Wonne Subject: Re: Multiple record types per row in flatfile Hi Wonne, Your record type definition is fine (there is a new approach = documented, but the old approach is still supported, don't change it = yet.) This statement <sx:onRecord recordType=3D"persons" /> only restricts the children of sx:onRecord, it has no affect on the = ancestors (that's part of "no side effects.") So this won't help you. There are two places where you can restrict the records. (1.) You = can filter out records in the record reader, so that you'll never see = them in the record mapping section. Or, (2.) you can restrict grouping = to particular record types in the record mapping section. To filter out records in the record reader (1), you can add a = sx:restrictRecordFilter element to the children of sx:flatFileReader as = shown below. Now the persons mapping won't see the DataType=3D'C' = records at all, but the address mappings will. <sx:recordMapping name=3D"personsAddressesMapping"> <Persons-Addresses> <sx:recordContent> <sx:flatFileReader> <sx:flatFile ref=3D"personsData"/> <sx:restrictRecordFilter> <sx:restrictField field=3D"DataType" match=3D"P"/> </sx:restrictRecordFilter> </sx:flatFileReader> <sx:recordMapping ref=3D"personsMapping"/> </sx:recordContent> <sx:recordContent> <sx:flatFileReader> <sx:flatFile ref=3D"personsData"/> </sx:flatFileReader> <sx:recordMapping ref=3D"addressesMapping"/> </sx:recordContent> </Persons-Addresses> </sx:recordMapping> The alternative (2) is to restrict the group to persons records. The = simplest way would be to change the groupBy as follows <sx:groupBy recordType=3D"persons" fields=3D"PersonId"> Unfortunately that's not currently supported (I'll add it to the next = release.) =20 Instead you can enclose the sx:groupBy element in a sx:innerGroup = element that only allows the persons through, like this <sx:recordMapping name=3D"personsMapping"> <Persons> <sx:innerGroup> <sx:startGroup test=3D"boolean(sx:current/persons)=3D'true'"/> <sx:groupBy fields=3D"PersonId"> <Person> <sx:fieldElementMap field=3D"PersonId" = element=3D"PersonId"/> <sx:fieldElementMap field=3D"Name" element=3D"Name"/> <sx:fieldElementMap field=3D"FirstName" = element=3D"FirstName"/> <sx:onRecord/> </Person> </sx:groupBy> </sx:innerGroup> </Persons> </sx:recordMapping> (You could also use=20 <sx:startGroup test=3D"sx:current//DataType=3D'P'"/>) Regards, Daniel Parker ----- Original Message -----=20 From: Keysers Wonne=20 To: Daniel Parker=20 Sent: Friday, November 04, 2005 3:00 AM Subject: RE: Multiple record types per row in flatfile Hi Daniel, This feature works great when the flat file contains only persons, = but now I have a file containing e.g. companies as well. Example: The first field (DataType) in the flatfile indicates = whether it is a person or a company. In case of a company, the FirstName = is blank. I was trying to implement this by changing the flatfile definition = and persons record type from the example to something like this, but it = doesn't seem to work.=20 <sx:flatFile name=3D"personsData"> <sx:flatFileHeader lineCount=3D"1"/> <sx:flatFileBody> <sx:flatRecordType> <sx:positionalField name=3D"DataType" start=3D"1" = width=3D"1"/> </sx:flatRecordType> <sx:choose> <sx:when test=3D"DataType=3D'P'"> <sx:flatRecordType ref=3D"persons"/> </sx:when> <sx:otherwise><sx:flatRecordType = ref=3D"companies"/></sx:otherwise> </sx:choose> </sx:flatFileBody> </sx:flatFile>=20 <sx:recordMapping name=3D"personsMapping"> <Persons> <sx:groupBy fields=3D"PersonId"> <Person> <sx:fieldElementMap field=3D"PersonId" = element=3D"PersonId"/> <sx:fieldElementMap field=3D"Name" element=3D"Name"/> <sx:fieldElementMap field=3D"FirstName" = element=3D"FirstName"/> <sx:onRecord recordType=3D"persons" /> </Person> </sx:groupBy> </Persons> </sx:recordMapping> Do you have a solution for this as well? Thanks again Wonne -------------------------------------------------------------------------= --- From: Daniel Parker [mailto:dan...@sy...] Sent: Fri 28/10/2005 23:39 To: Keysers Wonne Subject: Re: Multiple record types per row in flatfile Hello Wonne, I'll implement the proposed solution first, which I know how to do, = and if you could test it that would be very much appreciated. The alternative would mean having to support two groups of records = below the root element, Persons and PersonAddresses, viz. <Example> <Persons> ... </Persons> <PersonAddresses> ... </PersonAddresses> =20 </Example> Currently, the tool only supports one, I don't know how to support = two (with one record source) and still stream the records through, = without caching the Persons and PersonAddresses output nodes. Regards, Daniel Parker ----- Original Message -----=20 From: Keysers Wonne=20 To: Daniel Parker=20 Sent: Friday, October 28, 2005 4:00 AM Subject: RE: Multiple record types per row in flatfile Hi Daniel, Yes yes, this could indeed be a solution for our case, since 1 = line is converted to multiple XML entities and grouping, etc. can be = added to each recordMapping (e.g. all addresses grouped per person) I'm only affraid that there will be a tremendous performance = penalty when reading the flat file multiple times, because the real data = files we are dealing with are quite big, if not huge, and they also = contain even more record mappings. Therefore, would it be a solution to allow multiple recordMappings = on the same file? (This was in fact what I meant with 'multiple record = types per row')=20 Anyway, if you think you have a release candidate, I'm certainly = willing to test it with files from our data provider. The sooner the = better :-) Thanks, by the way, for your great support and framework! Kind regards Wonne -------------------------------------------------------------------------= - From: Daniel Parker [mailto:dan...@sy...] Sent: Fri 28/10/2005 6:12 To: Keysers Wonne Subject: Re: Multiple record types per row in flatfile Wonne, Sorry, I revisited your original example and it looks like I = misunderstood it. I do think the subject line is a little misleading! = I read it as referring to repeating groups on a line. Anyway, I believe the resources script below will meet your = requirements, and will be supported in the next version. <sx:resources xmlns:sx=3D"http://www.servingxml.com/core"> <sx:service name=3D"example"> <sx:serialize> <sx:transform> <sx:recordMapping ref=3D"exampleMapping"/> </sx:transform> </sx:serialize> </sx:service> <sx:flatFile name=3D"personsFlatFile"> <sx:flatFileHeader lineCount=3D"1"/> <sx:flatFileBody> <sx:flatRecordType ref=3D"persons"/> </sx:flatFileBody> </sx:flatFile> <sx:flatRecordType name=3D"persons"> <sx:positionalField name=3D"PersonId" width=3D"9"/> <sx:positionalField name=3D"Name" width=3D"11"/> <sx:positionalField name=3D"FirstName" width=3D"16"/> <sx:positionalField name=3D"Street" width=3D"13"/> <sx:positionalField name=3D"PostCode" width=3D"9"/> <sx:positionalField name=3D"CityTown" width=3D"9" /> </sx:flatRecordType> <sx:recordMapping name=3D"exampleMapping"> <Example> <sx:recordMapping> <sx:flatFileReader><sx:flatFile = ref=3D"personsFlatFile"/></sx:flatFileReader> <sx:recordMapping ref=3D"personsMapping"/> </sx:recordMapping> <sx:recordMapping> <sx:flatFileReader><sx:flatFile = ref=3D"personsFlatFile"/></sx:flatFileReader> <sx:recordMapping ref=3D"addressMapping"/> </sx:recordMapping> </Example> </sx:recordMapping> <sx:recordMapping name=3D"personsMapping"> <Persons> <sx:onRecord> <Person> <sx:fieldElementMap field=3D"PersonId" = element=3D"PersonId"/> <sx:fieldElementMap field=3D"Name" element=3D"Name"/> <sx:fieldElementMap field=3D"FirstName" = element=3D"FirstName"/> </Person> </sx:onRecord> </Persons> </sx:recordMapping> <sx:recordMapping name=3D"addressMapping"> <Addresses> <sx:onRecord> <Address> <sx:fieldElementMap field=3D"PersonId" = element=3D"PersonId"/> <sx:fieldElementMap field=3D"Street" = element=3D"Street"/> <sx:fieldElementMap field=3D"PostCode" = element=3D"PostCode"/> <sx:fieldElementMap field=3D"CityTown" = element=3D"CityTown"/> </Address> </sx:onRecord> </Addresses> </sx:recordMapping> </sx:resources> sx:recordMapping now supports the contract of both "content" as = well as "mapping", and can be nested at any depth in the mapping tree. = In its content, it can have a record reader(optional) and another record = mapping element. This is quite a nice use case, thanks. In your case, you read = from the same file twice, but this also supports aggregating the content = of different flat files, or a combination of flat file records and = database records. -- Daniel ----- Original Message -----=20 From: Daniel Parker=20 To: Keysers Wonne=20 Sent: Monday, October 24, 2005 11:27 PM Subject: Re: Multiple record types per row in flatfile Hello Wonne, The feature is already implemented and has been tested with edi = examples and examples having repeating fixed length segments within = positional records; I don't anticipate any difficulties there. I should = be able to have a new release out within two days of getting your sample = data and expected output, assuming, of course, that no additional issues = arise from your test case. -- Daniel ----- Original Message -----=20 From: Keysers Wonne=20 To: dan...@us...=20 Sent: Monday, October 24, 2005 8:29 AM Subject: RE: Multiple record types per row in flatfile Hi Daniel, Thank you for your quick response. I was in the process of evaluating mechanisms to perform = flatfile-to-xml conversions when I ran into the ServingXML project. The = framework looks very flexible and enhanced and could bring a lot of = added value to our project, but we are, however, a bit blocked with this = missing feature. Since I am currently under preassure to decide upon the = technologies to use, could you please share me your estimate of when you = think to be able to release the new feature? If you think it is feasible in a short amount of time, I can = assist you in creating example data and, if necessary, do some coding. = Otherwise I'm unfortunately forced to choose other options. Please don't = interprete this as a threat, I'm not happy with it either... Can you please give me your thoughts? Thanks in advance Wonne ---------------------------------------------------------------------- From: Daniel Parker Subject: Multiple record types per row in flatfile Hello Keysers, As it happens, the next version, due shortly, will support = repeating groups of record segments on one row, which should answer your = needs. I'll include your example below in the Examples. Would you be = able to provide a sample flat file with some representative groups of = addresses? =20 Thanks, Daniel Parker ---------------------------------------------------------------------- From: Keysers Wonne Sent: Fri 21/10/2005 9:26 To: ser...@li... Subject: Multiple record types per row in flatfile Hi, I need to parse and transform a flatfile (fixed length) file = into XML. The flatfile contains multiple kinds of records on one single = row and they all go into separate sections in the XML. Here is a small example of a person with address data on the = same line. An important side effect is that a person may have multiple = lines in the flatfile indicating multiple addresses. (e.g. professional = / private / ...) FlatFile (Positional): PersonId PersonName PersonFirstName Street Postcode CityTown Resulting XML file should look like: <Example> <Persons> <Person> <PersonId/> <Name/> <FirstName/> </Person> </Persons> <PersonAddresses> <PersonAddress> <PersonId/> <Addresses> <Addres> <Street/> <PostCode/> <CityTown/> <Addres> </Addresses> </PersonAddress> </PersonAddresses> =20 </Example> The problem could be solved when multiple recordContent = elements could be specified for a row, but after reading the online = documentation, I don't think this is currently possible? What solution do you propose? Thanks in advance! /Wonne |
From: Daniel P. <dan...@sy...> - 2005-11-01 03:54:59
|
Serving XML version 0.3.0 has been released, which supports this = feature. See the example "persons" in the on-line examples. If there = are any issues, please report them, and they will be addressed. =20 Note that the 0.3.0 release introduces some changes to namespaces, Java = package names, and markup. If you are upgrading from a previous = version, check the release notes carefully. Regards, Daniel Parker ----- Original Message -----=20 From: Keysers Wonne=20 To: ser...@li...=20 Sent: Friday, October 21, 2005 2:26 AM Subject: [Servingxml-help] Multiple record types per row in flatfile Hi, I need to parse and transform a flatfile (fixed length) file into XML. The flatfile contains multiple kinds of records on one single row and = they all go into separate sections in the XML. Here is a small example of a person with address data on the same = line. An important side effect is that a person may have multiple lines = in the flatfile indicating multiple addresses. (e.g. professional / = private / ...) FlatFile (Positional): PersonId PersonName PersonFirstName Street Postcode CityTown Resulting XML file should look like: <Example> <Persons> <Person> <PersonId/> <Name/> <FirstName/> </Person> </Persons> <PersonAddresses> <PersonAddress> <PersonId/> <Addresses> <Addres> <Street/> <PostCode/> <CityTown/> <Addres> </Addresses> </PersonAddress> </PersonAddresses> =20 </Example> The problem could be solved when multiple recordContent elements could = be specified for a row, but after reading the online documentation, I = don't think this is currently possible? What solution do you propose? Thanks in advance! /Wonne |
From: Daniel P. <dan...@sy...> - 2005-10-22 03:17:02
|
Hello Keysers, As it happens, the next version, due shortly, will support repeating = groups of record segments on one row, which should answer your needs. = I'll include your example below in the Examples. Would you be able to = provide a sample flat file with some representative groups of addresses? = =20 Thanks, Daniel Parker ----- Original Message -----=20 From: Keysers Wonne=20 To: ser...@li...=20 Sent: Friday, October 21, 2005 3:26 AM Subject: [Servingxml-help] Multiple record types per row in flatfile Hi, I need to parse and transform a flatfile (fixed length) file into XML. The flatfile contains multiple kinds of records on one single row and = they all go into separate sections in the XML. Here is a small example of a person with address data on the same = line. An important side effect is that a person may have multiple lines = in the flatfile indicating multiple addresses. (e.g. professional / = private / ...) FlatFile (Positional): PersonId PersonName PersonFirstName Street Postcode CityTown Resulting XML file should look like: <Example> <Persons> <Person> <PersonId/> <Name/> <FirstName/> </Person> </Persons> <PersonAddresses> <PersonAddress> <PersonId/> <Addresses> <Addres> <Street/> <PostCode/> <CityTown/> <Addres> </Addresses> </PersonAddress> </PersonAddresses> =20 </Example> The problem could be solved when multiple recordContent elements could = be specified for a row, but after reading the online documentation, I = don't think this is currently possible? What solution do you propose? Thanks in advance! /Wonne |
From: Keysers W. <Won...@re...> - 2005-10-21 07:26:53
|
Hi, =20 I need to parse and transform a flatfile (fixed length) file into XML. The flatfile contains multiple kinds of records on one single row and = they all go into separate sections in the XML. =20 Here is a small example of a person with address data on the same line. = An important side effect is that a person may have multiple lines in the = flatfile indicating multiple addresses. (e.g. professional / private / = ...) =20 FlatFile (Positional): PersonId PersonName PersonFirstName Street Postcode CityTown =20 Resulting XML file should look like: <Example> <Persons> <Person> <PersonId/> <Name/> <FirstName/> </Person> </Persons> =20 <PersonAddresses> <PersonAddress> <PersonId/> <Addresses> <Addres> <Street/> <PostCode/> <CityTown/> <Addres> </Addresses> </PersonAddress> </PersonAddresses> =20 </Example> =20 The problem could be solved when multiple recordContent elements could = be specified for a row, but after reading the online documentation, I = don't think this is currently possible? =20 What solution do you propose? =20 Thanks in advance! =20 /Wonne=20 |