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(<
, >
, '
, "
, &
)
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("'","'")
method before sending output stax parser writeattribute
method
but stax parser escaping <,>,& character output showing &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
Post a Comment