Also, if you have an element node, you can use the fn:string function to get the string value of the node. Then you can call fn:replace on that.
-Danny -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Geert Josten Sent: Monday, April 12, 2010 6:19 AM To: General Mark Logic Developer Discussion Subject: RE: [MarkLogic Dev General] How to strip off invalid xml charactersusing XQuery? Hi Arindam, Yes, replace expects a string as input. Not sure how you read your files from filesystem, but assuming you are using xdmp:document-get, have you tried setting the repair option to 'full'? You could also try to apply xdmp:tidy to your documents, but that could have other side effects as well, so test on that well.. Kind regards, Geert > drs. G.P.H. (Geert) Josten Consultant Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 mailto:[email protected] http://www.daidalos.nl/ KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Arindam Chatterjee > Sent: maandag 12 april 2010 7:21 > To: [email protected] > Subject: Re: [MarkLogic Dev General] How to strip off invalid > xml characters using XQuery? > > Hi, > > I guess this function requires a string input, but what I > have is an element node. I am not sure if this will work, or > if there is any way to typecast the existing element node into string. > > Any input? > > Regards, > Arindam > > ________________________________ > > From: Nuno Job <[email protected]> > To: [email protected] > Sent: Sun, 11 April, 2010 7:14:51 AM > Subject: Re: [MarkLogic Dev General] How to strip off invalid > xml characters using XQuery? > > fn:replace($quoted-string, "&#(\w)+;", "") > > > On Thu, Apr 8, 2010 at 10:26 PM, Arindam Chatterjee > <[email protected]> wrote: > > > "" > > > > ________________________________ > > Your Mail works best with the New Yahoo Optimized IE8. Get it > NOW! > <http://in.rd.yahoo.com/tagline_ie8_new/*http://downloads.yaho > o.com/in/internetexplorer/> . > > ________________________________ > > Your Mail works best with the New Yahoo Optimized IE8. Get it > NOW! > <http://in.rd.yahoo.com/tagline_ie8_new/*http://downloads.yaho > o.com/in/internetexplorer/> . > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
