users@jaxb.java.net

Re: White Spaces in xsd:string

From: Thomas Roschi <gugus.dada_at_gmx.net>
Date: Mon, 17 Jan 2005 07:55:12 +0100

Yes. The string i'm talking from is an attribute:

------ snip ------ XSD
       <xs:attribute name="result_text" type="xs:string">
          <xs:annotation>
            <xs:documentation>An optional resulting text (e.g. a
pre-formatted
              check card.</xs:documentation>
          </xs:annotation>
        </xs:attribute>

------ snip ------ XML
<RemoteCommandResponse timestamp="1970-01-01T00:00:00" shift="7"
shift_open="2005-01-12T02:30:01" shift_record_count="1"
shift_record_type_count="1" request_id="4245" result="failed"
result_text="&quot; ===========================================
  Version Check Card
  ===========================================
  TVM-Time: 12.01.05 11:22:40
  TVM-Location: 364
  TVM-Number: 14070
  Software: 2005.1_alpha
  ___________________________________________

  Component Version

  AH_Wrapper 2.0_7.7
  ProcessManager 2.0_6.4
                                               &quot;" error_text="">
</RemoteCommandResponse>


Does any one know how i can parse the xml and keep this new lines? The
text is preformatted ascii.

Any help is welcome. Thanks in advance.
  Thom


Kohsuke Kawaguchi wrote:

> Thomas Roschi wrote:
>
>> i'am new to JAXB and i have a problem:
>> I'am transferring text data containing new lines (\n\r) in a
>> xsd:string type. The resulting string in the generated java-classes
>> does no more contain this new lines. They are replaced by a space.
>
>
> Roughly speaking, XML does not always preserve new lines in
> attributes. I'm suspecting that's causing your problem.
>
> Newlines in elements, if they are typed as xs:string, should be
> preserved by JAXB. If it doesn't, that's a bug. Please file a bug
> report with a schema and an instance so that we can investigate the
> problem.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net