I completely agree with your point that valid XML is generated in this
case. I just wanted to submit the unmarshalled XML without ANY changes
because I am a mediator between 3d party services. If this is a feature
that parser can randomly produce "'" or ' so be it.
Thx,
AL

-----Original Message-----
From: James Abley [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 12:06 AM
To: [email protected]
Subject: Re: [castor-user] Unmarshall/Marshall cycle doesn't preserve
apostrophes

Why is it a problem for you? The Marshaller is producing valid XML. It
may be may be considered good practice to output "'" as ' but it is
allowed by the specification to produce "'" in certain places and Xerces
certainly does this.

James

Levashov, Alexei (First Franklin) wrote:
> Hi All,
> I have a problem with preserving the ' symbol inside the text 
> element.
> the schema def for _Text element:
> <xs:element name="_Text">
> <xs:complexType mixed="true">
> <xs:choice minOccurs="0" maxOccurs="unbounded"/> </xs:complexType> 
> </xs:element>
> 
> The initial XML looks like that:
> <_Text>ACCOUNT CLOSED AT CONSUMER&apos;S REQUEST</_Text>
> 
> I unmarshall it using Java classes generated by Castor from schema and

> the value of _Text object is the string : ACCOUNT CLOSED AT CONSUMER'S

> REQUEST as expected. After that I insert the object tree build from 
> unmarshalled XML into another object hierarchy and marshall the 
> resulting tree back into XML. The schema for the final document has 
> import/namespace refs to the initial XML doc.
> BUT  the value for the text element now has apostrophe explicitly
> included:
> <ns1:_Text>ACCOUNT CLOSED AT CONSUMER'S REQUEST</ns1:_Text> What can I

> change to make Marshaller understand that apostrophe has to be 
> transformed to &apos; ?
> 
> NOTE:
> I have other elements containing &amp;
> <_UnparsedEmployment>Employer: BIGGINS BAR &amp; GRILLE; Occ: BAR 
> MANAGER</_UnparsedEmployment> Defined exactly the same way as _Text
>       <xs:element name="_UnparsedEmployment">
>               <xs:complexType mixed="true">
>                       <xs:choice minOccurs="0" maxOccurs="unbounded"/>
>               </xs:complexType>
>       </xs:element>
> But it successfully makes from "Employer: BIGGINS BAR & GRILLE; Occ: 
> BAR MANAGER" to <ns1:_UnparsedEmployment>Employer: BIGGINS BAR &amp; 
> GRILLE;
> Occ: BAR MANAGER</ns1:_UnparsedEmployment>, so not every entity 
> reference is ignored by Marshaller.
> 
> Thank you,
> AL
> --------------------------------------------------------
> 
> Please be aware that email IS NOT a secured communication vehicle, and
that others may in certain circumstances be able to view its contents.
As a result, while we are happy to provide this preliminary information
by email in response to your request, we DO NOT conduct actual business
transactions by email. Please contact me directly to proceed further, or
if you have any concerns about this message.
> 
> ---------------------------------------------------------------------
> 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 
--------------------------------------------------------

Please be aware that email IS NOT a secured communication vehicle, and that 
others may in certain circumstances be able to view its contents. As a result, 
while we are happy to provide this preliminary information by email in response 
to your request, we DO NOT conduct actual business transactions by email. 
Please contact me directly to proceed further, or if you have any concerns 
about this message.

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to