Thread: RE: [Servingxml-help] Content is notallowed in prolog?
Brought to you by:
danielaparker
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-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-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-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: 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: 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: 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 |