servingxml-help Mailing List for ServingXML (Page 12)
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: Yves LE C. <yve...@gm...> - 2006-09-08 09:07:22
|
Hello, I use the XML -> FlatFile features successfully, all is working perfectly. (what a wonderful framework isnt it ?) Now we (my project) want to know how to validate with a Schema the XML file before transforming it in a Flat File. We want also that the processing not be done when the XML file is not validated. The examples talk about some Record Validators (which are useful for a FlatFile -> XML) but they don't seem to be useful for validate an XML. We think that it is not a features of the products. So, if it is not currently implemented, anyone has an idea to do this task. Another thing : is anyone have an idea of the Maximum size of the XML that the framework ServingXML could process. If someone has an idea of the capability in term of performance, we are very interested by it. Yves LE CLEACH IT consultant SOA |
From: Daniel P. <dan...@gm...> - 2006-05-22 06:23:45
|
Interesting, I've never experienced this problem myself. I note that, in addition to com.servingxml.util.QualifiedName, com.servingxml.components.streamsource.url.UrlSourceFactory also imports itself. I'll make sure that these are cleaned up in 0.5.1. Thanks, Daniel On 5/22/06, rams <ra...@ta...> wrote: > > Hi Daniel, > Thanks for the reply again. > We got the build problem because of some errors in the java source. > I did not understand this. > In two Source files..I found self imports. > (the same class is imported within the same class) > I removed the import statementts and now it is working fine. > one is. > QualifiedName.java > file:/home/rams/servingxml-0.4.2 > /framework/src/main/java/com/servingxml/util > Second one I forgot the name. > Again many many thanks for your attention towards the users. > Have a good day. > Regards > RamReddy.S > |
From: Daniel P. <dan...@gm...> - 2006-05-19 08:39:19
|
Ram, What version of the software are you using? I can't replicate the issue that you're reporting with any version I've tried, and nobody else has reported this issue. Can you assure me that you are doing the following? You've set the JAVA_HOME environment variable. You've unzipped the software to a Windows directory. You haven't modified the extracted files in any way. You've opened up a Windows console and navigated to the servingxml-0.x.xdirectory. You've typed "build" at the command line. Regards, Daniel Parker On 5/19/06, rams <ra...@ta...> wrote: > > Hi Daniel, > Thanks for the response.. > I am getting the exception when i try to build it on the windows > machine..not > run time. > Second one is.. > I am using consoleAPP examples itself. > But for some parameters like ConfigRef etc. Null value is given as > initial > value . > There it is giving errors..(Null value for the given param). > Is that example complete (Can I use it directly without changes ) . > I request you to kindly respond to this immediately.. > Thanks and Regards > RamReddy.S > On Thursday 18 May 2006 21:32, you wrote: > > [Forwarding to list - please keep these questions on the list.] > > > > "framework/lib not found" - do you mean when you're _building_ > servingxml, > > running the build command? framework/lib is not used after you've buil= t > > deploy/servingxml. I believe that if you follow the instructions in th= e > > "Getting Started" documentation, you shouldn't have any problems. > > > > Regarding an example Java app, I'd suggest having a look at the console > > app, i.e. the com.servingxml.app.consoleapp.ConsoleApp class, under > > framework/src/main/java. That and the embedding documentation should > get > > you started. > > > > Regards, > > Daniel Parker > > > > ----- Original Message ----- From: "rams" <ra...@ta...> > > To: "Daniel Parker" <dan...@sy...> > > Cc: "Vaidyanathan Narayanan" <vai...@ta...> > > Sent: Thursday, May 18, 2006 2:46 PM > > Subject: Re: [Servingxml-help] Need urgent help > > > > > Hi Daniel, > > > Thansk for spending your valuable time for us till now. > > > 1. > > > We are using ServingXML in our project. > > > It is working fine on Linux machines but giving some problems on > > > > Windows > > > > > machines. > > > It is saying that.. > > > framework/lib not found. > > > But it is already there in that directory. > > > 2. > > > One more thing is we want to use this utility from the java program. > > > Under "ServingXMlEmbedding" some logic is there . > > > Can I get a complete program ,so that I can directly call that > function > > > > and > > > > > run the serving xml from java program.? > > > This is very very urgen..S0I request you to spend some time on this. > > > Awaiting your reply, > > > Thanks and Regards > > > Ram > > > > This e-mail and any files transmitted with it are for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. If you are not the intended recipient or received it in erro= r, > please contact the sender by reply e-mail and destroy all copies of the > original message. Please do not copy it for any purpose or disclose its > contents. > > Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserve= d |
From: Daniel P. <dan...@gm...> - 2006-05-18 16:02:40
|
[Forwarding to list - please keep these questions on the list.] "framework/lib not found" - do you mean when you're _building_ servingxml, running the build command? framework/lib is not used after you've built deploy/servingxml. I believe that if you follow the instructions in the "Getting Started" documentation, you shouldn't have any problems. Regarding an example Java app, I'd suggest having a look at the console app= , i.e. the com.servingxml.app.consoleapp.ConsoleApp class, under framework/src/main/java. That and the embedding documentation should get you started. Regards, Daniel Parker ----- Original Message ----- From: "rams" <ra...@ta...> To: "Daniel Parker" <dan...@sy...> Cc: "Vaidyanathan Narayanan" <vai...@ta...> Sent: Thursday, May 18, 2006 2:46 PM Subject: Re: [Servingxml-help] Need urgent help > Hi Daniel, > Thansk for spending your valuable time for us till now. > 1. > We are using ServingXML in our project. > It is working fine on Linux machines but giving some problems on Windows > machines. > It is saying that.. > framework/lib not found. > But it is already there in that directory. > 2. > One more thing is we want to use this utility from the java program. > Under "ServingXMlEmbedding" some logic is there . > Can I get a complete program ,so that I can directly call that function and > run the serving xml from java program.? > This is very very urgen..S0I request you to spend some time on this. > Awaiting your reply, > Thanks and Regards > Ram |
From: Daniel P. <dan...@sy...> - 2006-05-05 06:20:40
|
----- Original Message ----- From: "rams" <ra...@ta...> To: "Daniel Parker" <dan...@sy...> Sent: Thursday, May 04, 2006 3:16 AM Subject: Re: [Servingxml-help] Not a valid value for the specified attribute > Hi Daniel, > Thanks for the reply.. > I have tested with the program code that you sent. > I got UnsupportedCahrsetException.. > It seems my system is not supporting the Cp1047 encoding scheme. > have a good day. > Regards > Ram > On Wednesday 03 May 2006 17:54, you wrote: >> Rams, >> >> The error message indicates that it's failing here, for the charset >> "Cp500": >> >> Charset charset = null; >> if (charsetName != null) { >> try { >> charset = Charset.forName(charsetName); >> } catch (IllegalCharsetNameException e) { >> ... >> } catch (UnsupportedCharsetException e) { >> ... >> } >> } >> >> An exception is being thrown in the Java Charset.forName method. So this >> doesn't appear to be a ServingXML issue. >> >> Also, I can't reproduce it. Try creating a small Java program that just >> executes the lines above and verify that that fails. If it fails, check >> whether it throws an UnsupportedCharsetException or an >> IllegalCharsetNameException. >> >> -- Daniel >> ----- Original Message ----- >> From: rams >> To: Ser...@li... >> Sent: Wednesday, May 03, 2006 5:10 AM >> Subject: [Servingxml-help] Not a valid value for the specified >> attribute >> >> >> Hi, >> >> >> I am running a sample program to convert an ASCII file to EBCDIC file . >> >> When I run the program i got the following exeption. >> >> >> THE MESSAGE IS: >> >> >> >> May 3, 2006 10:18:58 AM com.servingxml.util.system.DefaultLogger error >> >> SEVERE: [system]Error in element sx:defaultStreamSource, attribute >> charset has invalid value.. Cp500 >> >> [rams@hariprasadp flat2flat]$ >> >> >> Can any one suggest any solution for that. >> >> >> The resource file I am using is: >> >> >> <?xml version="1.0"?> >> >> >> <sx:resources xmlns:sx="http://www.servingxml.com/core"> >> >> >> <sx:service id="ascii2ebcdic"> >> >> <sx:writeRecords> >> >> <sx:flatFileWriter> >> >> <sx:flatFile ref="ebcdicBooksFile"/> >> >> <sx:defaultStreamSink encoding="Cp500"/> >> >> </sx:flatFileWriter> >> >> <sx:flatFileReader> >> >> <sx:flatFile ref="asciiBooksFile"/> >> >> </sx:flatFileReader> >> >> </sx:writeRecords> >> >> </sx:service> >> >> >> <sx:service id="ebcdic2ascii"> >> >> <sx:writeRecords> >> >> <sx:flatFileWriter> >> >> <sx:flatFile ref="asciiBooksFile"/> >> >> </sx:flatFileWriter> >> >> <sx:flatFileReader> >> >> <sx:flatFile ref="ebcdicBooksFile"/> >> >> <sx:defaultStreamSource encoding="Cp500"/> >> >> </sx:flatFileReader> >> >> </sx:writeRecords> >> >> </sx:service> >> >> >> <sx:flatFile id="ebcdicBooksFile"> >> >> <sx:flatFileHeader> >> >> <sx:flatRecordType ref="ebcdicBookType"/> >> >> </sx:flatFileHeader> >> >> <sx:flatFileBody> >> >> <sx:flatRecordType ref="ebcdicBookType"/> >> >> </sx:flatFileBody> >> >> </sx:flatFile> >> >> >> <sx:flatRecordType id="ebcdicBookType" name="ebcdicBookType"> >> >> <sx:fieldDelimiter value="|"/> >> >> <sx:delimitedField name="author" label="Author"/> >> >> <sx:delimitedField name="category" label="Category"/> >> >> <sx:delimitedField name="title" label= "Title"/> >> >> <sx:delimitedField name="price" label="Price"/> >> >> </sx:flatRecordType> >> >> >> <sx:flatFile id="asciiBooksFile"> >> >> <sx:flatFileHeader> >> >> <sx:flatRecordType ref="asciiBookType"/> >> >> <sx:annotationRecord/> >> >> </sx:flatFileHeader> >> >> <sx:flatFileBody> >> >> <sx:flatRecordType ref="asciiBookType"/> >> >> </sx:flatFileBody> >> >> <sx:flatFileTrailer> >> >> <sx:annotationRecord></sx:annotationRecord> >> >> <sx:annotationRecord>This is a trailer record</sx:annotationRecord> >> >> </sx:flatFileTrailer> >> >> </sx:flatFile> >> >> >> <sx:flatRecordType id="asciiBookType" name="asciiBookType"> >> >> <sx:positionalField name="category" width="1"/> >> >> <sx:positionalField name="author" width="30"/> >> >> <sx:positionalField name="title" width="30"/> >> >> <sx:positionalField name="price" width="10" justify="right"/> >> >> </sx:flatRecordType> >> >> >> </sx:resources> >> >> >> Pls suggest a solution for this. >> >> Thanks and Regards >> >> RamReddy.S >> >> This e-mail and any files transmitted with it are for the sole use of the >> intended recipient(s) and may contain confidential and privileged >> information. If you are not the intended recipient or received it in >> error, >> please contact the sender by reply e-mail and destroy all copies of the >> original message. Please do not copy it for any purpose or disclose its >> contents. >> >> Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights >> Reserved > > > > This e-mail and any files transmitted with it are for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. If you are not the intended recipient or received it in > error, please contact the sender by reply e-mail and destroy all copies of > the original message. Please do not copy it for any purpose or disclose > its contents. > > Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved |
From: Daniel P. <dan...@sy...> - 2006-05-03 12:24:59
|
Rams, The error message indicates that it's failing here, for the charset = "Cp500": Charset charset =3D null; if (charsetName !=3D null) { try { charset =3D Charset.forName(charsetName); } catch (IllegalCharsetNameException e) { ... } catch (UnsupportedCharsetException e) { ... } } An exception is being thrown in the Java Charset.forName method. So = this doesn't appear to be a ServingXML issue. Also, I can't reproduce it. Try creating a small Java program that just = executes the lines above and verify that that fails. If it fails, check = whether it throws an UnsupportedCharsetException or an = IllegalCharsetNameException. -- Daniel ----- Original Message -----=20 From: rams=20 To: Ser...@li...=20 Sent: Wednesday, May 03, 2006 5:10 AM Subject: [Servingxml-help] Not a valid value for the specified = attribute Hi, I am running a sample program to convert an ASCII file to EBCDIC file = . When I run the program i got the following exeption. THE MESSAGE IS: May 3, 2006 10:18:58 AM com.servingxml.util.system.DefaultLogger error SEVERE: [system]Error in element sx:defaultStreamSource, attribute = charset has invalid value.. Cp500 [rams@hariprasadp flat2flat]$ Can any one suggest any solution for that. The resource file I am using is: <?xml version=3D"1.0"?> <sx:resources xmlns:sx=3D"http://www.servingxml.com/core"> <sx:service id=3D"ascii2ebcdic">=20 <sx:writeRecords> <sx:flatFileWriter> <sx:flatFile ref=3D"ebcdicBooksFile"/> <sx:defaultStreamSink encoding=3D"Cp500"/> </sx:flatFileWriter> <sx:flatFileReader> <sx:flatFile ref=3D"asciiBooksFile"/> </sx:flatFileReader> </sx:writeRecords> </sx:service> <sx:service id=3D"ebcdic2ascii">=20 <sx:writeRecords> <sx:flatFileWriter> <sx:flatFile ref=3D"asciiBooksFile"/> </sx:flatFileWriter> <sx:flatFileReader> <sx:flatFile ref=3D"ebcdicBooksFile"/> <sx:defaultStreamSource encoding=3D"Cp500"/> </sx:flatFileReader> </sx:writeRecords> </sx:service> <sx:flatFile id=3D"ebcdicBooksFile"> <sx:flatFileHeader> <sx:flatRecordType ref=3D"ebcdicBookType"/> </sx:flatFileHeader> <sx:flatFileBody> <sx:flatRecordType ref=3D"ebcdicBookType"/> </sx:flatFileBody> </sx:flatFile>=20 <sx:flatRecordType id=3D"ebcdicBookType" name=3D"ebcdicBookType"> <sx:fieldDelimiter value=3D"|"/> <sx:delimitedField name=3D"author" label=3D"Author"/> <sx:delimitedField name=3D"category" label=3D"Category"/> <sx:delimitedField name=3D"title" label=3D "Title"/> <sx:delimitedField name=3D"price" label=3D"Price"/> </sx:flatRecordType> <sx:flatFile id=3D"asciiBooksFile"> <sx:flatFileHeader> <sx:flatRecordType ref=3D"asciiBookType"/> <sx:annotationRecord/> </sx:flatFileHeader> <sx:flatFileBody> <sx:flatRecordType ref=3D"asciiBookType"/> </sx:flatFileBody> <sx:flatFileTrailer> <sx:annotationRecord></sx:annotationRecord> <sx:annotationRecord>This is a trailer record</sx:annotationRecord> </sx:flatFileTrailer> </sx:flatFile>=20 <sx:flatRecordType id=3D"asciiBookType" name=3D"asciiBookType"> <sx:positionalField name=3D"category" width=3D"1"/> <sx:positionalField name=3D"author" width=3D"30"/> <sx:positionalField name=3D"title" width=3D"30"/> <sx:positionalField name=3D"price" width=3D"10" justify=3D"right"/> </sx:flatRecordType> </sx:resources> Pls suggest a solution for this. Thanks and Regards RamReddy.S This e-mail and any files transmitted with it are for the sole use of = the intended recipient(s) and may contain confidential and privileged = information. If you are not the intended recipient or received it in = error, please contact the sender by reply e-mail and destroy all copies = of the original message. Please do not copy it for any purpose or = disclose its contents. Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights = Reserved |
From: rams <ra...@ta...> - 2006-05-03 09:11:22
|
SGksDQoNCkkgYW0gcnVubmluZyBhIHNhbXBsZSBwcm9ncmFtIHRvIGNvbnZlcnQgYW4gQVND SUkgZmlsZSB0byBFQkNESUMgZmlsZSAuDQpXaGVuIEkgcnVuIHRoZSBwcm9ncmFtIGkgZ290 IHRoZSBmb2xsb3dpbmcgZXhlcHRpb24uDQoNClRIRSBNRVNTQUdFIElTOg0KDQoNCk1heSAz LCAyMDA2IDEwOjE4OjU4IEFNIGNvbS5zZXJ2aW5neG1sLnV0aWwuc3lzdGVtLkRlZmF1bHRM b2dnZXIgZXJyb3INClNFVkVSRTogW3N5c3RlbV1FcnJvciBpbiBlbGVtZW50IHN4OmRlZmF1 bHRTdHJlYW1Tb3VyY2UsIGF0dHJpYnV0ZSBjaGFyc2V0IGhhcyANCmludmFsaWQgdmFsdWUu LiAgQ3A1MDANCltyYW1zQGhhcmlwcmFzYWRwIGZsYXQyZmxhdF0kDQoNCkNhbiBhbnkgb25l IHN1Z2dlc3QgYW55IHNvbHV0aW9uIGZvciB0aGF0Lg0KDQpUaGUgcmVzb3VyY2UgZmlsZSBJ IGFtIHVzaW5nIGlzOg0KDQo8P3htbCB2ZXJzaW9uPSIxLjAiPz4NCg0KPHN4OnJlc291cmNl cyB4bWxuczpzeD0iaHR0cDovL3d3dy5zZXJ2aW5neG1sLmNvbS9jb3JlIj4NCiAgIA0KICA8 c3g6c2VydmljZSBpZD0iYXNjaWkyZWJjZGljIj4gDQogICAgPHN4OndyaXRlUmVjb3Jkcz4N CiAgICAgIDxzeDpmbGF0RmlsZVdyaXRlcj4NCiAgICAgICAgPHN4OmZsYXRGaWxlIHJlZj0i ZWJjZGljQm9va3NGaWxlIi8+DQogICAgICAgIDxzeDpkZWZhdWx0U3RyZWFtU2luayBlbmNv ZGluZz0iQ3A1MDAiLz4NCiAgICAgIDwvc3g6ZmxhdEZpbGVXcml0ZXI+DQogICAgICA8c3g6 ZmxhdEZpbGVSZWFkZXI+DQogICAgICAgIDxzeDpmbGF0RmlsZSByZWY9ImFzY2lpQm9va3NG aWxlIi8+DQogICAgICA8L3N4OmZsYXRGaWxlUmVhZGVyPg0KICAgIDwvc3g6d3JpdGVSZWNv cmRzPg0KICA8L3N4OnNlcnZpY2U+DQoNCiAgPHN4OnNlcnZpY2UgaWQ9ImViY2RpYzJhc2Np aSI+IA0KICAgIDxzeDp3cml0ZVJlY29yZHM+DQogICAgICA8c3g6ZmxhdEZpbGVXcml0ZXI+ DQogICAgICAgIDxzeDpmbGF0RmlsZSByZWY9ImFzY2lpQm9va3NGaWxlIi8+DQogICAgICA8 L3N4OmZsYXRGaWxlV3JpdGVyPg0KICAgICAgPHN4OmZsYXRGaWxlUmVhZGVyPg0KICAgICAg ICA8c3g6ZmxhdEZpbGUgcmVmPSJlYmNkaWNCb29rc0ZpbGUiLz4NCiAgICAgICAgPHN4OmRl ZmF1bHRTdHJlYW1Tb3VyY2UgZW5jb2Rpbmc9IkNwNTAwIi8+DQogICAgICA8L3N4OmZsYXRG aWxlUmVhZGVyPg0KICAgIDwvc3g6d3JpdGVSZWNvcmRzPg0KICA8L3N4OnNlcnZpY2U+DQog IA0KICA8c3g6ZmxhdEZpbGUgaWQ9ImViY2RpY0Jvb2tzRmlsZSI+DQogICAgPHN4OmZsYXRG aWxlSGVhZGVyPg0KICAgICAgPHN4OmZsYXRSZWNvcmRUeXBlIHJlZj0iZWJjZGljQm9va1R5 cGUiLz4NCiAgICA8L3N4OmZsYXRGaWxlSGVhZGVyPg0KICAgIDxzeDpmbGF0RmlsZUJvZHk+ DQogICAgICA8c3g6ZmxhdFJlY29yZFR5cGUgcmVmPSJlYmNkaWNCb29rVHlwZSIvPg0KICAg IDwvc3g6ZmxhdEZpbGVCb2R5Pg0KICA8L3N4OmZsYXRGaWxlPiAgICAgIA0KDQogIDxzeDpm bGF0UmVjb3JkVHlwZSBpZD0iZWJjZGljQm9va1R5cGUiIG5hbWU9ImViY2RpY0Jvb2tUeXBl Ij4NCiAgICA8c3g6ZmllbGREZWxpbWl0ZXIgdmFsdWU9InwiLz4NCiAgICA8c3g6ZGVsaW1p dGVkRmllbGQgbmFtZT0iYXV0aG9yIiBsYWJlbD0iQXV0aG9yIi8+DQogICAgPHN4OmRlbGlt aXRlZEZpZWxkIG5hbWU9ImNhdGVnb3J5IiBsYWJlbD0iQ2F0ZWdvcnkiLz4NCiAgICA8c3g6 ZGVsaW1pdGVkRmllbGQgbmFtZT0idGl0bGUiIGxhYmVsPSAiVGl0bGUiLz4NCiAgICA8c3g6 ZGVsaW1pdGVkRmllbGQgbmFtZT0icHJpY2UiIGxhYmVsPSJQcmljZSIvPg0KICA8L3N4OmZs YXRSZWNvcmRUeXBlPg0KICANCiAgPHN4OmZsYXRGaWxlIGlkPSJhc2NpaUJvb2tzRmlsZSI+ DQogICAgPHN4OmZsYXRGaWxlSGVhZGVyPg0KICAgICAgPHN4OmZsYXRSZWNvcmRUeXBlIHJl Zj0iYXNjaWlCb29rVHlwZSIvPg0KICAgICAgPHN4OmFubm90YXRpb25SZWNvcmQvPg0KICAg IDwvc3g6ZmxhdEZpbGVIZWFkZXI+DQogICAgPHN4OmZsYXRGaWxlQm9keT4NCiAgICAgIDxz eDpmbGF0UmVjb3JkVHlwZSByZWY9ImFzY2lpQm9va1R5cGUiLz4NCiAgICA8L3N4OmZsYXRG aWxlQm9keT4NCiAgICA8c3g6ZmxhdEZpbGVUcmFpbGVyPg0KICAgICAgPHN4OmFubm90YXRp b25SZWNvcmQ+PC9zeDphbm5vdGF0aW9uUmVjb3JkPg0KICAgICAgPHN4OmFubm90YXRpb25S ZWNvcmQ+VGhpcyBpcyBhIHRyYWlsZXIgcmVjb3JkPC9zeDphbm5vdGF0aW9uUmVjb3JkPg0K ICAgIDwvc3g6ZmxhdEZpbGVUcmFpbGVyPg0KICA8L3N4OmZsYXRGaWxlPiAgICAgIA0KDQog IDxzeDpmbGF0UmVjb3JkVHlwZSBpZD0iYXNjaWlCb29rVHlwZSIgbmFtZT0iYXNjaWlCb29r VHlwZSI+DQogICAgPHN4OnBvc2l0aW9uYWxGaWVsZCBuYW1lPSJjYXRlZ29yeSIgd2lkdGg9 IjEiLz4NCiAgICA8c3g6cG9zaXRpb25hbEZpZWxkIG5hbWU9ImF1dGhvciIgd2lkdGg9IjMw Ii8+DQogICAgPHN4OnBvc2l0aW9uYWxGaWVsZCBuYW1lPSJ0aXRsZSIgd2lkdGg9IjMwIi8+ DQogICAgPHN4OnBvc2l0aW9uYWxGaWVsZCBuYW1lPSJwcmljZSIgd2lkdGg9IjEwIiBqdXN0 aWZ5PSJyaWdodCIvPg0KICA8L3N4OmZsYXRSZWNvcmRUeXBlPg0KICANCjwvc3g6cmVzb3Vy Y2VzPg0KDQpQbHMgc3VnZ2VzdCBhIHNvbHV0aW9uIGZvciB0aGlzLg0KVGhhbmtzIGFuZCBS ZWdhcmRzDQpSYW1SZWRkeS5TDQpUaGlzIGUtbWFpbCBhbmQgYW55IGZpbGVzIHRyYW5zbWl0 dGVkIHdpdGggaXQgYXJlIGZvciB0aGUgc29sZSB1c2Ugb2YgdGhlIGludGVuZGVkIHJlY2lw aWVudChzKSBhbmQgbWF5IGNvbnRhaW4gY29uZmlkZW50aWFsIGFuZCBwcml2aWxlZ2VkIGlu Zm9ybWF0aW9uLiBJZiB5b3UgYXJlIG5vdCB0aGUgaW50ZW5kZWQgcmVjaXBpZW50IG9yIHJl Y2VpdmVkIGl0IGluIGVycm9yLCBwbGVhc2UgY29udGFjdCB0aGUgc2VuZGVyIGJ5IHJlcGx5 IGUtbWFpbCBhbmQgZGVzdHJveSBhbGwgY29waWVzIG9mIHRoZSBvcmlnaW5hbCBtZXNzYWdl LiBQbGVhc2UgZG8gbm90IGNvcHkgaXQgZm9yIGFueSBwdXJwb3NlIG9yIGRpc2Nsb3NlIGl0 cyBjb250ZW50cy4NCg0KQ29weXJpZ2h0IFRhcmFuZyBTb2Z0d2FyZSBUZWNobm9sb2dpZXMg UHZ0LiBMdGQuIDIwMDQuIEFsbCByaWdodHMgUmVzZXJ2ZWQ= |
From: Daniel P. <dan...@sy...> - 2006-04-28 03:50:24
|
Hello Ram, When one record identifier's width is different, you can do the = following. <sx:flatRecordTypeChoice> <sx:positionalField name=3D"record_type" width=3D"4"/> <sx:positionalField name=3D"type" start=3D"1" width=3D"1"/>=20 <sx:when ... Here, record_type occupies the first four characters of the record, and = type occupies the first character. There's an example of this in the = "hot 1" example, with the flat to XML examples. Note that you can't have more than one sx:flatRecordTypeChoice element. Regards, Daniel Parker ----- Original Message -----=20 From: rams=20 To: Daniel Parker=20 Cc: Vaidyanathan Narayanan=20 Sent: Thursday, April 27, 2006 5:42 AM Subject: Re: [Servingxml-help] Need urgent help Hi Daniel, Thanks for all of your valuable inputs which you gave me in time. I need one more favour from you. The problem i am facing is explained below: Data in flat file looks like this: XD3100103/25/2005 1:50:00This is a trade recordytyty XD270002X1234A child transactionyuyuyuyyyyyyyuuiui XD28TN0003X1235Another child transactionyuiyuiyuiyui XD3100103/25/2005 1uuuurrrrrs:50:00This is a trade recordytyty Dtttttttuuuuuu77777777777777777777oooooooooooooooo999999999999 F56456mmmmmmmm7777777777kkkkkkkkkkkk333333333333333 D55555555hhhhhhhhhhhhhkkkkkkkkkkllllllllll E55555555hhhhhhhhhhhhhkkkkkkkkkkllllllllll In the above data, some of the rows have 4 characters as Record = Identifier, and for some it is one character. Example, XD31, XD27, XD28, = XD31, D, F and E are record identifiers. Problem is, when the record identifier's width is different, how to = process? As of now, Resource File looks like this: <?xml version=3D"1.0"?> <sx:resources xmlns:sx=3D"http://www.servingxml.com/core"> <sx:service name=3D"cybs"> <sx:serialize> <sx:transform> <sx:content ref=3D"cybs"/> </sx:transform> </sx:serialize> </sx:service> <sx:recordContent name=3D"cybs"> <sx:flatFileReader> <sx:urlSource url=3D"data/cybs-data.txt"/> <sx:flatFile ref=3D"tradesFlatFile"/> </sx:flatFileReader> <sx:recordMapping ref=3D"tradesToXmlMapping"/> </sx:recordContent> <sx:flatFile name=3D"tradesFlatFile"> <sx:commentSymbol value=3D"#"/> <sx:flatFileBody> <sx:flatRecordTypeChoice> <sx:positionalField name=3D"record_type" width=3D"4"/> <sx:when test=3D"record_type=3D'XD28'"> <sx:flatRecordType name=3D"XD28"> <sx:positionalField name=3D"record_type" width=3D"4"/> <sx:positionalField name=3D"sequence_number" width=3D"6"/> <sx:positionalField name=3D"dest_zip" width=3D"10"/> <sx:positionalField name=3D"merchant_zip" width=3D"10"/> <sx:positionalField name=3D"ship_from_zip" width=3D"10"/> <sx:positionalField name=3D"filler" width=3D"40"/> </sx:flatRecordType> </sx:when> </sx:flatRecordTypeChoice> <sx:flatRecordTypeChoice> <sx:positionalField name=3D"type" width=3D"1"/>=20 <sx:when test=3D"type=3D'D'"> <sx:flatRecordType name=3D"D"> <sx:positionalField name=3D"type" width=3D"1"/> <sx:positionalField name=3D"sequence_number" width=3D"6"/> <sx:positionalField name=3D"dest_zip" width=3D"10"/> <sx:positionalField name=3D"merchant_zip" width=3D"10"/> <sx:positionalField name=3D"ship_from_zip" width=3D"10"/> <sx:positionalField name=3D"filler" width=3D"40"/> </sx:flatRecordType> </sx:when> </sx:flatRecordTypeChoice> </sx:flatFileBody> </sx:flatFile> </sx:resources> One more thing is, when we used this kind of resource file, it is = considering only rows with record identifier width 4. Please suggest us how to proceed at your earliest. Thanks and Regards, Ram Reddy This e-mail and any files transmitted with it are for the sole use of = the intended recipient(s) and may contain confidential and privileged = information. If you are not the intended recipient or received it in = error, please contact the sender by reply e-mail and destroy all copies = of the original message. Please do not copy it for any purpose or = disclose its contents. Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights = Reserved |
From: Daniel P. <dan...@sy...> - 2006-04-28 03:33:52
|
File input can be in any of the Java supported encodings, see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html, and refer to the ASCII-EBCDIC example with the flat-flat examples for how to specify input or output encodings. Note that the Java supported charsets cover some but not all variants of EBCDIC. Regards, Daniel Parker http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html ----- Original Message ----- From: "rams" <ra...@ta...> To: "Daniel Parker" <dan...@sy...> Cc: "Vaidyanathan Narayanan" <vai...@ta...>; "Raghavendra S" <rag...@ta...> Sent: Thursday, April 27, 2006 7:33 AM Subject: Re: [Servingxml-help] Need urgent help > Hi Daniel > > Thanks again for your help in advance. Further to my last mail i have one > more > request: > > 1. Conversion API list. Do you have a complete list of what are the > conversion APIs i can use. The reason is actually my entire batch will be > a > EBCDIC data and for testing i need to convert the entire data into ascii > at > field level for the record type formats mentioned earlier. > > I think your tool is fantastic - hope the 2 issues mentioned by me ( 1 > earlier > and 1 in this email ) is addressed . Keeping my fingers crossed. > > Awaitng your reply > > Regards > Rams > This e-mail and any files transmitted with it are for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. If you are not the intended recipient or received it in > error, please contact the sender by reply e-mail and destroy all copies of > the original message. Please do not copy it for any purpose or disclose > its contents. > > Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved |
From: Daniel P. <dan...@sy...> - 2006-04-28 03:14:04
|
I'm forwarding this to the list to keep a record that this is resolved. Best regards, Daniel ----- Original Message ----- From: "rams" <ra...@ta...> To: "Daniel Parker" <dan...@sy...> Sent: Thursday, April 27, 2006 12:50 AM Subject: Re: [Servingxml-help] Need urgent help > Hi Daniel, > Thanks for cooperation. That problem is solved .now it is working fine. > regards > RamReddy > On Thursday 27 April 2006 10:17, you wrote: >> The manifest looks okay. >> >> Also please send me the versions of your JDK ($JAVA_HOME) and JRE >> (java -version), and verify that they're the same (that you're not >> inadvertently compiling with one version and running with another.) >> >> Finally, see if you get different results running like this: >> >> java -cp ../../servingxml.jar:../../lib/concurrent.jar >> com.servingxml.app.consoleapp.ConsoleApp -r resources-books.xml -i >> data/books.txt -o output.xml books >> >> -- Daniel >> >> ----- Original Message ----- >> From: "rams" <ra...@ta...> >> To: "Daniel Parker" <dan...@sy...> >> Cc: "Vaidyanathan Narayanan" <vai...@ta...> >> Sent: Thursday, April 27, 2006 12:21 AM >> Subject: Re: [Servingxml-help] Need urgent help >> >> > Hi Daniel, >> > Thanks for your reply. >> > I am running this example in Linux environment. >> > 1. I am using both versions of the ServingXML 0.3.2 and 0.4.2. >> > In both versions I am getting same exception. >> > 2.I tried in $HOME and one of the subdirectories of the home also. >> > It is creating servingxml.jar and all the required directories >> > 3. >> > Here I am sending the contents of Manifest.mf file from servingxml.jar >> > >> > Manifest-Version: 1.0 >> > Ant-Version: Apache Ant 1.6.5 >> > Created-By: 1.4.2_09-b05 (Sun Microsystems Inc.) >> > Main-Class: com.servingxml.app.consoleapp.ConsoleApp >> > ServingXML-Components: META-INF/components/com/servingxml/core/compone >> > nts.xml >> > Class-Path: servingxml.jar lib/activation.jar lib/avalon-framework-cvs >> > -20020806.jar lib/batik.jar lib/concurrent.jar lib/edtftpj.jar lib/fo >> > p.jar lib/isorelax.jar lib/mail.jar lib/msv.jar lib/relaxngDatatype.j >> > ar lib/saxon.jar lib/servingxml.edtftpj.jar lib/servingxml.fop.jar li >> > b/servingxml.mail.jar lib/servingxml.msv.jar lib/servingxml.swing.jar >> > lib/servingxmlx.jar lib/xsdlib.jar ./classes/ ./config/ >> > The ReadWriteLock class is there in concurrent.jar . I saw the class >> > file >> > there . It is also there in the class path. >> > Still it is saying " >> > >> > Exception in thread "main" java.lang.NoClassDefFoundError: >> >> > EDU/oswego/cs/dl/util/concurrent/ReadWriteLock >> >> > at >> >> > com.servingxml.components.cache.SimpleCache.<init>(SimpleCache.java:39 >> >> >) at com.servingxml.app.AppDriver.startup(AppDriver.java:120) at >> >> > com.servingxml.app.AppDriver.startup(AppDriver.java:99) at >> >> > com.servingxml.app.consoleapp.ConsoleApp.main(ConsoleApp.java:120) >> > >> > Can you please go throw this info and suggest a solution. >> > Thanks & Regards >> > RamReddy.S >> > >> > On Thursday 27 April 2006 08:58, you wrote: >> >> In order to help, I'll need to be able to replicate this, which I'm >> >> currently unable to do. Since you indicated that you attempted this >> >> in >> >> a Windows environment, I would prefer to work with that. So, for the >> >> Windows >> >> environment, can you provide me with the following information: >> >> >> >> (i) Which version of ServingXML are you using? >> >> >> >> (ii) What is the exact pathname of the directory under which you >> >> installed >> >> ServingXML? (in the past there was once an issue with spaces in >> >> directory names, although that should be fixed, but I don't want to >> >> rule >> >> anything out.) >> >> >> >> (iii) After you built the distribution, please extract the >> >> Manifest.mf >> >> from the servingxml.jar file, and post that here. >> >> >> >> Thanks, >> >> Daniel Parker >> >> >> >> ----- Original Message ----- >> >> From: "rams" <ra...@ta...> >> >> To: <ser...@li...> >> >> Sent: Wednesday, April 26, 2006 12:52 AM >> >> Subject: [Servingxml-help] Need urgent help >> >> >> >> > Hi, >> >> > I am getting the following exception when i try to run Servingxml >> >> > using the >> >> > required input files. The concurrent jar is there in the path and it >> >> > contains >> >> > the required file also. >> >> > >> >> > Example: java -jar dir/servingxml.jar -r resources.xml -o out.html >> >> > service [rams@localhost servingxml-0.3.2]$ java -jar >> >> > servingxml.jar -r >> >> > books-resources.xml -i data/books.txt -o books.xml books >> >> > Exception in thread "main" java.lang.NoClassDefFoundError: >> >> > EDU/oswego/cs/dl/util/concurrent/ReadWriteLock >> >> > at >> >> > com.servingxml.components.cache.SimpleCache.<init>(SimpleCache.java:39 >> >> >) at com.servingxml.app.AppDriver.startup(AppDriver.java:120) at >> >> > com.servingxml.app.AppDriver.startup(AppDriver.java:99) at >> >> > com.servingxml.app.consoleapp.ConsoleApp.main(ConsoleApp.java:120) >> >> > (i-search)`': >> >> > >> >> > >> >> > >> >> > This e-mail and any files transmitted with it are for the sole use >> >> > of >> >> > the >> >> > intended recipient(s) and may contain confidential and privileged >> >> > information. If you are not the intended recipient or received it in >> >> > error, please contact the sender by reply e-mail and destroy all >> >> > copies of the original message. Please do not copy it for any >> >> > purpose >> >> > or disclose its contents. >> >> > >> >> > Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights >> >> > ReservedRqºyvy²¢y®zr·¶}?Ë?S,yr-¶'ºm?£¡mz¦q¢®¿mv¥x¢¢§zº-± >> > >> > This e-mail and any files transmitted with it are for the sole use of >> > the >> > intended recipient(s) and may contain confidential and privileged >> > information. If you are not the intended recipient or received it in >> > error, please contact the sender by reply e-mail and destroy all copies >> > of the original message. Please do not copy it for any purpose or >> > disclose its contents. >> > >> > Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights >> > Reserved > > > This e-mail and any files transmitted with it are for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. If you are not the intended recipient or received it in > error, please contact the sender by reply e-mail and destroy all copies of > the original message. Please do not copy it for any purpose or disclose > its contents. > > Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved |
From: Daniel P. <dan...@sy...> - 2006-04-27 03:28:58
|
In order to help, I'll need to be able to replicate this, which I'm currently unable to do. Since you indicated that you attempted this in a Windows environment, I would prefer to work with that. So, for the Windows environment, can you provide me with the following information: (i) Which version of ServingXML are you using? (ii) What is the exact pathname of the directory under which you installed ServingXML? (in the past there was once an issue with spaces in directory names, although that should be fixed, but I don't want to rule anything out.) (iii) After you built the distribution, please extract the Manifest.mf from the servingxml.jar file, and post that here. Thanks, Daniel Parker ----- Original Message ----- From: "rams" <ra...@ta...> To: <ser...@li...> Sent: Wednesday, April 26, 2006 12:52 AM Subject: [Servingxml-help] Need urgent help > Hi, > I am getting the following exception when i try to run Servingxml using > the > required input files. The concurrent jar is there in the path and it > contains > the required file also. > > Example: java -jar dir/servingxml.jar -r resources.xml -o out.html service > [rams@localhost servingxml-0.3.2]$ java -jar servingxml.jar -r > books-resources.xml -i data/books.txt -o books.xml books > Exception in thread "main" java.lang.NoClassDefFoundError: > EDU/oswego/cs/dl/util/concurrent/ReadWriteLock > at > com.servingxml.components.cache.SimpleCache.<init>(SimpleCache.java:39) > at com.servingxml.app.AppDriver.startup(AppDriver.java:120) > at com.servingxml.app.AppDriver.startup(AppDriver.java:99) > at > com.servingxml.app.consoleapp.ConsoleApp.main(ConsoleApp.java:120) > (i-search)`': > > > > This e-mail and any files transmitted with it are for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. If you are not the intended recipient or received it in > error, please contact the sender by reply e-mail and destroy all copies of > the original message. Please do not copy it for any purpose or disclose > its contents. > > Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights > ReservedRqºyvy²¢y®zr·¶}?Ë?S,yr-¶'ºm?£¡mz¦q¢®¿mv¥x¢¢§zº-± |
From: rams <ra...@ta...> - 2006-04-26 10:40:30
|
SGksDQpJIGdvdCBhbiBleGNlcHRpb24gd2hlbiBydW5uaW5nIHRoZSBleGFtcGxlIHdoaWNo IGNvbnZlcnRzIGEgZmxhdCBmaWxlIHRvIGFuIA0KeG1sLg0KW3JhbXNAbG9jYWxob3N0IHNl cnZpbmd4bWwtMC4zLjJdJCBqYXZhIC1qYXIgc2VydmluZ3htbC5qYXIgLXIgDQpib29rcy1y ZXNvdXJjZXMueG1sIC1pIGRhdGEvYm9va3MudHh0IC1vIGJvb2tzLnhtbCBib29rcw0KRXhj ZXB0aW9uIGluIHRocmVhZCAibWFpbiIgamF2YS5sYW5nLk5vQ2xhc3NEZWZGb3VuZEVycm9y OiANCkVEVS9vc3dlZ28vY3MvZGwvdXRpbC9jb25jdXJyZW50L1JlYWRXcml0ZUxvY2sNCiAg ICAgICAgYXQgDQpjb20uc2VydmluZ3htbC5jb21wb25lbnRzLmNhY2hlLlNpbXBsZUNhY2hl Ljxpbml0PihTaW1wbGVDYWNoZS5qYXZhOjM5KQ0KICAgICAgICBhdCBjb20uc2VydmluZ3ht bC5hcHAuQXBwRHJpdmVyLnN0YXJ0dXAoQXBwRHJpdmVyLmphdmE6MTIwKQ0KICAgICAgICBh dCBjb20uc2VydmluZ3htbC5hcHAuQXBwRHJpdmVyLnN0YXJ0dXAoQXBwRHJpdmVyLmphdmE6 OTkpDQogICAgICAgIGF0IGNvbS5zZXJ2aW5neG1sLmFwcC5jb25zb2xlYXBwLkNvbnNvbGVB cHAubWFpbihDb25zb2xlQXBwLmphdmE6MTIwKQ0KQ2FuIGFueSBvbmUgc3VnZ2VzdCBhIHdh eSB0byBzb2x2ZSB0aGlzIHByb2JsZW0NCnJlZ2FyZHMNClJhbVJlZGR5LlMNCg0KDQoNClRo aXMgZS1tYWlsIGFuZCBhbnkgZmlsZXMgdHJhbnNtaXR0ZWQgd2l0aCBpdCBhcmUgZm9yIHRo ZSBzb2xlIHVzZSBvZiB0aGUgaW50ZW5kZWQgcmVjaXBpZW50KHMpIGFuZCBtYXkgY29udGFp biBjb25maWRlbnRpYWwgYW5kIHByaXZpbGVnZWQgaW5mb3JtYXRpb24uIElmIHlvdSBhcmUg bm90IHRoZSBpbnRlbmRlZCByZWNpcGllbnQgb3IgcmVjZWl2ZWQgaXQgaW4gZXJyb3IsIHBs ZWFzZSBjb250YWN0IHRoZSBzZW5kZXIgYnkgcmVwbHkgZS1tYWlsIGFuZCBkZXN0cm95IGFs bCBjb3BpZXMgb2YgdGhlIG9yaWdpbmFsIG1lc3NhZ2UuIFBsZWFzZSBkbyBub3QgY29weSBp dCBmb3IgYW55IHB1cnBvc2Ugb3IgZGlzY2xvc2UgaXRzIGNvbnRlbnRzLg0KDQpDb3B5cmln aHQgVGFyYW5nIFNvZnR3YXJlIFRlY2hub2xvZ2llcyBQdnQuIEx0ZC4gMjAwNC4gQWxsIHJp Z2h0cyBSZXNlcnZlZA== |
From: rams <ra...@ta...> - 2006-04-26 10:11:08
|
SGksDQpJIGdvdCB0aGUgZm9sbG93aW5nIGV4Y2VwdGlvbiB3aGVuIEkgdHJ5IHRvIHJ1biB0 aGUgZXhhbXBsZXMgZnJvbSBaaXAgZmlsZS4NCltyYW1zQGxvY2FsaG9zdCBzZXJ2aW5neG1s LTAuMy4yXSQgamF2YSAtamFyIHNlcnZpbmd4bWwuamFyIC1yIA0KYm9va3MtcmVzb3VyY2Vz LnhtbCAtaSBkYXRhL2Jvb2tzLnR4dCAtbyBib29rcy54bWwgYm9va3MNCkV4Y2VwdGlvbiBp biB0aHJlYWQgIm1haW4iIGphdmEubGFuZy5Ob0NsYXNzRGVmRm91bmRFcnJvcjogDQpFRFUv b3N3ZWdvL2NzL2RsL3V0aWwvY29uY3VycmVudC9SZWFkV3JpdGVMb2NrDQogICAgICAgIGF0 IA0KY29tLnNlcnZpbmd4bWwuY29tcG9uZW50cy5jYWNoZS5TaW1wbGVDYWNoZS48aW5pdD4o U2ltcGxlQ2FjaGUuamF2YTozOSkNCiAgICAgICAgYXQgY29tLnNlcnZpbmd4bWwuYXBwLkFw cERyaXZlci5zdGFydHVwKEFwcERyaXZlci5qYXZhOjEyMCkNCiAgICAgICAgYXQgY29tLnNl cnZpbmd4bWwuYXBwLkFwcERyaXZlci5zdGFydHVwKEFwcERyaXZlci5qYXZhOjk5KQ0KICAg ICAgICBhdCBjb20uc2VydmluZ3htbC5hcHAuY29uc29sZWFwcC5Db25zb2xlQXBwLm1haW4o Q29uc29sZUFwcC5qYXZhOjEyMCkNCltyYW1zQGxvY2FsaG9zdCBzZXJ2aW5neG1sLTAuMy4y XSQgICAgICAgICAgICAgICAgICAgICAgICAgDQoNCkNhbiBhbnkgb25lIHN1Z2dlc3QgYSBz b2x1dGlvbiBmb3IgdGhpcy4gSXQgaXMgdmVyeSB1cmdlbnQNCg0KcmVnYXJkcw0KUmFtUmVk ZHkNCg0KDQoNClRoaXMgZS1tYWlsIGFuZCBhbnkgZmlsZXMgdHJhbnNtaXR0ZWQgd2l0aCBp dCBhcmUgZm9yIHRoZSBzb2xlIHVzZSBvZiB0aGUgaW50ZW5kZWQgcmVjaXBpZW50KHMpIGFu ZCBtYXkgY29udGFpbiBjb25maWRlbnRpYWwgYW5kIHByaXZpbGVnZWQgaW5mb3JtYXRpb24u IElmIHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZCByZWNpcGllbnQgb3IgcmVjZWl2ZWQgaXQg aW4gZXJyb3IsIHBsZWFzZSBjb250YWN0IHRoZSBzZW5kZXIgYnkgcmVwbHkgZS1tYWlsIGFu ZCBkZXN0cm95IGFsbCBjb3BpZXMgb2YgdGhlIG9yaWdpbmFsIG1lc3NhZ2UuIFBsZWFzZSBk byBub3QgY29weSBpdCBmb3IgYW55IHB1cnBvc2Ugb3IgZGlzY2xvc2UgaXRzIGNvbnRlbnRz Lg0KDQpDb3B5cmlnaHQgVGFyYW5nIFNvZnR3YXJlIFRlY2hub2xvZ2llcyBQdnQuIEx0ZC4g MjAwNC4gQWxsIHJpZ2h0cyBSZXNlcnZlZA== |
From: rams <ra...@ta...> - 2006-04-26 04:52:55
|
SGksDQpJIGFtIGdldHRpbmcgdGhlIGZvbGxvd2luZyBleGNlcHRpb24gd2hlbiBpIHRyeSB0 byBydW4gU2VydmluZ3htbCB1c2luZyB0aGUgDQpyZXF1aXJlZCBpbnB1dCBmaWxlcy4gVGhl IGNvbmN1cnJlbnQgamFyIGlzIHRoZXJlIGluIHRoZSBwYXRoIGFuZCBpdCBjb250YWlucyAN CnRoZSByZXF1aXJlZCBmaWxlIGFsc28uDQoNCkV4YW1wbGU6IGphdmEgLWphciBkaXIvc2Vy dmluZ3htbC5qYXIgLXIgcmVzb3VyY2VzLnhtbCAtbyBvdXQuaHRtbCBzZXJ2aWNlDQpbcmFt c0Bsb2NhbGhvc3Qgc2VydmluZ3htbC0wLjMuMl0kIGphdmEgLWphciBzZXJ2aW5neG1sLmph ciAtciANCmJvb2tzLXJlc291cmNlcy54bWwgLWkgZGF0YS9ib29rcy50eHQgLW8gYm9va3Mu eG1sIGJvb2tzDQpFeGNlcHRpb24gaW4gdGhyZWFkICJtYWluIiBqYXZhLmxhbmcuTm9DbGFz c0RlZkZvdW5kRXJyb3I6IA0KRURVL29zd2Vnby9jcy9kbC91dGlsL2NvbmN1cnJlbnQvUmVh ZFdyaXRlTG9jaw0KICAgICAgICBhdCANCmNvbS5zZXJ2aW5neG1sLmNvbXBvbmVudHMuY2Fj aGUuU2ltcGxlQ2FjaGUuPGluaXQ+KFNpbXBsZUNhY2hlLmphdmE6MzkpDQogICAgICAgIGF0 IGNvbS5zZXJ2aW5neG1sLmFwcC5BcHBEcml2ZXIuc3RhcnR1cChBcHBEcml2ZXIuamF2YTox MjApDQogICAgICAgIGF0IGNvbS5zZXJ2aW5neG1sLmFwcC5BcHBEcml2ZXIuc3RhcnR1cChB cHBEcml2ZXIuamF2YTo5OSkNCiAgICAgICAgYXQgY29tLnNlcnZpbmd4bWwuYXBwLmNvbnNv bGVhcHAuQ29uc29sZUFwcC5tYWluKENvbnNvbGVBcHAuamF2YToxMjApDQooaS1zZWFyY2gp YCc6ICANCg0KDQoNClRoaXMgZS1tYWlsIGFuZCBhbnkgZmlsZXMgdHJhbnNtaXR0ZWQgd2l0 aCBpdCBhcmUgZm9yIHRoZSBzb2xlIHVzZSBvZiB0aGUgaW50ZW5kZWQgcmVjaXBpZW50KHMp IGFuZCBtYXkgY29udGFpbiBjb25maWRlbnRpYWwgYW5kIHByaXZpbGVnZWQgaW5mb3JtYXRp b24uIElmIHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZCByZWNpcGllbnQgb3IgcmVjZWl2ZWQg aXQgaW4gZXJyb3IsIHBsZWFzZSBjb250YWN0IHRoZSBzZW5kZXIgYnkgcmVwbHkgZS1tYWls IGFuZCBkZXN0cm95IGFsbCBjb3BpZXMgb2YgdGhlIG9yaWdpbmFsIG1lc3NhZ2UuIFBsZWFz ZSBkbyBub3QgY29weSBpdCBmb3IgYW55IHB1cnBvc2Ugb3IgZGlzY2xvc2UgaXRzIGNvbnRl bnRzLg0KDQpDb3B5cmlnaHQgVGFyYW5nIFNvZnR3YXJlIFRlY2hub2xvZ2llcyBQdnQuIEx0 ZC4gMjAwNC4gQWxsIHJpZ2h0cyBSZXNlcnZlZA== |
From: Daniel P. <dan...@sy...> - 2006-03-07 04:26:14
|
Bala, This feature is now supported in version 0.4.1. New elements sx:crcFlatFileSignature and sx:sizeFlatFileSignature have been introduced to allow flat files to be signed with the CRC value and byte count of their data sections, with the signature values placed in header or trailer records. These values will be checked when the file is read and created when the file is written. See the "flat to flat" example "checked books" in the on-line examples. Regards, Daniel Parker ----- Original Message ----- From: "Bala Murali" <sba...@ya...> To: "Daniel Parker" <dan...@sy...> Sent: Wednesday, January 18, 2006 5:08 AM Subject: Re: [Servingxml-help] Transformation on Flat files > In the flat file processing we have a common > requirement of checking integrity of the file. > Typically the header record will contain CRC value of > the file. We would like to > > 1.Extract CRC from the header. > > 2.Strip the header record from the file, compute CRC > > 3. Check CRC if it matches > > Now if we use servingxml to map the CRC element of the > header to a target field, I am not sure how to do the > next step since the file is in a streamed processing > mode. Pls let me know is there an elegant solution to > this, since I do not want to put an extraction logic > for each and every format of the file. The extraction > should really happen within this framework > > Regards > > Bala > |
From: Daniel P. <dan...@sy...> - 2006-02-21 06:46:50
|
Akhil, In version 0.4.0c, I've added a helper class = com.servingxml.io.helpers.StreamSourceHelper which has the static method "fromJaxpSource", for creating the most = efficient StreamSource from a JAXP source. It checks whether the source = is a javax.transform.stream.StreamSource, whether it has an InputStream = or a Reader, and if not, if it has a resolvable systemId. If all else = fails, it creates a default Source adaptor that will transform the = source into a byte array, and use that to create a ByteArrayInputStream. There are some test cases in = framework/src/test/java/com/servingxml/io/StreamSourceHelperTest.java. Also, the source and sink classes have been moved (since 0.4.0) to the = com.servingxml.io package, and the class = com.servingxml.io.streamsink.StringStreamSink has been added, which = basically wraps your code. =20 You might also want to pass an optional third argument to the = constructor of FlowImpl, import com.servingxml.io.saxsource.SaxSource; import com.servingxml.io.helpers.SaxSourceHelper; SaxSource saxSource =3D SaxSourceHelper.fromJaxpSource(source); Flow flow =3D new FlowImpl(streamSource, streamSink, saxSource); This is not required, but if the JAXP source happens to wrap a DOM or an = XMLReader, it will be more efficient. =20 Regards, Daniel ----- Original Message -----=20 From: Akhil S. Srinivasan=20 To: Akhil S. Srinivasan=20 Cc: ser...@li...=20 Sent: Saturday, February 04, 2006 2:50 AM Subject: RE: [Servingxml-help] Content is notallowed in prolog? These lines seemed to be the problem StreamSource defaultStreamSource =3D new = StringStreamSource(source.toString()); =20 The fix I have used is=20 InputStream siss =3D = ((javax.xml.transform.stream.StreamSource)source).getInputStream(); StreamSource defaultStreamSource = =3D new InputStreamSourceAdaptor(siss); =20 I guess haste makes for a lot of waste =20 Thanks and really sorry for this stupid problem. =20 Akhil Srinivasan =20 PS: servingXML is a pretty cool piece of software and usefull too J -------------------------------------------------------------------------= ----- |
From: Akhil S. S. <ak...@ma...> - 2006-02-04 07:54:43
|
These lines seemed to be the problem=0D=0A=0D=0A = StreamSource defaultStreamSource =3D new=0D=0AStringStreamSource(source.= toString());=0D=0A=0D=0A=20=0D=0A=0D=0AThe fix I have used is=20=0D=0A=0D=0A= InputStream siss =3D=0D=0A((javax.xml.t= ransform.stream.StreamSource)source).getInputStream();=0D=0A=0D=0A = StreamSource defaultStreamSource =3D=0D=0Anew In= putStreamSourceAdaptor(siss);=0D=0A=0D=0A=20=0D=0A=0D=0AI guess haste makes= for a lot of waste=0D=0A=0D=0A=20=0D=0A=0D=0AThanks and really sorry for t= his stupid problem.=0D=0A=0D=0A=20=0D=0A=0D=0AAkhil Srinivasan=0D=0A=0D=0A =0D= =0A=0D=0APS: servingXML is a pretty cool piece of software and usefull too = :-)=0D=0A=0D=0A _____ =20=0D=0A=0D=0AFrom: Akhil S. Srinivasan=20=0D=0ASen= t: Saturday, February 04, 2006 12:48 PM=0D=0ATo: Daniel Parker=0D=0ACc: ser= vin...@li...=0D=0ASubject: RE: [Servingxml-help] Cont= ent is notallowed in prolog=3F=0D=0A=0D=0A=20=0D=0A=0D=0A=20=0D=0A=0D=0AI'm= sorry to be such a bother. I am trying to embed the servingXML=0D=0Acompon= ent into ServiceMix JMS components. Mainly so I can send a=0D=0Atextstring = and convert it into=20=0D=0A=0D=0AXML before it enters the JBI bus. The cod= e I came up with is=0D=0A=0D=0A=20=0D=0A=0D=0A = AppContext appContext =3D new=0D=0ADefaultAppContext(APPLICATION_NAM= E,=20=0D=0A=0D=0A=20=0D=0Adriver.getResources(), driver.getNameTable());=0D= =0A=0D=0A ServiceContext serviceContext = =3D new=0D=0ADefaultServiceContext(appContext, "servingxml");=0D=0A=0D=0A = =20=0D=0A=0D=0A = Name serviceName =3D=0D=0AName.parse(serviceContext, SERVICE_SOURC= E_NAME);=0D=0A=0D=0A =20=0D=0A=0D=0A = StreamSource defaultStreamSource =3D=0D=0Ane= w StringStreamSource(text);=0D=0A=0D=0A = ByteArrayOutputStream boss =3D new=0D=0AByteArrayOutputStream();=0D=0A=0D=0A= StreamSink defaultStreamSink =3D new=0D= =0AOutputStreamSinkAdaptor(boss);=0D=0A=0D=0A = =20=0D=0A=0D=0A Flow flow =3D new=0D= =0AFlowImpl(defaultStreamSource, defaultStreamSink);=0D=0A=0D=0A = =20=0D=0A=0D=0A = RecordBuilder recordBuilder =3D new=0D=0ARecordBuilder(SystemConstants.PARA= METERS_TYPE_NAME);=0D=0A=0D=0A // Add s= ome parameters, if any =20=0D=0A=0D=0A R= ecord parameters =3D=0D=0ArecordBuilder.toRecord();=0D=0A=0D=0A = =20=0D=0A=0D=0A S= ervice service =3D=0D=0A(Service)appContext.getResources().lookupServiceCom= ponent(Service.class,=0D=0AserviceName);=0D=0A=0D=0A = if (service =3D=3D null) {=0D=0A=0D=0A = throw new=0D=0AServingXmlException("Cannot find ser= vice " + serviceName);=0D=0A=0D=0A }=0D=0A=0D= =0A service.execute(serviceContext,=0D=0A= parameters, flow);=0D=0A=0D=0A =20=0D=0A=0D= =0A boss.flush();=0D=0A=0D=0A = String tempString =3D new=0D=0AString(boss.toByteA= rray());=0D=0A=0D=0A source =3D new=0D=0A= BytesSource(tempString.trim().getBytes());=0D=0A=0D=0A=20=0D=0A=0D=0AThe ma= in problem I faced is that there is a file sink but no string=0D=0Asink. So= I have tried to put the output of servingXML into a bytestream=0D=0Aand co= nvert that into a string but since that be the problem can you=0D=0Aadvise = on a possible workaround=3F Or would coming up with a StringSink be=0D=0Aa = better option=3F=0D=0A=0D=0A=20=0D=0A=0D=0AThanks=0D=0A=0D=0AAkhil Srinivas= an =20=0D=0A=0D=0A=20=0D=0A=0D=0A _____ =20=0D=0A=0D= =0AFrom: Daniel Parker [mailto:dan...@sy...]=20=0D=0ASent: Sa= turday, February 04, 2006 9:12 AM=0D=0ATo: Akhil S. Srinivasan=0D=0ACc: ser= vin...@li...=0D=0ASubject: Re: [Servingxml-help] Cont= ent is notallowed in prolog=3F=0D=0A=0D=0A=20=0D=0A=0D=0AAkhil,=0D=0A=0D=0A= =20=0D=0A=0D=0A"Content is not allowed in prolog" is a parser error message= , that's=0D=0Acomplaining about the beginning of the received message, name= ly <=3Fxml=0D=0Aversion=3D"1.0" encoding=3D"utf-8"=3F>. Try printing out t= he hex values of=0D=0Athe first few bytes of the message and make sure ther= e's no character,=0D=0Aspace, or junk text before the <=3F.=0D=0A=0D=0A=20=0D= =0A=0D=0AAlso, messages in utf-8 encoding can contain three leading bytes, = EF BB=0D=0ABF,called a BOM, and there is a known bug with versions of Java = before=0D=0A1.5, Java didn't handle BOMs on UTF-8 documents properly, see=0D= =0Ahttp://bugs.sun.com/bugdatabase/view_bug.do=3Fbug_id=3D4508058. So chec= k if=0D=0Ayour message contains a BOM. Try using Java 1.5 if you're not al= ready=0D=0Adoing so, and see if that helps. =20=0D=0A=0D=0A=20=0D=0A=0D=0AR= egards,=0D=0A=0D=0ADaniel Parker=0D=0A=0D=0A=09----- Original Message -----= =20=0D=0A=0D=0A=09From: Akhil S. Srinivasan <mailto:ak...@ma...> =0D= =0A=0D=0A=09To: Daniel Parker <mailto:dan...@sy...> =20=0D=0A=0D= =0A=09Cc: ser...@li...=20=0D=0A=0D=0A=09Sent: Frid= ay, February 03, 2006 3:16 AM=0D=0A=0D=0A=09Subject: RE: [Servingxml-help] = Content is notallowed in prolog=3F=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09I tried = as you have suggested but have run up against the same=0D=0Aproblem.=0D=0A=0D= =0A=09=20=0D=0A=0D=0A=09Receiving message=0D=0A=0D=0A=09NMR(content) org.ap= ache.servicemix.jbi.jaxp.BytesSource@90ed81=0D=0A=0D=0A=09NMR(content) <=3F= xml version=3D"1.0" encoding=3D"utf-8"=3F><ord:orders=0D=0Axmlns:ord=3D"htt= p:/=0D=0A=0D=0A=09/mastek.com/demos/servicemixtest/orders"=0D=0Axmlns:xsi=3D= "http://www.w3.org/2001/XMLSc=0D=0A=0D=0A=09hema-instance"=0D=0Axsi:schemaL= ocation=3D"order-record.xsd"><ord:order><ord:ordertype>B=0D=0A=0D=0A=09=0D=0A= </ord:ordertype><ord:companyticker>AMZN</ord:companyticker><ord:companyn=0D= =0Aame>Amaz=0D=0A=0D=0A=09on=0D=0AInc</ord:companyname><ord:quantity>10.0</= ord:quantity></ord:order></ord:=0D=0Aorder=0D=0A=0D=0A=09s>=0D=0A=0D=0A=09s= ending to client-sender=0D=0A=0D=0A=09sent to client-sender=0D=0A=0D=0A=09 =0D= =0A=0D=0A=09[Fatal Error] :1:1: Content is not allowed in prolog.=0D=0A=0D=0A= =09com.servingxml.util.ServingXmlException: Content is not allowed=0D=0Ain = prolog.=0D=0A=0D=0A=09 at=0D=0Acom.servingxml.components.xmlpipeline= =2EPipeline.execute(Pipeline.java:=0D=0A=0D=0A=0994)=0D=0A=0D=0A=09 = at=0D=0Acom.servingxml.components.inverserecordmapping.XmlRecordReader.read= Re=0D=0A=0D=0A=09cords(XmlRecordReader.java:93)=0D=0A=0D=0A=09 at=0D= =0Acom.servingxml.components.recordio.RecordPipeline.execute(RecordPipel=0D= =0A=0D=0A=09ine.java:69)=0D=0A=0D=0A=09 at=0D=0Acom.servingxml.compo= nents.recordio.ProcessRecordsAppender.execute(Pro=0D=0A=0D=0A=09cessRecords= Appender.java:81)=0D=0A=0D=0A=09 at=0D=0Acom.servingxml.components.s= ervice.ServiceImpl.execute(ServiceImpl.jav=0D=0A=0D=0A=09a:66)=0D=0A=0D=0A=09= at=0D=0Acom.mastek.servicemix.ServingXmlTransformer.toResult(Servin= gXmlTransf=0D=0A=0D=0A=09ormer.java:130)=0D=0A=0D=0A=09 at=0D=0Acom.= mastek.servicemix.TextSourceMarshaler.asString(TextSourceMarshale=0D=0A=0D=0A= =09r.java:28)=0D=0A=0D=0A=09 at=0D=0Aorg.apache.servicemix.component= s.jms.JmsMarshaler.messageAsString(Jms=0D=0A=0D=0A=09Marshaler.java:91)=0D=0A=0D= =0A=09 at=0D=0Aorg.apache.servicemix.components.jms.JmsMarshaler.cre= ateMessage(JmsMa=0D=0A=0D=0A=09rshaler.java:68)=0D=0A=0D=0A=09 at=0D= =0Aorg.apache.servicemix.components.jms.JmsSenderComponent$1.createMessa=0D= =0A=0D=0A=09ge(JmsSenderComponent.java:72)=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09= I am posing my entire resource file in. I hope it helps=0D=0A=0D=0A=09=20=0D= =0A=0D=0A=09<=3Fxml version=3D"1.0"=3F>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09<sx= :resources xmlns:sx=3D"http://www.servingxml.com/core"=0D=0A=0D=0A=09=0D= =0Axmlns:msv=3D"http://www.servingxml.com/extensions/msv"=0D=0A=0D=0A=09=0D= =0Axmlns:ord=3D"http://mastek.com/demos/servicemixtest/orders">=0D=0A=0D=0A= =09=20=0D=0A=0D=0A=09 <sx:parameter name=3D"validate">=0D=0A=0D=0A=09 <= sx:defaultValue>no</sx:defaultValue>=0D=0A=0D=0A=09 </sx:parameter>=0D=0A=0D= =0A=09=20=0D=0A=0D=0A=09 <sx:service id=3D"orderstoxml">=0D=0A=0D=0A=09 = <sx:serialize>=0D=0A=0D=0A=09 <sx:transform>=0D=0A=0D=0A=09 <s= x:content ref=3D"orders"/>=20=0D=0A=0D=0A=09 </sx:transform>=0D=0A=0D=0A= =09 </sx:serialize>=0D=0A=0D=0A=09 </sx:service>=0D=0A=0D=0A=09=20=0D=0A=0D= =0A=09 <sx:recordContent id=3D"orders">=0D=0A=0D=0A=09 <sx:flatFileRead= er>=0D=0A=0D=0A=09 <!-- Is not needed, it does the transform then on a= nything=0D=0Agiven=0D=0A=0D=0A=09 <sx:stringSource />=0D=0A=0D=0A= =09 <sx:urlSource url=3D"orders.csv"/>=20=0D=0A=0D=0A=09 --= >=0D=0A=0D=0A=09 <sx:flatFile ref=3D"ordersFlatFile"/>=0D=0A=0D=0A=09 = <!-- causes error for some reason=0D=0A=0D=0A=09 <msv= :msvRecordFilter=0D=0Aschema=3D"order-record.xsd"/>=0D=0A=0D=0A=09 -->=0D= =0A=0D=0A=09 </sx:flatFileReader>=0D=0A=0D=0A=09 <sx:recordMapping re= f=3D"ordersToXmlMapping"/>=0D=0A=0D=0A=09 </sx:recordContent>=0D=0A=0D=0A=09= =20=0D=0A=0D=0A=09 <sx:flatFile id=3D"ordersFlatFile">=0D=0A=0D=0A=09 = <sx:commentSymbol value=3D"#"/>=0D=0A=0D=0A=09 <sx:flatFileBody>=0D=0A=0D= =0A=09 <sx:flatRecordType id=3D"order">=0D=0A=0D=0A=09 <sx:fi= eldDelimiter value=3D","/>=0D=0A=0D=0A=09 <sx:delimitedField name=3D= "ordertype-field"=0D=0Alabel=3D"OrderType"/>=0D=0A=0D=0A=09 <sx:delimi= tedField name=3D"companyticker-field"=0D=0Alabel=3D"CompanyTicker"/>=0D=0A=0D= =0A=09 <sx:delimitedField name=3D"companyname-field"=0D=0Alabel=3D= "CompanyName"/>=0D=0A=0D=0A=09 <sx:delimitedField name=3D"quantity= -field"=0D=0Alabel=3D"Quantity"/>=0D=0A=0D=0A=09 </sx:flatRecordType= >=0D=0A=0D=0A=09 </sx:flatFileBody>=0D=0A=0D=0A=09 </sx:flatFile> =0D= =0A=0D=0A=09=20=0D=0A=0D=0A=09 <sx:recordMapping id=3D"ordersToXmlMapping"= >=0D=0A=0D=0A=09 <ord:orders=0D=0Axmlns:ord=3D"http://mastek.com/demos= /servicemixtest/orders"=0D=0A=0D=0A=09=0D=0Axmlns:xsi=3D"http://www.w3.org/= 2001/XMLSchema-instance"=0D=0A=0D=0A=09 xsi:schemaLocatio= n=3D"order-record.xsd">=20=0D=0A=0D=0A=09 <sx:onRecord>=0D=0A=0D=0A=09= <ord:order>=0D=0A=0D=0A=09 <sx:fieldElementMap field=3D"or= dertype-field"=0D=0Aelement=3D"ord:ordertype"/> =20=0D=0A=0D=0A=09 = <sx:fieldElementMap field=3D"companyticker-field"=0D=0Aelement=3D"ord:comp= anyticker"/> =20=0D=0A=0D=0A=09 <sx:fieldElementMap field=3D= "companyname-field"=0D=0Aelement=3D"ord:companyname"/> =20=0D=0A=0D=0A=09 = <sx:fieldElementMap field=3D"quantity-field"=0D=0Aelement=3D"ord:qu= antity"/> =20=0D=0A=0D=0A=09 </ord:order> =20=0D=0A=0D=0A=09= </sx:onRecord>=0D=0A=0D=0A=09 </ord:orders>=0D=0A=0D=0A=09 </sx:r= ecordMapping>=20=0D=0A=0D=0A=09 =20=0D=0A=0D=0A=09 <sx:service id=3D"order= stocsv" name=3D"orderstocsv">=0D=0A=0D=0A=09 <sx:writeRecords>=0D=0A=0D=0A= =09 <sx:flatFileWriter>=0D=0A=0D=0A=09 <sx:flatFile ref=3D"orde= rsFlatFile"/>=0D=0A=0D=0A=09 </sx:flatFileWriter>=0D=0A=0D=0A=09 = <sx:xmlRecordReader>=0D=0A=0D=0A=09 <sx:inverseRecordMapping ref=3D"= ordersToCSVMapping"/>=0D=0A=0D=0A=09 <sx:transform>=0D=0A=0D=0A=09 = <sx:document/>=0D=0A=0D=0A=09 </sx:transform>=0D=0A=0D=0A= =09 </sx:xmlRecordReader>=0D=0A=0D=0A=09 </sx:writeRecords> =20=0D=0A=0D= =0A=09 </sx:service>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 =0D= =0A=0D=0A=09 <sx:inverseRecordMapping id=3D"ordersToCSVMapping">=0D=0A=0D=0A= =09 <sx:documentFragmentMap path=3D"/ord:orders/ord:order">=0D=0A=0D=0A=09= <sx:fragmentRecordMap recordType=3D"order">=0D=0A=0D=0A=09 <sx= :fragmentFieldMap select=3D"ord:ordertype"=0D=0Afield=3D"ordertype"/>=0D=0A=0D= =0A=09 <sx:fragmentFieldMap select=3D"ord:companyticker"=0D=0Afield=3D= "companyticker"/>=0D=0A=0D=0A=09 <sx:fragmentFieldMap select=3D"ord:= companyname"=0D=0Afield=3D"companyname"/>=0D=0A=0D=0A=09 <sx:fragmen= tFieldMap select=3D"ord:quantity"=0D=0Afield=3D"quantity"/>=0D=0A=0D=0A=09 = </sx:fragmentRecordMap>=0D=0A=0D=0A=09 </sx:documentFragmentMap>=0D= =0A=0D=0A=09 </sx:inverseRecordMapping>=0D=0A=0D=0A=09 = =20=0D=0A=0D=0A=09</sx:resources>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09And while= I am at it my schema definition=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09<xsd:schem= a xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=0D=0A=0D=0A=09=0D=0Axmlns:= ord=3D"http://mastek.com/demos/servicemixtest/orders"=0D=0A=0D=0A=09=0D=0At= argetNamespace=3D"http://mastek.com/demos/servicemixtest/orders"=0D=0A=0D=0A= =09 elementFormDefault=3D"unqualified"=0D=0A=0D=0A=09 a= ttributeFormDefault=3D"unqualified">=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <xsd:= annotation>=0D=0A=0D=0A=09 <xsd:documentation xml:lang=3D"en">=0D=0A=0D=0A= =09 Order Sent record schema=20=0D=0A=0D=0A=09 </xsd:documentation>=0D=0A=0D= =0A=09 </xsd:annotation>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <xsd:element name= =3D"orders" type=3D"ord:OrderRecords"/>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <x= sd:complexType name=3D"OrderRecords">=0D=0A=0D=0A=09 <xsd:sequence>=0D=0A=0D= =0A=09 <xsd:element name=3D"order" type=3D"ord:OrderRecord"=0D=0AminOccur= s=3D"0" maxOccurs=3D"unbounded"/>=0D=0A=0D=0A=09 </xsd:sequence>=0D=0A=0D=0A= =09 </xsd:complexType>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <!-- This element's= name matches the value of the name=0D=0Aattribute in the px:flatFileRecord= Type element. -->=0D=0A=0D=0A=09 <xsd:complexType name=3D"OrderRecord">=0D=0A=0D= =0A=09 <xsd:sequence>=0D=0A=0D=0A=09 <xsd:element name=3D"ordertype" typ= e=3D"ord:OrderType"/>=0D=0A=0D=0A=09 <xsd:element name=3D"companyticker" = type=3D"ord:CompanyTicker"/>=0D=0A=0D=0A=09 <xsd:element name=3D"companyn= ame" type=3D"xsd:string"/>=0D=0A=0D=0A=09 <xsd:element name=3D"quantity" = type=3D"xsd:integer"/> =20=0D=0A=0D=0A=09 </xsd:sequence>=0D=0A=0D=0A=09= </xsd:complexType>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <xsd:simpleType name=3D= "OrderType">=0D=0A=0D=0A=09 <xsd:restriction base=3D"xsd:string">=0D=0A=0D= =0A=09 <xsd:length value=3D"1" fixed=3D"true"/>=0D=0A=0D=0A=09 </xs= d:restriction>=0D=0A=0D=0A=09 </xsd:simpleType>=0D=0A=0D=0A=09 =20=0D=0A=0D= =0A=09 <xsd:simpleType name=3D"CompanyTicker">=0D=0A=0D=0A=09 <xsd:rest= riction base=3D"xsd:string">=0D=0A=0D=0A=09 <xsd:length value=3D"4" fi= xed=3D"true"/>=0D=0A=0D=0A=09 </xsd:restriction>=0D=0A=0D=0A=09 </xsd:s= impleType>=0D=0A=0D=0A=09 =20=0D=0A=0D=0A=09</xsd:schema>=0D=0A=0D=0A=09 =0D= =0A=0D=0A=09Akhil Srinivasan=0D=0A=0D=0A=09=20=0D=0A=0D=0A=0D=0AMASTEK=20=0D= =0A"Making a valuable difference"=0D=0AMastek in NASSCOM's 'India Top 20' S= oftware Service Exporters List.=0D=0AIn the US, we're called MAJESCOMASTEK=0D= =0A=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions expressed = in this e-mail are those of the individual and not=0D=0Athat of Mastek Limi= ted, unless specifically indicated to that effect.=0D=0AMastek Limited does= not accept any responsibility or liability for it.=0D=0AThis e-mail and at= tachments (if any) transmitted with it are=0D=0Aconfidential and/or privile= ged and solely for the use of the intended=0D=0Aperson or entity to which i= t is addressed. Any review, re-transmission,=0D=0Adissemination or other us= e of or taking of any action in reliance upon=0D=0Athis information by pers= ons or entities other than the intended=0D=0Arecipient is prohibited. This = e-mail and its attachments have been=0D=0Ascanned for the presence of compu= ter viruses. It is the responsibility=0D=0Aof the recipient to run the viru= s check on e-mails and attachments=0D=0Abefore opening them. If you have re= ceived this e-mail in error, kindly=0D=0Adelete this e-mail from all comput= ers.=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A=0D=0A=20=0D=0A=0D= =0A=20=0D=0A=0D=0A=20=0D=0A=0D=0A=20=0D=0A=0D=0A=0D=0AMASTEK=20=0D=0A"Makin= g a valuable difference"=0D=0AMastek in NASSCOM's 'India Top 20' Software S= ervice Exporters List.=0D=0AIn the US, we're called MAJESCOMASTEK=0D=0A=0D=0A= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D= =0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions expressed in this e= -mail are those of the individual and not=0D=0Athat of Mastek Limited, unle= ss specifically indicated to that effect.=0D=0AMastek Limited does not acce= pt any responsibility or liability for it.=0D=0AThis e-mail and attachments= (if any) transmitted with it are=0D=0Aconfidential and/or privileged and s= olely for the use of the intended=0D=0Aperson or entity to which it is addr= essed. Any review, re-transmission,=0D=0Adissemination or other use of or t= aking of any action in reliance upon=0D=0Athis information by persons or en= tities other than the intended=0D=0Arecipient is prohibited. This e-mail an= d its attachments have been=0D=0Ascanned for the presence of computer virus= es. It is the responsibility=0D=0Aof the recipient to run the virus check o= n e-mails and attachments=0D=0Abefore opening them. If you have received th= is e-mail in error, kindly=0D=0Adelete this e-mail from all computers.=0D=0A= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D= =0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A=0D=0A=20=0D=0A=0D=0A=20=0D=0A=0D= =0A=20=0D=0A=0D=0AMASTEK=20=0D=0A"Making a valuable difference"=0D=0AMastek= in NASSCOM's 'India Top 20' Software Service Exporters List.=0D=0AIn the U= S, we're called MAJESCOMASTEK=0D=0A=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~=0D=0AOpinions expressed in this e-mail are those of the individual and no= t that of Mastek Limited, unless specifically indicated to that effect. Mas= tek Limited does not accept any responsibility or liability for it. This e-= mail and attachments (if any) transmitted with it are confidential and/or p= rivileged and solely for the use of the intended person or entity to which = it is addressed. Any review, re-transmission, dissemination or other use of= or taking of any action in reliance upon this information by persons or en= tities other than the intended recipient is prohibited. This e-mail and its= attachments have been scanned for the presence of computer viruses. It is = the responsibility of the recipient to run the virus check on e-mails and a= ttachments before opening them. If you have received this e-mail in error, = kindly delete this e-mail from all computers.=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~=0D=0A |
From: Akhil S. S. <ak...@ma...> - 2006-02-04 07:22:52
|
=20=0D=0A=0D=0AI'm sorry to be such a bother. I am trying to embed the serv= ingXML=0D=0Acomponent into ServiceMix JMS components. Mainly so I can send = a=0D=0Atextstring and convert it into=20=0D=0A=0D=0AXML before it enters th= e JBI bus. The code I came up with is=0D=0A=0D=0A=20=0D=0A=0D=0A = AppContext appContext =3D new=0D=0ADefaultAppConte= xt(APPLICATION_NAME,=20=0D=0A=0D=0A=20=0D=0Adriver.getResources(), driver.g= etNameTable());=0D=0A=0D=0A ServiceConte= xt serviceContext =3D new=0D=0ADefaultServiceContext(appContext, "servingxm= l");=0D=0A=0D=0A =20=0D=0A=0D=0A = Name serviceName =3D=0D=0AName.parse(serviceCont= ext, SERVICE_SOURCE_NAME);=0D=0A=0D=0A =0D= =0A=0D=0A StreamSource defaultStreamSour= ce =3D=0D=0Anew StringStreamSource(text);=0D=0A=0D=0A = ByteArrayOutputStream boss =3D new=0D=0AByteArrayOutputStream= ();=0D=0A=0D=0A StreamSink defaultStream= Sink =3D new=0D=0AOutputStreamSinkAdaptor(boss);=0D=0A=0D=0A = =20=0D=0A=0D=0A Flow= flow =3D new=0D=0AFlowImpl(defaultStreamSource, defaultStreamSink);=0D=0A=0D= =0A =20=0D=0A=0D=0A = RecordBuilder recordBuilder =3D new=0D=0ARecordBuilder(System= Constants.PARAMETERS_TYPE_NAME);=0D=0A=0D=0A = // Add some parameters, if any =20=0D=0A=0D=0A = Record parameters =3D=0D=0ArecordBuilder.toRecord();=0D=0A=0D=0A= =20=0D=0A=0D=0A = Service service =3D=0D=0A(Service)appContext.getResources().look= upServiceComponent(Service.class,=0D=0AserviceName);=0D=0A=0D=0A = if (service =3D=3D null) {=0D=0A=0D=0A = throw new=0D=0AServingXmlException("Can= not find service " + serviceName);=0D=0A=0D=0A = }=0D=0A=0D=0A service.execute(ser= viceContext,=0D=0Aparameters, flow);=0D=0A=0D=0A = =20=0D=0A=0D=0A boss.flush();=0D= =0A=0D=0A String tempString =3D new=0D=0A= String(boss.toByteArray());=0D=0A=0D=0A = source =3D new=0D=0ABytesSource(tempString.trim().getBytes());=0D=0A=0D=0A =0D= =0A=0D=0AThe main problem I faced is that there is a file sink but no strin= g=0D=0Asink. So I have tried to put the output of servingXML into a bytestr= eam=0D=0Aand convert that into a string but since that be the problem can y= ou=0D=0Aadvise on a possible workaround=3F Or would coming up with a String= Sink be=0D=0Aa better option=3F=0D=0A=0D=0A=20=0D=0A=0D=0AThanks=0D=0A=0D=0A= Akhil Srinivasan =20=0D=0A=0D=0A=20=0D=0A=0D=0A ___= __ =20=0D=0A=0D=0AFrom: Daniel Parker [mailto:dan...@sy...] =0D= =0ASent: Saturday, February 04, 2006 9:12 AM=0D=0ATo: Akhil S. Srinivasan=0D= =0ACc: ser...@li...=0D=0ASubject: Re: [Servingxml-= help] Content is notallowed in prolog=3F=0D=0A=0D=0A=20=0D=0A=0D=0AAkhil,=0D= =0A=0D=0A=20=0D=0A=0D=0A"Content is not allowed in prolog" is a parser erro= r message, that's=0D=0Acomplaining about the beginning of the received mess= age, namely <=3Fxml=0D=0Aversion=3D"1.0" encoding=3D"utf-8"=3F>. Try print= ing out the hex values of=0D=0Athe first few bytes of the message and make = sure there's no character,=0D=0Aspace, or junk text before the <=3F.=0D=0A=0D= =0A=20=0D=0A=0D=0AAlso, messages in utf-8 encoding can contain three leadin= g bytes, EF BB=0D=0ABF,called a BOM, and there is a known bug with versions= of Java before=0D=0A1.5, Java didn't handle BOMs on UTF-8 documents proper= ly, see=0D=0Ahttp://bugs.sun.com/bugdatabase/view_bug.do=3Fbug_id=3D4508058= =2E So check if=0D=0Ayour message contains a BOM. Try using Java 1.5 if y= ou're not already=0D=0Adoing so, and see if that helps. =20=0D=0A=0D=0A=20=0D= =0A=0D=0ARegards,=0D=0A=0D=0ADaniel Parker=0D=0A=0D=0A=09----- Original Mes= sage -----=20=0D=0A=0D=0A=09From: Akhil S. Srinivasan <mailto:akhilss@maste= k.com> =20=0D=0A=0D=0A=09To: Daniel Parker <mailto:danielaparker@sympatico.= ca> =20=0D=0A=0D=0A=09Cc: ser...@li...=20=0D=0A=0D= =0A=09Sent: Friday, February 03, 2006 3:16 AM=0D=0A=0D=0A=09Subject: RE: [S= ervingxml-help] Content is notallowed in prolog=3F=0D=0A=0D=0A=09=20=0D=0A=0D= =0A=09I tried as you have suggested but have run up against the same=0D=0Ap= roblem.=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09Receiving message=0D=0A=0D=0A=09NMR= (content) org.apache.servicemix.jbi.jaxp.BytesSource@90ed81=0D=0A=0D=0A=09N= MR(content) <=3Fxml version=3D"1.0" encoding=3D"utf-8"=3F><ord:orders=0D=0A= xmlns:ord=3D"http:/=0D=0A=0D=0A=09/mastek.com/demos/servicemixtest/orders"=0D= =0Axmlns:xsi=3D"http://www.w3.org/2001/XMLSc=0D=0A=0D=0A=09hema-instance"=0D= =0Axsi:schemaLocation=3D"order-record.xsd"><ord:order><ord:ordertype>B=0D=0A=0D= =0A=09=0D=0A</ord:ordertype><ord:companyticker>AMZN</ord:companyticker><ord= :companyn=0D=0Aame>Amaz=0D=0A=0D=0A=09on=0D=0AInc</ord:companyname><ord:qua= ntity>10.0</ord:quantity></ord:order></ord:=0D=0Aorder=0D=0A=0D=0A=09s>=0D=0A=0D= =0A=09sending to client-sender=0D=0A=0D=0A=09sent to client-sender=0D=0A=0D= =0A=09=20=0D=0A=0D=0A=09[Fatal Error] :1:1: Content is not allowed in prolo= g.=0D=0A=0D=0A=09com.servingxml.util.ServingXmlException: Content is not al= lowed=0D=0Ain prolog.=0D=0A=0D=0A=09 at=0D=0Acom.servingxml.componen= ts.xmlpipeline.Pipeline.execute(Pipeline.java:=0D=0A=0D=0A=0994)=0D=0A=0D=0A= =09 at=0D=0Acom.servingxml.components.inverserecordmapping.XmlRecord= Reader.readRe=0D=0A=0D=0A=09cords(XmlRecordReader.java:93)=0D=0A=0D=0A=09 = at=0D=0Acom.servingxml.components.recordio.RecordPipeline.execute(Rec= ordPipel=0D=0A=0D=0A=09ine.java:69)=0D=0A=0D=0A=09 at=0D=0Acom.servi= ngxml.components.recordio.ProcessRecordsAppender.execute(Pro=0D=0A=0D=0A=09= cessRecordsAppender.java:81)=0D=0A=0D=0A=09 at=0D=0Acom.servingxml.c= omponents.service.ServiceImpl.execute(ServiceImpl.jav=0D=0A=0D=0A=09a:66)=0D= =0A=0D=0A=09 at=0D=0Acom.mastek.servicemix.ServingXmlTransformer.toR= esult(ServingXmlTransf=0D=0A=0D=0A=09ormer.java:130)=0D=0A=0D=0A=09 = at=0D=0Acom.mastek.servicemix.TextSourceMarshaler.asString(TextSourceMarsha= le=0D=0A=0D=0A=09r.java:28)=0D=0A=0D=0A=09 at=0D=0Aorg.apache.servic= emix.components.jms.JmsMarshaler.messageAsString(Jms=0D=0A=0D=0A=09Marshale= r.java:91)=0D=0A=0D=0A=09 at=0D=0Aorg.apache.servicemix.components.j= ms.JmsMarshaler.createMessage(JmsMa=0D=0A=0D=0A=09rshaler.java:68)=0D=0A=0D= =0A=09 at=0D=0Aorg.apache.servicemix.components.jms.JmsSenderCompone= nt$1.createMessa=0D=0A=0D=0A=09ge(JmsSenderComponent.java:72)=0D=0A=0D=0A=09= =20=0D=0A=0D=0A=09I am posing my entire resource file in. I hope it helps=0D= =0A=0D=0A=09=20=0D=0A=0D=0A=09<=3Fxml version=3D"1.0"=3F>=0D=0A=0D=0A=09 =0D= =0A=0D=0A=09<sx:resources xmlns:sx=3D"http://www.servingxml.com/core"=0D= =0A=0D=0A=09=0D=0Axmlns:msv=3D"http://www.servingxml.com/extensions/msv"=0D= =0A=0D=0A=09=0D=0Axmlns:ord=3D"http://mastek.com/demos/servicemixtest/order= s">=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <sx:parameter name=3D"validate">=0D=0A=0D= =0A=09 <sx:defaultValue>no</sx:defaultValue>=0D=0A=0D=0A=09 </sx:parame= ter>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <sx:service id=3D"orderstoxml">=0D=0A=0D= =0A=09 <sx:serialize>=0D=0A=0D=0A=09 <sx:transform>=0D=0A=0D=0A=09 = <sx:content ref=3D"orders"/>=20=0D=0A=0D=0A=09 </sx:transform>=0D= =0A=0D=0A=09 </sx:serialize>=0D=0A=0D=0A=09 </sx:service>=0D=0A=0D=0A=09= =20=0D=0A=0D=0A=09 <sx:recordContent id=3D"orders">=0D=0A=0D=0A=09 <sx:= flatFileReader>=0D=0A=0D=0A=09 <!-- Is not needed, it does the transfo= rm then on anything=0D=0Agiven=0D=0A=0D=0A=09 <sx:stringSource /= >=0D=0A=0D=0A=09 <sx:urlSource url=3D"orders.csv"/>=20=0D=0A=0D=0A= =09 -->=0D=0A=0D=0A=09 <sx:flatFile ref=3D"ordersFlatFile"/>=0D=0A=0D= =0A=09 <!-- causes error for some reason=0D=0A=0D=0A=09 = <msv:msvRecordFilter=0D=0Aschema=3D"order-record.xsd"/>=0D=0A=0D=0A=09 = -->=0D=0A=0D=0A=09 </sx:flatFileReader>=0D=0A=0D=0A=09 <sx:record= Mapping ref=3D"ordersToXmlMapping"/>=0D=0A=0D=0A=09 </sx:recordContent>=0D= =0A=0D=0A=09 =20=0D=0A=0D=0A=09 <sx:flatFile id=3D"ordersFlatFile">=0D=0A=0D= =0A=09 <sx:commentSymbol value=3D"#"/>=0D=0A=0D=0A=09 <sx:flatFileBod= y>=0D=0A=0D=0A=09 <sx:flatRecordType id=3D"order">=0D=0A=0D=0A=09 = <sx:fieldDelimiter value=3D","/>=0D=0A=0D=0A=09 <sx:delimited= Field name=3D"ordertype-field"=0D=0Alabel=3D"OrderType"/>=0D=0A=0D=0A=09 = <sx:delimitedField name=3D"companyticker-field"=0D=0Alabel=3D"CompanyTic= ker"/>=0D=0A=0D=0A=09 <sx:delimitedField name=3D"companyname-field= "=0D=0Alabel=3D"CompanyName"/>=0D=0A=0D=0A=09 <sx:delimitedField n= ame=3D"quantity-field"=0D=0Alabel=3D"Quantity"/>=0D=0A=0D=0A=09 </sx= :flatRecordType>=0D=0A=0D=0A=09 </sx:flatFileBody>=0D=0A=0D=0A=09 </sx:= flatFile> =20=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <sx:recordMapping id=3D= "ordersToXmlMapping">=0D=0A=0D=0A=09 <ord:orders=0D=0Axmlns:ord=3D"htt= p://mastek.com/demos/servicemixtest/orders"=0D=0A=0D=0A=09=0D=0Axmlns:xsi=3D= "http://www.w3.org/2001/XMLSchema-instance"=0D=0A=0D=0A=09 = xsi:schemaLocation=3D"order-record.xsd">=20=0D=0A=0D=0A=09 <sx:onRec= ord>=0D=0A=0D=0A=09 <ord:order>=0D=0A=0D=0A=09 <sx:fieldEle= mentMap field=3D"ordertype-field"=0D=0Aelement=3D"ord:ordertype"/> =20=0D=0A=0D= =0A=09 <sx:fieldElementMap field=3D"companyticker-field"=0D=0Aelem= ent=3D"ord:companyticker"/> =20=0D=0A=0D=0A=09 <sx:fieldEl= ementMap field=3D"companyname-field"=0D=0Aelement=3D"ord:companyname"/> =0D= =0A=0D=0A=09 <sx:fieldElementMap field=3D"quantity-field"=0D=0Aele= ment=3D"ord:quantity"/> =20=0D=0A=0D=0A=09 </ord:order> =20=0D= =0A=0D=0A=09 </sx:onRecord>=0D=0A=0D=0A=09 </ord:orders>=0D=0A=0D=0A= =09 </sx:recordMapping>=20=0D=0A=0D=0A=09 =20=0D=0A=0D=0A=09 <sx:service = id=3D"orderstocsv" name=3D"orderstocsv">=0D=0A=0D=0A=09 <sx:writeRecords= >=0D=0A=0D=0A=09 <sx:flatFileWriter>=0D=0A=0D=0A=09 <sx:flatFil= e ref=3D"ordersFlatFile"/>=0D=0A=0D=0A=09 </sx:flatFileWriter>=0D=0A=0D= =0A=09 <sx:xmlRecordReader>=0D=0A=0D=0A=09 <sx:inverseRecordMap= ping ref=3D"ordersToCSVMapping"/>=0D=0A=0D=0A=09 <sx:transform>=0D=0A=0D= =0A=09 <sx:document/>=0D=0A=0D=0A=09 </sx:transform>=0D= =0A=0D=0A=09 </sx:xmlRecordReader>=0D=0A=0D=0A=09 </sx:writeRecords= > =20=0D=0A=0D=0A=09 </sx:service>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 = =20=0D=0A=0D=0A=09 <sx:inverseRecordMapping id=3D"ordersToCSV= Mapping">=0D=0A=0D=0A=09 <sx:documentFragmentMap path=3D"/ord:orders/ord= :order">=0D=0A=0D=0A=09 <sx:fragmentRecordMap recordType=3D"order">=0D= =0A=0D=0A=09 <sx:fragmentFieldMap select=3D"ord:ordertype"=0D=0Afiel= d=3D"ordertype"/>=0D=0A=0D=0A=09 <sx:fragmentFieldMap select=3D"ord:= companyticker"=0D=0Afield=3D"companyticker"/>=0D=0A=0D=0A=09 <sx:fra= gmentFieldMap select=3D"ord:companyname"=0D=0Afield=3D"companyname"/>=0D=0A=0D= =0A=09 <sx:fragmentFieldMap select=3D"ord:quantity"=0D=0Afield=3D"qu= antity"/>=0D=0A=0D=0A=09 </sx:fragmentRecordMap>=0D=0A=0D=0A=09 </s= x:documentFragmentMap>=0D=0A=0D=0A=09 </sx:inverseRecordMapping>=0D=0A=0D=0A= =09 =20=0D=0A=0D=0A=09</sx:resources>=0D=0A=0D=0A=09=20=0D= =0A=0D=0A=09And while I am at it my schema definition=0D=0A=0D=0A=09=20=0D=0A=0D= =0A=09<xsd:schema xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=0D=0A=0D=0A= =09=0D=0Axmlns:ord=3D"http://mastek.com/demos/servicemixtest/orders"=0D=0A=0D= =0A=09=0D=0AtargetNamespace=3D"http://mastek.com/demos/servicemixtest/order= s"=0D=0A=0D=0A=09 elementFormDefault=3D"unqualified"=0D=0A=0D=0A=09= attributeFormDefault=3D"unqualified">=0D=0A=0D=0A=09=20=0D=0A=0D= =0A=09 <xsd:annotation>=0D=0A=0D=0A=09 <xsd:documentation xml:lang=3D"en">=0D= =0A=0D=0A=09 Order Sent record schema=20=0D=0A=0D=0A=09 </xsd:documentat= ion>=0D=0A=0D=0A=09 </xsd:annotation>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <xsd= :element name=3D"orders" type=3D"ord:OrderRecords"/>=0D=0A=0D=0A=09=20=0D=0A=0D= =0A=09 <xsd:complexType name=3D"OrderRecords">=0D=0A=0D=0A=09 <xsd:sequenc= e>=0D=0A=0D=0A=09 <xsd:element name=3D"order" type=3D"ord:OrderRecord"=0D= =0AminOccurs=3D"0" maxOccurs=3D"unbounded"/>=0D=0A=0D=0A=09 </xsd:sequence= >=0D=0A=0D=0A=09 </xsd:complexType>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <!-- T= his element's name matches the value of the name=0D=0Aattribute in the px:f= latFileRecordType element. -->=0D=0A=0D=0A=09 <xsd:complexType name=3D"Orde= rRecord">=0D=0A=0D=0A=09 <xsd:sequence>=0D=0A=0D=0A=09 <xsd:element name= =3D"ordertype" type=3D"ord:OrderType"/>=0D=0A=0D=0A=09 <xsd:element name=3D= "companyticker" type=3D"ord:CompanyTicker"/>=0D=0A=0D=0A=09 <xsd:element = name=3D"companyname" type=3D"xsd:string"/>=0D=0A=0D=0A=09 <xsd:element na= me=3D"quantity" type=3D"xsd:integer"/> =20=0D=0A=0D=0A=09 </xsd:sequen= ce>=0D=0A=0D=0A=09 </xsd:complexType>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <xs= d:simpleType name=3D"OrderType">=0D=0A=0D=0A=09 <xsd:restriction base=3D= "xsd:string">=0D=0A=0D=0A=09 <xsd:length value=3D"1" fixed=3D"true"/>=0D= =0A=0D=0A=09 </xsd:restriction>=0D=0A=0D=0A=09 </xsd:simpleType>=0D=0A=0D= =0A=09 =20=0D=0A=0D=0A=09 <xsd:simpleType name=3D"CompanyTicker">=0D=0A=0D= =0A=09 <xsd:restriction base=3D"xsd:string">=0D=0A=0D=0A=09 <xsd:le= ngth value=3D"4" fixed=3D"true"/>=0D=0A=0D=0A=09 </xsd:restriction>=0D=0A=0D= =0A=09 </xsd:simpleType>=0D=0A=0D=0A=09 =20=0D=0A=0D=0A=09</xsd:schema>=0D= =0A=0D=0A=09=20=0D=0A=0D=0A=09Akhil Srinivasan=0D=0A=0D=0A=09=20=0D=0A=0D=0A=0D= =0AMASTEK=20=0D=0A"Making a valuable difference"=0D=0AMastek in NASSCOM's '= India Top 20' Software Service Exporters List.=0D=0AIn the US, we're called= MAJESCOMASTEK=0D=0A=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOp= inions expressed in this e-mail are those of the individual and not=0D=0Ath= at of Mastek Limited, unless specifically indicated to that effect.=0D=0AMa= stek Limited does not accept any responsibility or liability for it.=0D=0AT= his e-mail and attachments (if any) transmitted with it are=0D=0Aconfidenti= al and/or privileged and solely for the use of the intended=0D=0Aperson or = entity to which it is addressed. Any review, re-transmission,=0D=0Adissemin= ation or other use of or taking of any action in reliance upon=0D=0Athis in= formation by persons or entities other than the intended=0D=0Arecipient is = prohibited. This e-mail and its attachments have been=0D=0Ascanned for the = presence of computer viruses. It is the responsibility=0D=0Aof the recipien= t to run the virus check on e-mails and attachments=0D=0Abefore opening the= m. If you have received this e-mail in error, kindly=0D=0Adelete this e-mai= l from all computers.=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A=0D= =0A=20=0D=0A=0D=0A=20=0D=0A=0D=0A=20=0D=0A=0D=0AMASTEK=20=0D=0A"Making a va= luable difference"=0D=0AMastek in NASSCOM's 'India Top 20' Software Service= Exporters List.=0D=0AIn the US, we're called MAJESCOMASTEK=0D=0A=0D=0A~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions expressed in this e-mail are = those of the individual and not that of Mastek Limited, unless specifically= indicated to that effect. Mastek Limited does not accept any responsibilit= y or liability for it. This e-mail and attachments (if any) transmitted wit= h it are confidential and/or privileged and solely for the use of the inten= ded person or entity to which it is addressed. Any review, re-transmission,= dissemination or other use of or taking of any action in reliance upon thi= s information by persons or entities other than the intended recipient is p= rohibited. This e-mail and its attachments have been scanned for the presen= ce of computer viruses. It is the responsibility of the recipient to run th= e virus check on e-mails and attachments before opening them. If you have r= eceived this e-mail in error, kindly delete this e-mail from all computers.=0D= =0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A |
From: Daniel P. <dan...@sy...> - 2006-02-04 03:42:29
|
Akhil, "Content is not allowed in prolog" is a parser error message, that's = complaining about the beginning of the received message, namely <?xml = version=3D"1.0" encoding=3D"utf-8"?>. Try printing out the hex values = of the first few bytes of the message and make sure there's no = character, space, or junk text before the <?. Also, messages in utf-8 encoding can contain three leading bytes, EF BB = BF,called a BOM, and there is a known bug with versions of Java before = 1.5, Java didn't handle BOMs on UTF-8 documents properly, see = http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D4508058. So check = if your message contains a BOM. Try using Java 1.5 if you're not = already doing so, and see if that helps. =20 Regards, Daniel Parker ----- Original Message -----=20 From: Akhil S. Srinivasan=20 To: Daniel Parker=20 Cc: ser...@li...=20 Sent: Friday, February 03, 2006 3:16 AM Subject: RE: [Servingxml-help] Content is notallowed in prolog? I tried as you have suggested but have run up against the same = problem. =20 Receiving message NMR(content) org.apache.servicemix.jbi.jaxp.BytesSource@90ed81 NMR(content) <?xml version=3D"1.0" encoding=3D"utf-8"?><ord:orders = xmlns:ord=3D"http:/ /mastek.com/demos/servicemixtest/orders" = xmlns:xsi=3D"http://www.w3.org/2001/XMLSc hema-instance" = xsi:schemaLocation=3D"order-record.xsd"><ord:order><ord:ordertype>B = </ord:ordertype><ord:companyticker>AMZN</ord:companyticker><ord:companyna= me>Amaz on = Inc</ord:companyname><ord:quantity>10.0</ord:quantity></ord:order></ord:o= rder s> sending to client-sender sent to client-sender =20 [Fatal Error] :1:1: Content is not allowed in prolog. com.servingxml.util.ServingXmlException: Content is not allowed in = prolog. at = com.servingxml.components.xmlpipeline.Pipeline.execute(Pipeline.java: 94) at = com.servingxml.components.inverserecordmapping.XmlRecordReader.readRe cords(XmlRecordReader.java:93) at = com.servingxml.components.recordio.RecordPipeline.execute(RecordPipel ine.java:69) at = com.servingxml.components.recordio.ProcessRecordsAppender.execute(Pro cessRecordsAppender.java:81) at = com.servingxml.components.service.ServiceImpl.execute(ServiceImpl.jav a:66) at = com.mastek.servicemix.ServingXmlTransformer.toResult(ServingXmlTransf ormer.java:130) at = com.mastek.servicemix.TextSourceMarshaler.asString(TextSourceMarshale r.java:28) at = org.apache.servicemix.components.jms.JmsMarshaler.messageAsString(Jms Marshaler.java:91) at = org.apache.servicemix.components.jms.JmsMarshaler.createMessage(JmsMa rshaler.java:68) at = org.apache.servicemix.components.jms.JmsSenderComponent$1.createMessa ge(JmsSenderComponent.java:72) =20 I am posing my entire resource file in. I hope it helps =20 <?xml version=3D"1.0"?> =20 <sx:resources xmlns:sx=3D"http://www.servingxml.com/core" = xmlns:msv=3D"http://www.servingxml.com/extensions/msv" = xmlns:ord=3D"http://mastek.com/demos/servicemixtest/orders"> =20 <sx:parameter name=3D"validate"> <sx:defaultValue>no</sx:defaultValue> </sx:parameter> =20 <sx:service id=3D"orderstoxml"> <sx:serialize> <sx:transform> <sx:content ref=3D"orders"/>=20 </sx:transform> </sx:serialize> </sx:service> =20 <sx:recordContent id=3D"orders"> <sx:flatFileReader> <!-- Is not needed, it does the transform then on anything given <sx:stringSource /> <sx:urlSource url=3D"orders.csv"/>=20 --> <sx:flatFile ref=3D"ordersFlatFile"/> <!-- causes error for some reason <msv:msvRecordFilter schema=3D"order-record.xsd"/> --> </sx:flatFileReader> <sx:recordMapping ref=3D"ordersToXmlMapping"/> </sx:recordContent> =20 <sx:flatFile id=3D"ordersFlatFile"> <sx:commentSymbol value=3D"#"/> <sx:flatFileBody> <sx:flatRecordType id=3D"order"> <sx:fieldDelimiter value=3D","/> <sx:delimitedField name=3D"ordertype-field" = label=3D"OrderType"/> <sx:delimitedField name=3D"companyticker-field" = label=3D"CompanyTicker"/> <sx:delimitedField name=3D"companyname-field" = label=3D"CompanyName"/> <sx:delimitedField name=3D"quantity-field" = label=3D"Quantity"/> </sx:flatRecordType> </sx:flatFileBody> </sx:flatFile> =20 =20 <sx:recordMapping id=3D"ordersToXmlMapping"> <ord:orders = xmlns:ord=3D"http://mastek.com/demos/servicemixtest/orders" = xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"order-record.xsd">=20 <sx:onRecord> <ord:order> <sx:fieldElementMap field=3D"ordertype-field" = element=3D"ord:ordertype"/> =20 <sx:fieldElementMap field=3D"companyticker-field" = element=3D"ord:companyticker"/> =20 <sx:fieldElementMap field=3D"companyname-field" = element=3D"ord:companyname"/> =20 <sx:fieldElementMap field=3D"quantity-field" = element=3D"ord:quantity"/> =20 </ord:order> =20 </sx:onRecord> </ord:orders> </sx:recordMapping>=20 =20 <sx:service id=3D"orderstocsv" name=3D"orderstocsv"> <sx:writeRecords> <sx:flatFileWriter> <sx:flatFile ref=3D"ordersFlatFile"/> </sx:flatFileWriter> <sx:xmlRecordReader> <sx:inverseRecordMapping ref=3D"ordersToCSVMapping"/> <sx:transform> <sx:document/> </sx:transform> </sx:xmlRecordReader> </sx:writeRecords> =20 </sx:service> =20 =20 <sx:inverseRecordMapping id=3D"ordersToCSVMapping"> <sx:documentFragmentMap path=3D"/ord:orders/ord:order"> <sx:fragmentRecordMap recordType=3D"order"> <sx:fragmentFieldMap select=3D"ord:ordertype" = field=3D"ordertype"/> <sx:fragmentFieldMap select=3D"ord:companyticker" = field=3D"companyticker"/> <sx:fragmentFieldMap select=3D"ord:companyname" = field=3D"companyname"/> <sx:fragmentFieldMap select=3D"ord:quantity" = field=3D"quantity"/> </sx:fragmentRecordMap> </sx:documentFragmentMap> </sx:inverseRecordMapping> =20 </sx:resources> =20 And while I am at it my schema definition =20 <xsd:schema xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" = xmlns:ord=3D"http://mastek.com/demos/servicemixtest/orders" = targetNamespace=3D"http://mastek.com/demos/servicemixtest/orders" elementFormDefault=3D"unqualified" attributeFormDefault=3D"unqualified"> =20 <xsd:annotation> <xsd:documentation xml:lang=3D"en"> Order Sent record schema=20 </xsd:documentation> </xsd:annotation> =20 <xsd:element name=3D"orders" type=3D"ord:OrderRecords"/> =20 <xsd:complexType name=3D"OrderRecords"> <xsd:sequence> <xsd:element name=3D"order" type=3D"ord:OrderRecord" = minOccurs=3D"0" maxOccurs=3D"unbounded"/> </xsd:sequence> </xsd:complexType> =20 <!-- This element's name matches the value of the name attribute in = the px:flatFileRecordType element. --> <xsd:complexType name=3D"OrderRecord"> <xsd:sequence> <xsd:element name=3D"ordertype" type=3D"ord:OrderType"/> <xsd:element name=3D"companyticker" type=3D"ord:CompanyTicker"/> <xsd:element name=3D"companyname" type=3D"xsd:string"/> <xsd:element name=3D"quantity" type=3D"xsd:integer"/> =20 </xsd:sequence> </xsd:complexType> =20 <xsd:simpleType name=3D"OrderType"> <xsd:restriction base=3D"xsd:string"> <xsd:length value=3D"1" fixed=3D"true"/> </xsd:restriction> </xsd:simpleType> =20 <xsd:simpleType name=3D"CompanyTicker"> <xsd:restriction base=3D"xsd:string"> <xsd:length value=3D"4" fixed=3D"true"/> </xsd:restriction> </xsd:simpleType> =20 </xsd:schema> =20 Akhil Srinivasan MASTEK=20 "Making a valuable difference" Mastek in NASSCOM's 'India Top 20' Software Service Exporters = List. In the US, we're called MAJESCOMASTEK = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Opinions expressed in this e-mail are those of the individual = and not that of Mastek Limited, unless specifically indicated to that = effect. Mastek Limited does not accept any responsibility or liability = for it. This e-mail and attachments (if any) transmitted with it are = confidential and/or privileged and solely for the use of the intended = person or entity to which it is addressed. Any review, re-transmission, = dissemination or other use of or taking of any action in reliance upon = this information by persons or entities other than the intended = recipient is prohibited. This e-mail and its attachments have been = scanned for the presence of computer viruses. It is the responsibility = of the recipient to run the virus check on e-mails and attachments = before opening them. If you have received this e-mail in error, kindly = delete this e-mail from all computers. = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 |
From: Akhil S. S. <ak...@ma...> - 2006-02-03 08:19:45
|
I tried as you have suggested but have run up against the same problem.=0D=0A=0D= =0A=20=0D=0A=0D=0AReceiving message=0D=0A=0D=0ANMR(content) org.apache.serv= icemix.jbi.jaxp.BytesSource@90ed81=0D=0A=0D=0ANMR(content) <=3Fxml version=3D= "1.0" encoding=3D"utf-8"=3F><ord:orders=0D=0Axmlns:ord=3D"http:/=0D=0A=0D=0A= /mastek.com/demos/servicemixtest/orders"=0D=0Axmlns:xsi=3D"http://www.w3.or= g/2001/XMLSc=0D=0A=0D=0Ahema-instance"=0D=0Axsi:schemaLocation=3D"order-rec= ord.xsd"><ord:order><ord:ordertype>B=0D=0A=0D=0A</ord:ordertype><ord:compan= yticker>AMZN</ord:companyticker><ord:companyn=0D=0Aame>Amaz=0D=0A=0D=0Aon=0D= =0AInc</ord:companyname><ord:quantity>10.0</ord:quantity></ord:order></ord:=0D= =0Aorder=0D=0A=0D=0As>=0D=0A=0D=0Asending to client-sender=0D=0A=0D=0Asent = to client-sender=0D=0A=0D=0A=20=0D=0A=0D=0A[Fatal Error] :1:1: Content is n= ot allowed in prolog.=0D=0A=0D=0Acom.servingxml.util.ServingXmlException: C= ontent is not allowed in=0D=0Aprolog.=0D=0A=0D=0A at=0D=0Acom.servin= gxml.components.xmlpipeline.Pipeline.execute(Pipeline.java:=0D=0A=0D=0A94)=0D= =0A=0D=0A at=0D=0Acom.servingxml.components.inverserecordmapping.Xml= RecordReader.readRe=0D=0A=0D=0Acords(XmlRecordReader.java:93)=0D=0A=0D=0A = at=0D=0Acom.servingxml.components.recordio.RecordPipeline.execute(Rec= ordPipel=0D=0A=0D=0Aine.java:69)=0D=0A=0D=0A at=0D=0Acom.servingxml.= components.recordio.ProcessRecordsAppender.execute(Pro=0D=0A=0D=0AcessRecor= dsAppender.java:81)=0D=0A=0D=0A at=0D=0Acom.servingxml.components.se= rvice.ServiceImpl.execute(ServiceImpl.jav=0D=0A=0D=0Aa:66)=0D=0A=0D=0A = at=0D=0Acom.mastek.servicemix.ServingXmlTransformer.toResult(ServingXmlT= ransf=0D=0A=0D=0Aormer.java:130)=0D=0A=0D=0A at=0D=0Acom.mastek.serv= icemix.TextSourceMarshaler.asString(TextSourceMarshale=0D=0A=0D=0Ar.java:28= )=0D=0A=0D=0A at=0D=0Aorg.apache.servicemix.components.jms.JmsMarsha= ler.messageAsString(Jms=0D=0A=0D=0AMarshaler.java:91)=0D=0A=0D=0A at=0D= =0Aorg.apache.servicemix.components.jms.JmsMarshaler.createMessage(JmsMa=0D= =0A=0D=0Arshaler.java:68)=0D=0A=0D=0A at=0D=0Aorg.apache.servicemix.= components.jms.JmsSenderComponent$1.createMessa=0D=0A=0D=0Age(JmsSenderComp= onent.java:72)=0D=0A=0D=0A=20=0D=0A=0D=0AI am posing my entire resource fil= e in. I hope it helps=0D=0A=0D=0A=20=0D=0A=0D=0A<=3Fxml version=3D"1.0"=3F>=0D= =0A=0D=0A=20=0D=0A=0D=0A<sx:resources xmlns:sx=3D"http://www.servingxml= =2Ecom/core"=0D=0A=0D=0A xmlns:msv=3D"http://www.servingxm= l.com/extensions/msv"=0D=0A=0D=0A=20=0D=0Axmlns:ord=3D"http://mastek.com/de= mos/servicemixtest/orders">=0D=0A=0D=0A=20=0D=0A=0D=0A <sx:parameter name=3D= "validate">=0D=0A=0D=0A <sx:defaultValue>no</sx:defaultValue>=0D=0A=0D=0A= </sx:parameter>=0D=0A=0D=0A=20=0D=0A=0D=0A <sx:service id=3D"orderstoxml= ">=0D=0A=0D=0A <sx:serialize>=0D=0A=0D=0A <sx:transform>=0D=0A=0D=0A= <sx:content ref=3D"orders"/>=20=0D=0A=0D=0A </sx:transform>=0D= =0A=0D=0A </sx:serialize>=0D=0A=0D=0A </sx:service>=0D=0A=0D=0A=20=0D=0A=0D= =0A <sx:recordContent id=3D"orders">=0D=0A=0D=0A <sx:flatFileReader>=0D= =0A=0D=0A <!-- Is not needed, it does the transform then on anything g= iven=0D=0A=0D=0A <sx:stringSource />=0D=0A=0D=0A <sx:= urlSource url=3D"orders.csv"/>=20=0D=0A=0D=0A -->=0D=0A=0D=0A <sx= :flatFile ref=3D"ordersFlatFile"/>=0D=0A=0D=0A <!-- causes error for s= ome reason=0D=0A=0D=0A <msv:msvRecordFilter schema=3D"orde= r-record.xsd"/>=0D=0A=0D=0A -->=0D=0A=0D=0A </sx:flatFileReader>=0D= =0A=0D=0A <sx:recordMapping ref=3D"ordersToXmlMapping"/>=0D=0A=0D=0A </= sx:recordContent>=0D=0A=0D=0A =20=0D=0A=0D=0A <sx:flatFile id=3D"ordersFla= tFile">=0D=0A=0D=0A <sx:commentSymbol value=3D"#"/>=0D=0A=0D=0A <sx:f= latFileBody>=0D=0A=0D=0A <sx:flatRecordType id=3D"order">=0D=0A=0D=0A= <sx:fieldDelimiter value=3D","/>=0D=0A=0D=0A <sx:delimited= Field name=3D"ordertype-field" label=3D"OrderType"/>=0D=0A=0D=0A <sx:d= elimitedField name=3D"companyticker-field"=0D=0Alabel=3D"CompanyTicker"/>=0D= =0A=0D=0A <sx:delimitedField name=3D"companyname-field"=0D=0Alabel= =3D"CompanyName"/>=0D=0A=0D=0A <sx:delimitedField name=3D"quantity= -field" label=3D"Quantity"/>=0D=0A=0D=0A </sx:flatRecordType>=0D=0A=0D= =0A </sx:flatFileBody>=0D=0A=0D=0A </sx:flatFile> =20=0D=0A=0D=0A =0D= =0A=0D=0A <sx:recordMapping id=3D"ordersToXmlMapping">=0D=0A=0D=0A <o= rd:orders=0D=0Axmlns:ord=3D"http://mastek.com/demos/servicemixtest/orders"=0D= =0A=0D=0A xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-i= nstance"=0D=0A=0D=0A xsi:schemaLocation=3D"order-record.x= sd">=20=0D=0A=0D=0A <sx:onRecord>=0D=0A=0D=0A <ord:order>=0D=0A=0D= =0A <sx:fieldElementMap field=3D"ordertype-field"=0D=0Aelement=3D"= ord:ordertype"/> =20=0D=0A=0D=0A <sx:fieldElementMap field=3D"comp= anyticker-field"=0D=0Aelement=3D"ord:companyticker"/> =20=0D=0A=0D=0A= <sx:fieldElementMap field=3D"companyname-field"=0D=0Aelement=3D"o= rd:companyname"/> =20=0D=0A=0D=0A <sx:fieldElementMap field=3D"qua= ntity-field"=0D=0Aelement=3D"ord:quantity"/> =20=0D=0A=0D=0A = </ord:order> =20=0D=0A=0D=0A </sx:onRecord>=0D=0A=0D=0A </ord:orde= rs>=0D=0A=0D=0A </sx:recordMapping>=20=0D=0A=0D=0A =20=0D=0A=0D=0A <sx:se= rvice id=3D"orderstocsv" name=3D"orderstocsv">=0D=0A=0D=0A <sx:writeReco= rds>=0D=0A=0D=0A <sx:flatFileWriter>=0D=0A=0D=0A <sx:flatFile r= ef=3D"ordersFlatFile"/>=0D=0A=0D=0A </sx:flatFileWriter>=0D=0A=0D=0A = <sx:xmlRecordReader>=0D=0A=0D=0A <sx:inverseRecordMapping ref=3D= "ordersToCSVMapping"/>=0D=0A=0D=0A <sx:transform>=0D=0A=0D=0A = <sx:document/>=0D=0A=0D=0A </sx:transform>=0D=0A=0D=0A <= /sx:xmlRecordReader>=0D=0A=0D=0A </sx:writeRecords> =20=0D=0A=0D=0A </s= x:service>=0D=0A=0D=0A=20=0D=0A=0D=0A =20=0D=0A=0D=0A <= sx:inverseRecordMapping id=3D"ordersToCSVMapping">=0D=0A=0D=0A <sx:docum= entFragmentMap path=3D"/ord:orders/ord:order">=0D=0A=0D=0A <sx:fragmen= tRecordMap recordType=3D"order">=0D=0A=0D=0A <sx:fragmentFieldMap se= lect=3D"ord:ordertype" field=3D"ordertype"/>=0D=0A=0D=0A <sx:fragmen= tFieldMap select=3D"ord:companyticker"=0D=0Afield=3D"companyticker"/>=0D=0A=0D= =0A <sx:fragmentFieldMap select=3D"ord:companyname"=0D=0Afield=3D"co= mpanyname"/>=0D=0A=0D=0A <sx:fragmentFieldMap select=3D"ord:quantity= " field=3D"quantity"/>=0D=0A=0D=0A </sx:fragmentRecordMap>=0D=0A=0D=0A= </sx:documentFragmentMap>=0D=0A=0D=0A </sx:inverseRecordMapping>=0D=0A=0D= =0A =20=0D=0A=0D=0A</sx:resources>=0D=0A=0D=0A=20=0D=0A=0D= =0AAnd while I am at it my schema definition=0D=0A=0D=0A=20=0D=0A=0D=0A<xsd= :schema xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=0D=0A=0D=0A=20=0D=0A= xmlns:ord=3D"http://mastek.com/demos/servicemixtest/orders"=0D=0A=0D=0A=20=0D= =0AtargetNamespace=3D"http://mastek.com/demos/servicemixtest/orders"=0D=0A=0D= =0A elementFormDefault=3D"unqualified"=0D=0A=0D=0A attr= ibuteFormDefault=3D"unqualified">=0D=0A=0D=0A=20=0D=0A=0D=0A <xsd:annotatio= n>=0D=0A=0D=0A <xsd:documentation xml:lang=3D"en">=0D=0A=0D=0A Order Sen= t record schema=20=0D=0A=0D=0A </xsd:documentation>=0D=0A=0D=0A </xsd:anno= tation>=0D=0A=0D=0A=20=0D=0A=0D=0A <xsd:element name=3D"orders" type=3D"ord= :OrderRecords"/>=0D=0A=0D=0A=20=0D=0A=0D=0A <xsd:complexType name=3D"OrderR= ecords">=0D=0A=0D=0A <xsd:sequence>=0D=0A=0D=0A <xsd:element name=3D"ord= er" type=3D"ord:OrderRecord" minOccurs=3D"0"=0D=0AmaxOccurs=3D"unbounded"/>=0D= =0A=0D=0A </xsd:sequence>=0D=0A=0D=0A </xsd:complexType>=0D=0A=0D=0A=20=0D= =0A=0D=0A <!-- This element's name matches the value of the name attribute = in the=0D=0Apx:flatFileRecordType element. -->=0D=0A=0D=0A <xsd:complexType= name=3D"OrderRecord">=0D=0A=0D=0A <xsd:sequence>=0D=0A=0D=0A <xsd:eleme= nt name=3D"ordertype" type=3D"ord:OrderType"/>=0D=0A=0D=0A <xsd:element n= ame=3D"companyticker" type=3D"ord:CompanyTicker"/>=0D=0A=0D=0A <xsd:eleme= nt name=3D"companyname" type=3D"xsd:string"/>=0D=0A=0D=0A <xsd:element na= me=3D"quantity" type=3D"xsd:integer"/> =20=0D=0A=0D=0A </xsd:sequence>=0D= =0A=0D=0A </xsd:complexType>=0D=0A=0D=0A=20=0D=0A=0D=0A <xsd:simpleType na= me=3D"OrderType">=0D=0A=0D=0A <xsd:restriction base=3D"xsd:string">=0D=0A=0D= =0A <xsd:length value=3D"1" fixed=3D"true"/>=0D=0A=0D=0A </xsd:rest= riction>=0D=0A=0D=0A </xsd:simpleType>=0D=0A=0D=0A =20=0D=0A=0D=0A <xsd:s= impleType name=3D"CompanyTicker">=0D=0A=0D=0A <xsd:restriction base=3D"x= sd:string">=0D=0A=0D=0A <xsd:length value=3D"4" fixed=3D"true"/>=0D=0A=0D= =0A </xsd:restriction>=0D=0A=0D=0A </xsd:simpleType>=0D=0A=0D=0A =20=0D= =0A=0D=0A</xsd:schema>=0D=0A=0D=0A=20=0D=0A=0D=0AAkhil Srinivasan=0D=0A=0D=0A= MASTEK=20=0D=0A"Making a valuable difference"=0D=0AMastek in NASSCOM's 'Ind= ia Top 20' Software Service Exporters List.=0D=0AIn the US, we're called MA= JESCOMASTEK=0D=0A=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions ex= pressed in this e-mail are those of the individual and not that of Mastek L= imited, unless specifically indicated to that effect. Mastek Limited does n= ot accept any responsibility or liability for it. This e-mail and attachmen= ts (if any) transmitted with it are confidential and/or privileged and sole= ly for the use of the intended person or entity to which it is addressed. A= ny review, re-transmission, dissemination or other use of or taking of any = action in reliance upon this information by persons or entities other than = the intended recipient is prohibited. This e-mail and its attachments have = been scanned for the presence of computer viruses. It is the responsibility= of the recipient to run the virus check on e-mails and attachments before = opening them. If you have received this e-mail in error, kindly delete this= e-mail from all computers.=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A |
From: Daniel P. <dan...@sy...> - 2006-02-03 06:09:20
|
Sure. Just declare the prefix ord somewhere in scope, perhaps in the = sx:recordMapping element, and use qualified element names in the mapping = section, e.g. use ord:orders, ord:order, element=3D"ord:ordertype", etc. = Have a look at the resources-books.xml file in the samples. -- Daniel ----- Original Message -----=20 From: Akhil S. Srinivasan=20 To: Daniel Parker=20 Cc: ser...@li...=20 Sent: Friday, February 03, 2006 12:12 AM Subject: RE: [Servingxml-help] Content is notallowed in prolog? Thanks for pointing that out. The main problem that I now have is that = ServingXML generates the data itself. Basically I have a TextMessage coming in containing the initial string = B,AMZN,Amazon Inc,10.0 Which servicingXML converts into the xml block you have seen. This = block has to then be reconverted into the CSV format. =20 I have used this to convert the original CSV into XML =20 <sx:service id=3D"orderstoxml"> <sx:serialize> <sx:transform> <sx:content ref=3D"orders"/>=20 </sx:transform> </sx:serialize> </sx:service> =20 <sx:recordContent id=3D"orders"> <sx:flatFileReader> <!-- Is not need, it does the transform then on anything given <sx:stringSource /> <sx:urlSource url=3D"orders.csv"/>=20 --> <sx:flatFile ref=3D"ordersFlatFile"/> <!-- causes error for some reason <msv:msvRecordFilter schema=3D"order-record.xsd"/> --> </sx:flatFileReader> <sx:recordMapping ref=3D"ordersToXmlMapping"/> </sx:recordContent> =20 <sx:flatFile id=3D"ordersFlatFile"> <sx:commentSymbol value=3D"#"/> <sx:flatFileBody> <sx:flatRecordType id=3D"order"> <sx:fieldDelimiter value=3D","/> <sx:delimitedField name=3D"ordertype-field" = label=3D"OrderType"/> <sx:delimitedField name=3D"companyticker-field" = label=3D"CompanyTicker"/> <sx:delimitedField name=3D"companyname-field" = label=3D"CompanyName"/> <sx:delimitedField name=3D"quantity-field" = label=3D"Quantity"/> </sx:flatRecordType> </sx:flatFileBody> </sx:flatFile> =20 =20 <sx:recordMapping id=3D"ordersToXmlMapping"> <orders> <sx:onRecord> <order> <sx:fieldElementMap field=3D"ordertype-field" = element=3D"ordertype"/> =20 <sx:fieldElementMap field=3D"companyticker-field" = element=3D"companyticker"/> =20 <sx:fieldElementMap field=3D"companyname-field" = element=3D"companyname"/> =20 <sx:fieldElementMap field=3D"quantity-field" = element=3D"quantity"/> =20 </order> =20 </sx:onRecord> </orders> </sx:recordMapping>=20 =20 Is there any way I can force it to add namespace information? =20 Thanks =20 Akhil Srinivasan =20 =20 -------------------------------------------------------------------------= ----- From: Daniel Parker [mailto:dan...@sy...]=20 Sent: Friday, February 03, 2006 10:29 AM To: Akhil S. Srinivasan Subject: Re: [Servingxml-help] Content is notallowed in prolog? =20 Akhil, =20 I attempted to test this at the command line, and noted an = inconsistency between the resources script and the XML input. The = resources script assumes that the elements belong to a namespace, but = the elements in the input have no namespace. =20 If I enclose your resources script definitions with =20 <resources xmlns:sx=3D"http://www.servingxml.com/core" = xmlns:ord=3D"order"> ... </resources>=20 =20 and modify the XML input as follows =20 <?xml version=3D"1.0" encoding=3D"utf-8"?> <ord:orders xmlns:ord=3D"order"> <ord:order> <ord:ordertype>B</ord:ordertype> <ord:companyticker>AMZN</ord:companyticker> <ord:companyname>Amazon Inc</ord:companyname> <ord:quantity>10.0</ord:quantity> </ord:order> </ord:orders> I get the following output =20 B,AMZN,Amazon Inc,10.0 =20 Could you double check that your XML input and resources files are = consistent in your tests with servicemix? =20 Thanks, Daniel=20 ----- Original Message -----=20 From: Akhil S. Srinivasan=20 To: ser...@li...=20 Sent: Thursday, February 02, 2006 8:17 AM Subject: [Servingxml-help] Content is notallowed in prolog? =20 While converting from xmltocsv I get this error =20 [Fatal Error] :1:1: Content is not allowed in prolog. com.servingxml.util.ServingXmlException: Content is not allowed in = prolog. at = com.servingxml.components.xmlpipeline.Pipeline.execute(Pipeline.java:94) at = com.servingxml.components.inverserecordmapping.XmlRecordReader.readRecord= s(XmlRecordReader.java:93) at = com.servingxml.components.recordio.RecordPipeline.execute(RecordPipeline.= java:69) at = com.servingxml.components.recordio.ProcessRecordsAppender.execute(Process= RecordsAppender.java:81) at = com.servingxml.components.service.ServiceImpl.execute(ServiceImpl.java:66= ) at = com.mastek.servicemix.ServingXmlTransformer.toResult(ServingXmlTransforme= r.java:130) at = com.mastek.servicemix.TextSourceMarshaler.asString(TextSourceMarshaler.ja= va:28) =20 the xml block sent is=20 =20 <?xml version=3D"1.0" = encoding=3D"utf-8"?><orders><order><ordertype>B</ordertype><companyticker= >AMZN</companyticker><companyname>Amazon = Inc</companyname><quantity>10.0</quantity></order></orders> =20 In my resource file, I have configured as shown below=20 =20 <sx:service id=3D"orderstocsv" name=3D"orderstocsv"> <sx:writeRecords> <sx:flatFileWriter> <sx:flatFile ref=3D"ordersFlatFile"/> </sx:flatFileWriter> <sx:xmlRecordReader> <sx:inverseRecordMapping ref=3D"ordersToCSVMapping"/> <sx:transform> <sx:document/> </sx:transform> </sx:xmlRecordReader> </sx:writeRecords> =20 </sx:service> =20 =20 <sx:inverseRecordMapping id=3D"ordersToCSVMapping"> <sx:documentFragmentMap path=3D"/ord:orders/ord:order"> <sx:fragmentRecordMap recordType=3D"order"> <sx:fragmentFieldMap select=3D"ord:ordertype" = field=3D"ordertype-field"/> <sx:fragmentFieldMap select=3D"ord:companyticker" = field=3D"companyticker-field"/> <sx:fragmentFieldMap select=3D"ord:companyname" = field=3D"companyname-field"/> <sx:fragmentFieldMap select=3D"ord:quantity" = field=3D"quantity-field"/> </sx:fragmentRecordMap> </sx:documentFragmentMap> </sx:inverseRecordMapping> =20 <sx:flatFile id=3D"ordersFlatFile"> <sx:commentSymbol value=3D"#"/> <sx:flatFileBody> <sx:flatRecordType id=3D"order"> <sx:fieldDelimiter value=3D","/> <sx:delimitedField name=3D"ordertype-field" = label=3D"OrderType"/> <sx:delimitedField name=3D"companyticker-field" = label=3D"CompanyTicker"/> <sx:delimitedField name=3D"companyname-field" = label=3D"CompanyName"/> <sx:delimitedField name=3D"quantity-field" = label=3D"Quantity"/> </sx:flatRecordType> </sx:flatFileBody> </sx:flatFile> =20 =20 Any help would be appreciated? =20 Thank You =20 Akhil Srinivasan =20 MASTEK=20 "Making a valuable difference" Mastek in NASSCOM's 'India Top 20' Software Service Exporters = List. In the US, we're called MAJESCOMASTEK = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Opinions expressed in this e-mail are those of the individual = and not that of Mastek Limited, unless specifically indicated to that = effect. Mastek Limited does not accept any responsibility or liability = for it. This e-mail and attachments (if any) transmitted with it are = confidential and/or privileged and solely for the use of the intended = person or entity to which it is addressed. Any review, re-transmission, = dissemination or other use of or taking of any action in reliance upon = this information by persons or entities other than the intended = recipient is prohibited. This e-mail and its attachments have been = scanned for the presence of computer viruses. It is the responsibility = of the recipient to run the virus check on e-mails and attachments = before opening them. If you have received this e-mail in error, kindly = delete this e-mail from all computers. = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 =20 =20 =20 =20 MASTEK=20 "Making a valuable difference" Mastek in NASSCOM's 'India Top 20' Software Service Exporters = List. In the US, we're called MAJESCOMASTEK = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Opinions expressed in this e-mail are those of the individual = and not that of Mastek Limited, unless specifically indicated to that = effect. Mastek Limited does not accept any responsibility or liability = for it. This e-mail and attachments (if any) transmitted with it are = confidential and/or privileged and solely for the use of the intended = person or entity to which it is addressed. Any review, re-transmission, = dissemination or other use of or taking of any action in reliance upon = this information by persons or entities other than the intended = recipient is prohibited. This e-mail and its attachments have been = scanned for the presence of computer viruses. It is the responsibility = of the recipient to run the virus check on e-mails and attachments = before opening them. If you have received this e-mail in error, kindly = delete this e-mail from all computers. = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 |
From: Akhil S. S. <ak...@ma...> - 2006-02-03 05:21:13
|
Thanks for pointing that out. The main problem that I now have is that=0D=0A= ServingXML generates the data itself.=0D=0A=0D=0ABasically I have a TextMes= sage coming in containing the initial string=0D=0AB,AMZN,Amazon Inc,10.0=0D= =0A=0D=0AWhich servicingXML converts into the xml block you have seen. This= block=0D=0Ahas to then be reconverted into the CSV format.=0D=0A=0D=0A=20=0D= =0A=0D=0AI have used this to convert the original CSV into XML=0D=0A=0D=0A =0D= =0A=0D=0A <sx:service id=3D"orderstoxml">=0D=0A=0D=0A <sx:serialize>=0D= =0A=0D=0A <sx:transform>=0D=0A=0D=0A <sx:content ref=3D"orders"= />=20=0D=0A=0D=0A </sx:transform>=0D=0A=0D=0A </sx:serialize>=0D=0A=0D= =0A </sx:service>=0D=0A=0D=0A=20=0D=0A=0D=0A <sx:recordContent id=3D"orde= rs">=0D=0A=0D=0A <sx:flatFileReader>=0D=0A=0D=0A <!-- Is not need, = it does the transform then on anything given=0D=0A=0D=0A <sx:str= ingSource />=0D=0A=0D=0A <sx:urlSource url=3D"orders.csv"/>=20=0D= =0A=0D=0A -->=0D=0A=0D=0A <sx:flatFile ref=3D"ordersFlatFile"/>=0D= =0A=0D=0A <!-- causes error for some reason=0D=0A=0D=0A <ms= v:msvRecordFilter schema=3D"order-record.xsd"/>=0D=0A=0D=0A -->=0D=0A=0D= =0A </sx:flatFileReader>=0D=0A=0D=0A <sx:recordMapping ref=3D"ordersT= oXmlMapping"/>=0D=0A=0D=0A </sx:recordContent>=0D=0A=0D=0A =20=0D=0A=0D=0A= <sx:flatFile id=3D"ordersFlatFile">=0D=0A=0D=0A <sx:commentSymbol valu= e=3D"#"/>=0D=0A=0D=0A <sx:flatFileBody>=0D=0A=0D=0A <sx:flatRecor= dType id=3D"order">=0D=0A=0D=0A <sx:fieldDelimiter value=3D","/>=0D=0A=0D= =0A <sx:delimitedField name=3D"ordertype-field" label=3D"OrderType= "/>=0D=0A=0D=0A <sx:delimitedField name=3D"companyticker-field"=0D=0Al= abel=3D"CompanyTicker"/>=0D=0A=0D=0A <sx:delimitedField name=3D"co= mpanyname-field"=0D=0Alabel=3D"CompanyName"/>=0D=0A=0D=0A <sx:deli= mitedField name=3D"quantity-field" label=3D"Quantity"/>=0D=0A=0D=0A = </sx:flatRecordType>=0D=0A=0D=0A </sx:flatFileBody>=0D=0A=0D=0A </sx:fl= atFile> =20=0D=0A=0D=0A=20=0D=0A=0D=0A <sx:recordMapping id=3D"ordersT= oXmlMapping">=0D=0A=0D=0A <orders>=0D=0A=0D=0A <sx:onRecord>=0D=0A=0D= =0A <order>=0D=0A=0D=0A <sx:fieldElementMap field=3D"ordert= ype-field"=0D=0Aelement=3D"ordertype"/> =20=0D=0A=0D=0A <sx:fieldE= lementMap field=3D"companyticker-field"=0D=0Aelement=3D"companyticker"/> = =20=0D=0A=0D=0A <sx:fieldElementMap field=3D"companyname-fie= ld"=0D=0Aelement=3D"companyname"/> =20=0D=0A=0D=0A <sx:fieldElemen= tMap field=3D"quantity-field"=0D=0Aelement=3D"quantity"/> =20=0D=0A=0D= =0A </order> =20=0D=0A=0D=0A </sx:onRecord>=0D=0A=0D=0A </or= ders>=0D=0A=0D=0A </sx:recordMapping>=20=0D=0A=0D=0A=20=0D=0A=0D=0AIs ther= e any way I can force it to add namespace information=3F=0D=0A=0D=0A=20=0D=0A=0D= =0AThanks=0D=0A=0D=0A=20=0D=0A=0D=0AAkhil Srinivasan=0D=0A=0D=0A=20=0D=0A=0D= =0A=20=0D=0A=0D=0A _____ =20=0D=0A=0D=0AFrom: Daniel Parker [mailto:daniel= ap...@sy...]=20=0D=0ASent: Friday, February 03, 2006 10:29 AM=0D=0A= To: Akhil S. Srinivasan=0D=0ASubject: Re: [Servingxml-help] Content is nota= llowed in prolog=3F=0D=0A=0D=0A=20=0D=0A=0D=0AAkhil,=0D=0A=0D=0A=20=0D=0A=0D= =0AI attempted to test this at the command line, and noted an inconsistency=0D= =0Abetween the resources script and the XML input. The resources script=0D= =0Aassumes that the elements belong to a namespace, but the elements in the=0D= =0Ainput have no namespace.=0D=0A=0D=0A=20=0D=0A=0D=0AIf I enclose your res= ources script definitions with=0D=0A=0D=0A=20=0D=0A=0D=0A<resources xmlns:s= x=3D"http://www.servingxml.com/core" xmlns:ord=3D"order">=0D=0A=0D=0A...=0D= =0A</resources>=20=0D=0A=0D=0A=20=0D=0A=0D=0Aand modify the XML input as fo= llows=0D=0A=0D=0A=20=0D=0A=0D=0A<=3Fxml version=3D"1.0" encoding=3D"utf-8"=3F= >=0D=0A<ord:orders xmlns:ord=3D"order">=0D=0A <ord:order>=0D=0A <ord:or= dertype>B</ord:ordertype>=0D=0A <ord:companyticker>AMZN</ord:companytick= er>=0D=0A <ord:companyname>Amazon Inc</ord:companyname>=0D=0A <ord:qu= antity>10.0</ord:quantity>=0D=0A </ord:order>=0D=0A</ord:orders>=0D=0A=0D=0A= I get the following output=0D=0A=0D=0A=20=0D=0A=0D=0AB,AMZN,Amazon Inc,10.0=0D= =0A=0D=0A=20=0D=0A=0D=0ACould you double check that your XML input and reso= urces files are=0D=0Aconsistent in your tests with servicemix=3F=0D=0A=0D=0A= =20=0D=0A=0D=0AThanks,=0D=0A=0D=0ADaniel=20=0D=0A=0D=0A=09----- Original Me= ssage -----=20=0D=0A=0D=0A=09From: Akhil S. Srinivasan <mailto:akhilss@mast= ek.com> =20=0D=0A=0D=0A=09To: ser...@li...=20=0D=0A=0D= =0A=09Sent: Thursday, February 02, 2006 8:17 AM=0D=0A=0D=0A=09Subject: [Ser= vingxml-help] Content is notallowed in prolog=3F=0D=0A=0D=0A=09=20=0D=0A=0D= =0A=09While converting from xmltocsv I get this error=0D=0A=0D=0A=09=20=0D=0A=0D= =0A=09[Fatal Error] :1:1: Content is not allowed in prolog.=0D=0A=0D=0A=09c= om.servingxml.util.ServingXmlException: Content is not allowed=0D=0Ain prol= og.=0D=0A=0D=0A=09 at=0D=0Acom.servingxml.components.xmlpipeline.Pip= eline.execute(Pipeline.java:94)=0D=0A=0D=0A=09 at=0D=0Acom.servingxm= l.components.inverserecordmapping.XmlRecordReader.readRecor=0D=0Ads(XmlReco= rdReader.java:93)=0D=0A=0D=0A=09 at=0D=0Acom.servingxml.components.r= ecordio.RecordPipeline.execute(RecordPipeline=0D=0A.java:69)=0D=0A=0D=0A=09= at=0D=0Acom.servingxml.components.recordio.ProcessRecordsAppender.e= xecute(Proces=0D=0AsRecordsAppender.java:81)=0D=0A=0D=0A=09 at=0D=0A= com.servingxml.components.service.ServiceImpl.execute(ServiceImpl.java:6=0D= =0A6)=0D=0A=0D=0A=09 at=0D=0Acom.mastek.servicemix.ServingXmlTransfo= rmer.toResult(ServingXmlTransform=0D=0Aer.java:130)=0D=0A=0D=0A=09 a= t=0D=0Acom.mastek.servicemix.TextSourceMarshaler.asString(TextSourceMarshal= er.j=0D=0Aava:28)=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09the xml block sent is=20=0D= =0A=0D=0A=09=20=0D=0A=0D=0A=09<=3Fxml version=3D"1.0"=0D=0Aencoding=3D"utf-= 8"=3F><orders><order><ordertype>B</ordertype><companyticker>=0D=0AAMZN</com= panyticker><companyname>Amazon=0D=0AInc</companyname><quantity>10.0</quanti= ty></order></orders>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09In my resource file, I= have configured as shown below=20=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <sx:se= rvice id=3D"orderstocsv" name=3D"orderstocsv">=0D=0A=0D=0A=09 <sx:writeR= ecords>=0D=0A=0D=0A=09 <sx:flatFileWriter>=0D=0A=0D=0A=09 <sx:f= latFile ref=3D"ordersFlatFile"/>=0D=0A=0D=0A=09 </sx:flatFileWriter>=0D= =0A=0D=0A=09 <sx:xmlRecordReader>=0D=0A=0D=0A=09 <sx:inverseRec= ordMapping ref=3D"ordersToCSVMapping"/>=0D=0A=0D=0A=09 <sx:transform= >=0D=0A=0D=0A=09 <sx:document/>=0D=0A=0D=0A=09 </sx:tra= nsform>=0D=0A=0D=0A=09 </sx:xmlRecordReader>=0D=0A=0D=0A=09 </sx:wr= iteRecords> =20=0D=0A=0D=0A=09 </sx:service>=0D=0A=0D=0A=09=20=0D=0A=0D=0A= =09 =20=0D=0A=0D=0A=09 <sx:inverseRecordMapping id=3D"o= rdersToCSVMapping">=0D=0A=0D=0A=09 <sx:documentFragmentMap path=3D"/ord:= orders/ord:order">=0D=0A=0D=0A=09 <sx:fragmentRecordMap recordType=3D"= order">=0D=0A=0D=0A=09 <sx:fragmentFieldMap select=3D"ord:ordertype"=0D= =0Afield=3D"ordertype-field"/>=0D=0A=0D=0A=09 <sx:fragmentFieldMap s= elect=3D"ord:companyticker"=0D=0Afield=3D"companyticker-field"/>=0D=0A=0D=0A= =09 <sx:fragmentFieldMap select=3D"ord:companyname"=0D=0Afield=3D"co= mpanyname-field"/>=0D=0A=0D=0A=09 <sx:fragmentFieldMap select=3D"ord= :quantity"=0D=0Afield=3D"quantity-field"/>=0D=0A=0D=0A=09 </sx:fragmen= tRecordMap>=0D=0A=0D=0A=09 </sx:documentFragmentMap>=0D=0A=0D=0A=09 </s= x:inverseRecordMapping>=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09 <sx:flatFile id=3D= "ordersFlatFile">=0D=0A=0D=0A=09 <sx:commentSymbol value=3D"#"/>=0D=0A=0D= =0A=09 <sx:flatFileBody>=0D=0A=0D=0A=09 <sx:flatRecordType id=3D"= order">=0D=0A=0D=0A=09 <sx:fieldDelimiter value=3D","/>=0D=0A=0D=0A=09= <sx:delimitedField name=3D"ordertype-field"=0D=0Alabel=3D"OrderTy= pe"/>=0D=0A=0D=0A=09 <sx:delimitedField name=3D"companyticker-field"=0D= =0Alabel=3D"CompanyTicker"/>=0D=0A=0D=0A=09 <sx:delimitedField nam= e=3D"companyname-field"=0D=0Alabel=3D"CompanyName"/>=0D=0A=0D=0A=09 = <sx:delimitedField name=3D"quantity-field"=0D=0Alabel=3D"Quantity"/>=0D=0A=0D= =0A=09 </sx:flatRecordType>=0D=0A=0D=0A=09 </sx:flatFileBody>=0D=0A=0D= =0A=09 </sx:flatFile> =20=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09Any help wou= ld be appreciated=3F=0D=0A=0D=0A=09=20=0D=0A=0D=0A=09Thank You=0D=0A=0D=0A=09= =20=0D=0A=0D=0A=09Akhil Srinivasan=0D=0A=0D=0A=09=20=0D=0A=0D=0A=0D=0AMASTE= K=20=0D=0A"Making a valuable difference"=0D=0AMastek in NASSCOM's 'India To= p 20' Software Service Exporters List.=0D=0AIn the US, we're called MAJESCO= MASTEK=0D=0A=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions e= xpressed in this e-mail are those of the individual and not=0D=0Athat of Ma= stek Limited, unless specifically indicated to that effect.=0D=0AMastek Lim= ited does not accept any responsibility or liability for it.=0D=0AThis e-ma= il and attachments (if any) transmitted with it are=0D=0Aconfidential and/o= r privileged and solely for the use of the intended=0D=0Aperson or entity t= o which it is addressed. Any review, re-transmission,=0D=0Adissemination or= other use of or taking of any action in reliance upon=0D=0Athis informatio= n by persons or entities other than the intended=0D=0Arecipient is prohibit= ed. This e-mail and its attachments have been=0D=0Ascanned for the presence= of computer viruses. It is the responsibility=0D=0Aof the recipient to run= the virus check on e-mails and attachments=0D=0Abefore opening them. If yo= u have received this e-mail in error, kindly=0D=0Adelete this e-mail from a= ll computers.=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A=0D=0A =0D= =0A=0D=0A=20=0D=0A=0D=0A=20=0D=0A=0D=0AMASTEK=20=0D=0A"Making a valuable di= fference"=0D=0AMastek in NASSCOM's 'India Top 20' Software Service Exporter= s List.=0D=0AIn the US, we're called MAJESCOMASTEK=0D=0A=0D=0A~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions expressed in this e-mail are those of = the individual and not that of Mastek Limited, unless specifically indicate= d to that effect. Mastek Limited does not accept any responsibility or liab= ility for it. This e-mail and attachments (if any) transmitted with it are = confidential and/or privileged and solely for the use of the intended perso= n or entity to which it is addressed. Any review, re-transmission, dissemin= ation or other use of or taking of any action in reliance upon this informa= tion by persons or entities other than the intended recipient is prohibited= =2E This e-mail and its attachments have been scanned for the presence of c= omputer viruses. It is the responsibility of the recipient to run the virus= check on e-mails and attachments before opening them. If you have received= this e-mail in error, kindly delete this e-mail from all computers.=0D=0A~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A |
From: Akhil S. S. <ak...@ma...> - 2006-02-02 13:20:31
|
While converting from xmltocsv I get this error=0D=0A=0D=0A=20=0D=0A=0D=0A[= Fatal Error] :1:1: Content is not allowed in prolog.=0D=0A=0D=0Acom.serving= xml.util.ServingXmlException: Content is not allowed in=0D=0Aprolog.=0D=0A=0D= =0A at=0D=0Acom.servingxml.components.xmlpipeline.Pipeline.execute(P= ipeline.java:94)=0D=0A=0D=0A at=0D=0Acom.servingxml.components.inver= serecordmapping.XmlRecordReader.readRecor=0D=0Ads(XmlRecordReader.java:93)=0D= =0A=0D=0A at=0D=0Acom.servingxml.components.recordio.RecordPipeline.= execute(RecordPipeline=0D=0A.java:69)=0D=0A=0D=0A at=0D=0Acom.servin= gxml.components.recordio.ProcessRecordsAppender.execute(Proces=0D=0AsRecord= sAppender.java:81)=0D=0A=0D=0A at=0D=0Acom.servingxml.components.ser= vice.ServiceImpl.execute(ServiceImpl.java:6=0D=0A6)=0D=0A=0D=0A at=0D= =0Acom.mastek.servicemix.ServingXmlTransformer.toResult(ServingXmlTransform=0D= =0Aer.java:130)=0D=0A=0D=0A at=0D=0Acom.mastek.servicemix.TextSource= Marshaler.asString(TextSourceMarshaler.j=0D=0Aava:28)=0D=0A=0D=0A=20=0D=0A=0D= =0Athe xml block sent is=20=0D=0A=0D=0A=20=0D=0A=0D=0A<=3Fxml version=3D"1.= 0"=0D=0Aencoding=3D"utf-8"=3F><orders><order><ordertype>B</ordertype><compa= nyticker>=0D=0AAMZN</companyticker><companyname>Amazon=0D=0AInc</companynam= e><quantity>10.0</quantity></order></orders>=0D=0A=0D=0A=20=0D=0A=0D=0AIn m= y resource file, I have configured as shown below=20=0D=0A=0D=0A=20=0D=0A=0D= =0A <sx:service id=3D"orderstocsv" name=3D"orderstocsv">=0D=0A=0D=0A <s= x:writeRecords>=0D=0A=0D=0A <sx:flatFileWriter>=0D=0A=0D=0A <sx= :flatFile ref=3D"ordersFlatFile"/>=0D=0A=0D=0A </sx:flatFileWriter>=0D= =0A=0D=0A <sx:xmlRecordReader>=0D=0A=0D=0A <sx:inverseRecordMap= ping ref=3D"ordersToCSVMapping"/>=0D=0A=0D=0A <sx:transform>=0D=0A=0D= =0A <sx:document/>=0D=0A=0D=0A </sx:transform>=0D=0A=0D= =0A </sx:xmlRecordReader>=0D=0A=0D=0A </sx:writeRecords> =20=0D=0A=0D= =0A </sx:service>=0D=0A=0D=0A=20=0D=0A=0D=0A =20=0D=0A=0D= =0A <sx:inverseRecordMapping id=3D"ordersToCSVMapping">=0D=0A=0D=0A <sx= :documentFragmentMap path=3D"/ord:orders/ord:order">=0D=0A=0D=0A <sx:f= ragmentRecordMap recordType=3D"order">=0D=0A=0D=0A <sx:fragmentField= Map select=3D"ord:ordertype"=0D=0Afield=3D"ordertype-field"/>=0D=0A=0D=0A = <sx:fragmentFieldMap select=3D"ord:companyticker"=0D=0Afield=3D"compa= nyticker-field"/>=0D=0A=0D=0A <sx:fragmentFieldMap select=3D"ord:com= panyname"=0D=0Afield=3D"companyname-field"/>=0D=0A=0D=0A <sx:fragmen= tFieldMap select=3D"ord:quantity"=0D=0Afield=3D"quantity-field"/>=0D=0A=0D=0A= </sx:fragmentRecordMap>=0D=0A=0D=0A </sx:documentFragmentMap>=0D=0A=0D= =0A </sx:inverseRecordMapping>=0D=0A=0D=0A=20=0D=0A=0D=0A <sx:flatFile id= =3D"ordersFlatFile">=0D=0A=0D=0A <sx:commentSymbol value=3D"#"/>=0D=0A=0D= =0A <sx:flatFileBody>=0D=0A=0D=0A <sx:flatRecordType id=3D"order"= >=0D=0A=0D=0A <sx:fieldDelimiter value=3D","/>=0D=0A=0D=0A = <sx:delimitedField name=3D"ordertype-field" label=3D"OrderType"/>=0D=0A=0D=0A= <sx:delimitedField name=3D"companyticker-field"=0D=0Alabel=3D"Company= Ticker"/>=0D=0A=0D=0A <sx:delimitedField name=3D"companyname-field= "=0D=0Alabel=3D"CompanyName"/>=0D=0A=0D=0A <sx:delimitedField name= =3D"quantity-field" label=3D"Quantity"/>=0D=0A=0D=0A </sx:flatRecord= Type>=0D=0A=0D=0A </sx:flatFileBody>=0D=0A=0D=0A </sx:flatFile> =0D= =0A=0D=0A=20=0D=0A=0D=0AAny help would be appreciated=3F=0D=0A=0D=0A=20=0D=0A=0D= =0AThank You=0D=0A=0D=0A=20=0D=0A=0D=0AAkhil Srinivasan=0D=0A=0D=0AMASTEK =0D= =0A"Making a valuable difference"=0D=0AMastek in NASSCOM's 'India Top 20' S= oftware Service Exporters List.=0D=0AIn the US, we're called MAJESCOMASTEK=0D= =0A=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions expressed in thi= s e-mail are those of the individual and not that of Mastek Limited, unless= specifically indicated to that effect. Mastek Limited does not accept any = responsibility or liability for it. This e-mail and attachments (if any) tr= ansmitted with it are confidential and/or privileged and solely for the use= of the intended person or entity to which it is addressed. Any review, re-= transmission, dissemination or other use of or taking of any action in reli= ance upon this information by persons or entities other than the intended r= ecipient is prohibited. This e-mail and its attachments have been scanned f= or the presence of computer viruses. It is the responsibility of the recipi= ent to run the virus check on e-mails and attachments before opening them. = If you have received this e-mail in error, kindly delete this e-mail from a= ll computers.=0D=0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A |
From: Akhil S. S. <ak...@ma...> - 2006-02-02 13:01:10
|
Hi=0D=0A=0D=0AI am having a problem with the CVS to XML transformation. The= ServingXml=0D=0Acomponent is embedded inside a JBI container called Servic= eMix. On=0D=0Areceiving a string=0D=0A=0D=0AIt tries to convert it into xml= =2E While no error is throw, the=0D=0Atransformation is not happening eithe= r.=0D=0A=0D=0AThe code snippet=20=0D=0A=0D=0A=20=0D=0A=0D=0AServingXMLTrans= former.java=0D=0A=0D=0A=20=0D=0A=0D=0A public Source toSource(St= ring text)=0D=0A=0D=0A {=0D=0A=0D=0A Sour= ce source =3D null;=0D=0A=0D=0A try=0D=0A=0D=0A = {=0D=0A=0D=0A AppCont= ext appContext =3D new=0D=0ADefaultAppContext(APPLICATION_NAME,=20=0D=0A=0D= =0A=20=0D=0Adriver.getResources(), driver.getNameTable());=0D=0A=0D=0A = ServiceContext serviceContext =3D new=0D=0AD= efaultServiceContext(appContext, "servingxml");=0D=0A=0D=0A = =20=0D=0A=0D=0A Name = serviceName =3D=0D=0AName.parse(serviceContext, SERVICE_SOURCE_NAME);=0D=0A=0D= =0A =20=0D=0A=0D=0A = StreamSource defaultStreamSource =3D=0D=0Anew StringStreamSou= rce(text);=0D=0A=0D=0A ByteArrayOutputSt= ream boss =3D new=0D=0AByteArrayOutputStream();=0D=0A=0D=0A = StreamSink defaultStreamSink =3D new=0D=0AOutputStreamS= inkAdaptor(boss);=0D=0A=0D=0A =20=0D=0A=0D= =0A Flow flow =3D new=0D=0AFlowImpl(def= aultStreamSource, defaultStreamSink);=0D=0A=0D=0A = =20=0D=0A=0D=0A RecordBuilder r= ecordBuilder =3D new=0D=0ARecordBuilder(SystemConstants.PARAMETERS_TYPE_NAM= E);=0D=0A=0D=0A // Add some parameters,= if any =20=0D=0A=0D=0A Record parameter= s =3D=0D=0ArecordBuilder.toRecord();=0D=0A=0D=0A = =20=0D=0A=0D=0A Service service = =3D=0D=0A(Service)appContext.getResources().lookupServiceComponent(Service.= class,=0D=0AserviceName);=0D=0A=0D=0A if= (service =3D=3D null) {=0D=0A=0D=0A = throw new=0D=0AServingXmlException("Cannot find service " + servic= eName);=0D=0A=0D=0A }=0D=0A=0D=0A = service.execute(serviceContext,=0D=0Aparameter= s, flow);=0D=0A=0D=0A =20=0D=0A=0D=0A = boss.flush();=0D=0A=0D=0A = source =3D new=0D=0ABytesSource(boss.toByteArray());=0D=0A=0D= =0A }catch(ServingXmlException sxe)=0D=0A=0D=0A = {=0D=0A=0D=0A sxe.pri= ntStackTrace();=0D=0A=0D=0A }=0D=0A=0D=0A = catch(IOException ioe)=0D=0A=0D=0A {=0D= =0A=0D=0A ioe.printStackTrace();=0D=0A=0D= =0A }=0D=0A=0D=0A =20=0D=0A=0D= =0A return source;=0D=0A=0D=0A }=0D=0A=0D= =0A=20=0D=0A=0D=0AIs supposed to turn "b,amzn,Amazon,10" into xml, while th= e transform=0D=0Aworks if I point it to a file source, when I use this xml = config,=0D=0Anothing happens=0D=0A=0D=0A=20=0D=0A=0D=0A <sx:service id=3D"= orderstoxml">=0D=0A=0D=0A <sx:serialize>=0D=0A=0D=0A <sx:transform>=0D= =0A=0D=0A <sx:content ref=3D"orders"/>=20=0D=0A=0D=0A </sx:tran= sform>=0D=0A=0D=0A </sx:serialize>=0D=0A=0D=0A </sx:service>=0D=0A=0D=0A= =20=0D=0A=0D=0A <sx:recordContent id=3D"orders">=0D=0A=0D=0A <sx:flatFi= leReader>=0D=0A=0D=0A <sx:stringSource />=0D=0A=0D=0A <!-- <sx:ur= lSource url=3D"orders.csv"/> -->=0D=0A=0D=0A <sx:flatFile ref=3D"order= sFlatFile"/>=0D=0A=0D=0A <!--<msv:msvRecordFilter schema=3D"order-reco= rd.xsd"/>-->=0D=0A=0D=0A </sx:flatFileReader>=0D=0A=0D=0A <sx:recordM= apping ref=3D"ordersToXmlMapping"/>=0D=0A=0D=0A </sx:recordContent>=0D=0A=0D= =0A =20=0D=0A=0D=0A <sx:flatFile id=3D"ordersFlatFile">=0D=0A=0D=0A <sx= :commentSymbol value=3D"#"/>=0D=0A=0D=0A <sx:flatFileBody>=0D=0A=0D=0A = <sx:flatRecordType id=3D"order">=0D=0A=0D=0A <sx:fieldDelimite= r value=3D","/>=0D=0A=0D=0A <sx:delimitedField name=3D"ordertype-f= ield" label=3D"OrderType"/>=0D=0A=0D=0A <sx:delimitedField name=3D"com= panyticker-field"=0D=0Alabel=3D"CompanyTicker"/>=0D=0A=0D=0A <sx:d= elimitedField name=3D"companyname-field"=0D=0Alabel=3D"CompanyName"/>=0D=0A=0D= =0A <sx:delimitedField name=3D"quantity-field" label=3D"Quantity"/= >=0D=0A=0D=0A </sx:flatRecordType>=0D=0A=0D=0A </sx:flatFileBody>=0D= =0A=0D=0A </sx:flatFile> =20=0D=0A=0D=0A=20=0D=0A=0D=0A <sx:recordMap= ping id=3D"ordersToXmlMapping">=0D=0A=0D=0A <orders>=0D=0A=0D=0A <s= x:onRecord>=0D=0A=0D=0A <order>=0D=0A=0D=0A <sx:fieldElemen= tMap field=3D"ordertype-field"=0D=0Aelement=3D"ordertype"/> =20=0D=0A=0D=0A= <sx:fieldElementMap field=3D"companyticker-field"=0D=0Aelement=3D= "companyticker"/> =20=0D=0A=0D=0A <sx:fieldElementMap fiel= d=3D"companyname-field"=0D=0Aelement=3D"companyname"/> =20=0D=0A=0D=0A = <sx:fieldElementMap field=3D"quantity-field"=0D=0Aelement=3D"quantity"= /> =20=0D=0A=0D=0A </order> =20=0D=0A=0D=0A </sx:onReco= rd>=0D=0A=0D=0A </orders>=0D=0A=0D=0A </sx:recordMapping>=20=0D=0A=0D=0A= =20=0D=0A=0D=0AAppreciate any pointer on what might be the problem.=0D=0A=0D= =0A=20=0D=0A=0D=0AThanks=20=0D=0A=0D=0AAkhil Srinivasan=0D=0A=0D=0A=20=0D=0A=0D= =0A=20=0D=0A=0D=0A =20=0D=0A=0D=0AMASTEK=20=0D=0A"Making a valuab= le difference"=0D=0AMastek in NASSCOM's 'India Top 20' Software Service Exp= orters List.=0D=0AIn the US, we're called MAJESCOMASTEK=0D=0A=0D=0A~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0AOpinions expressed in this e-mail are thos= e of the individual and not that of Mastek Limited, unless specifically ind= icated to that effect. Mastek Limited does not accept any responsibility or= liability for it. This e-mail and attachments (if any) transmitted with it= are confidential and/or privileged and solely for the use of the intended = person or entity to which it is addressed. Any review, re-transmission, dis= semination or other use of or taking of any action in reliance upon this in= formation by persons or entities other than the intended recipient is prohi= bited. This e-mail and its attachments have been scanned for the presence o= f computer viruses. It is the responsibility of the recipient to run the vi= rus check on e-mails and attachments before opening them. If you have recei= ved this e-mail in error, kindly delete this e-mail from all computers.=0D=0A= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=0D=0A |
From: Daniel P. <dan...@sy...> - 2006-01-23 01:59:07
|
Anton, Thanks for reporting this. This has been fixed in version 0.3.4, see the books example. -- Daniel ----- Original Message ----- From: "Anton Melumad" <ame...@ya...> To: <dan...@us...> Sent: Thursday, January 19, 2006 3:13 AM Subject: Schema location attribute > Daniel, > > First of all, thanks for the ServingXML - great work, seems to be very > flexible > and powerful. > > I have one question though. What are the correct instructions that I > should > put in resources*.xml in order to have the xsi:schemaLocation attribute in > the > root element of my output XML? I.e. I need to produce an XML like that: > > <?xml version="1.0" encoding="UTF-8"?> > <myNamespace:tag xmlns:myNamespace="url1" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="url2"> > ... > </myNamespace:tag> > > I put the xmlns:myNamespace="url1" attribute in the sx:resources element > and > the xmlns:xsi and xsi:schemaLocation atributes into my record mapping > section, > i.e. > > <sx:resources xmlns:sx="http://www.servingxml.com/core" > xmlns:css="url1"> > > > <sx:recordMapping id="recordsToXmlMapping"> > <myNamespace:tag xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="url2"> > > I get the following output: > > xmlns:ymNamespace="url1" xmlns:xmlns="url1" xmlns:xsi="url1" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="url2" > > I am using Serving XML version 0.3.3. > > Thank you in advance, > Anton > > > > ___________________________________________________________ > To help you stay safe and secure online, we've developed the all new > Yahoo! Security Centre. http://uk.security.yahoo.com > |