users@jaxb.java.net

Re: White Spaces in xsd:string

From: Igor Metz <metz_at_glue.ch>
Date: Fri, 21 Jan 2005 08:42:10 +0100

The probably better solution would be to correct your XML schema.
Instead of using attributes for your data, use elements and
give your data more structure, e.g.

<RemoteCommandResponse>
  <timestamp>1970-01-01T00:00:00</timestamp>
  <shift id="7">
    <open>2005-01-12T02:30:01</open>
    <record_count>1</record_count>
    <record_type_count>1</record_type_count>
  </shift>
  <request_id>4245</request_id>
  <result status="failed">
    <text>
  ===========================================
  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
      </text>
    <error_text></error_text>
  </result>
</RemoteCommandResponse>

With this approach you can preserve whitespace.

Best regards
Igor Metz

---
Dr. Igor Metz, http://www.glue.ch
GLUE Software Engineering AG, Zieglerstr. 34, CH-3007 Bern, Switzerland
--On Mittwoch, 19. Januar 2005 11:53 +0200 Jyrki Saarinen <jyrki.saarinen_at_valimo.com> wrote:
> Kohsuke Kawaguchi wrote:
>
>> Thomas Roschi wrote:
>>
>>> Yes. The string i'm talking from is an attribute:
>>
>> >
>>
>>> Does any one know how i can parse the xml and keep this new lines? The
>>> text is preformatted ascii.
>>
>>
>> You can't. That's what the XML spec says.
>>
>> See http://www.w3.org/TR/REC-xml/#AVNormalize
>
>
>
> Of course one could, let's say base64 encode
> the string and preserve white space this way.
>
> --
> Mr Jyrki Saarinen    //
> +358 50 3640535     //
> Senior        \\   //  Design Engineer
> Valimo         \\ //  Wireless Oy
> http://         \X/   www.valimo.com
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net