Hence the reason to leverage a parser, the hard work is done for you. I'd suggest to the downstream team that the XML is well-formed and should parse just fine. Alternatively you could include code to pass the generated XML through something like Apache Commons Lang's StringEscapeUtils to encode the string.
On Wed, Aug 24, 2011 at 11:37 AM, Matthew Carlson <[email protected]> wrote: > I had to google this, because I couldn't believe it. > http://www.w3.org/TR/xml/#syntax > > I alwasys assumed you could not have a raw '<' or '>' anywhere, but the > spec says you are allowed to have '>' in normal text fields > > '&' and '<' MUST be escaped, but '>' is OK > > > > > On Wed, Aug 24, 2011 at 9:05 AM, Papendieck, Thomas < > [email protected]> wrote: > >> Hi Dave, >> >> I'm not sure but it sounded like they'r building their own parser... >> >> bye >> Thomas >> >> *Von:* David Read [[email protected]] >> *Gesendet:* Mittwoch, 24. August 2011 15:44 >> >> *Bis:* [email protected] >> *Betreff:* Re: [castor-user] XML entity encoding >> >> Thomas, >> >> Perhaps the other team isn't using a parser? If they are looking for >> tokens directly it would be a problem. An XML parser shouldn't struggle >> with that situation. Do you know how they are consuming your XML output? >> >> Regards, >> >> Dave >> >> On Wed, Aug 24, 2011 at 3:09 AM, Papendieck, Thomas < >> [email protected]> wrote: >> >>> Hallo Werner, >>> >>> > What does your Xml actually look like ? >>> When I invoke >>> object.setDescription("Pressure difference to keep vehicle stable --> >>> Offset for rear axle"); >>> >>> I get >>> <Description>Pressure difference to keep vehicle stable --> Offset for >>> rear axle</Description> >>> >>> Some other team processing this xml later in the process complains that >>> they have problems to decide if '-->' is just an arrow or the end of a >>> previous opened comment. >>> >>> bye >>> Thomas >>> >>> ________________________________________ >>> Von: Werner Guttmann [[email protected]] >>> Gesendet: Dienstag, 23. August 2011 21:51 >>> Bis: [email protected] >>> Cc: Papendieck, Thomas >>> Betreff: Re: [castor-user] XML entity encoding >>> >>> Hi, >>> >>> that's actually not Casto's job to do. Internally, Castor relies on >>> Xerces XML serializing capabilities, so there's no way to 'force things'. >>> >>> What does your Xml actually look like ? >>> >>> Cheers >>> Werner >>> >>> On 22.08.2011 20:59, Papendieck, Thomas wrote: >>> > Hi, >>> > >>> > how do I force castor-xml to convert e.g. '>' into '>' in content >>> of text nodes? >>> > >>> > bye >>> > Thomas >>> > >>> > --------------------------------------------------------------------- >>> > To unsubscribe from this list, please visit: >>> > >>> > http://xircles.codehaus.org/manage_email >>> > >>> > >>> > >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >>> >>> >> >> >> -- >> David S. Read >> CTO >> *CISSP, GIAC/GSEC, RHCE, SCJP >> *Blue Slate Solutions >> 39 Columbia St. >> Albany, NY 12207 >> 518-810-0368 >> www.blueslate.net >> >> This e-mail and any files transmitted with it are for the sole use of Blue >> Slate Solutions >> and the intended recipient(s) and may contain confidential and privileged >> information. >> If you are not the intended recipient, please contact the sender by reply >> e-mail and >> destroy all copies of the original message. Any unauthorized review, use, >> disclosure, >> dissemination, forwarding, printing or copying of this email or any action >> taken in >> reliance on this e-mail is strictly prohibited and may be unlawful. >> >> >> > -- David S. Read CTO *CISSP, GIAC/GSEC, RHCE, SCJP *Blue Slate Solutions 39 Columbia St. Albany, NY 12207 518-810-0368 www.blueslate.net This e-mail and any files transmitted with it are for the sole use of Blue Slate Solutions and the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful.

