java - StAX XML Parser not escaping single quote (') -


we using stax parser read large xml files , strip off of elements/attributes , write xml file

the source xml file valid xml file i.e. have xml special characters(<,>,',",&) escaped respective xml versions(&lt;, &gt;, &apos;, &quot;, &amp;)

when stax parser writing these special characters in output file escaping <,>,& characters not'," characters i.e in output file can see '," characters, although input file have escaped versions

i have tried replace using string.replaceall("'","&apos;") method before sending output stax parser writeattribute method

but stax parser escaping <,>,& character output showing &amp;apos;

can let me kow there configuration/utiltity in stax parser api solve issue in stax parser?

or, alternatively, other suggestions use xml writer tool solves problem?

single quotes need escaped if occur in attribute value enclosed single quotes. there's not reason escape them otherwise.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -