Hi all,

In a XML import/export I need to transport text inside element attributes
preserving line breaks.

According to the XML specification if I use the character reference 

in contrast to the linefeed character itself it has to be preserved.
If I parse the document without Schema and validation, it works correct that
way.

With Schema validation (which I need to use) the line breaks are converted
to normal spaces ( ). I tried different built-in types without luck.
Then I defined my own type, which - according to my understanding of the
XML Schema specificaion - should preserve whitespaces:

 <xsd:simpleType name="whitespaceString" final="restriction">
  <xsd:restriction base="xsd:string">
   <xsd:whiteSpace value="preserve"/>
  </xsd:restriction>
 </xsd:simpleType>

But using this type did not help.

Here is the part from the specification which makes me believe I am doing it
right:
(http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace)

whiteSpace is applicable to all atomic and list datatypes. For all atomic
datatypes other than string (and types derived by restriction from it) the
value of whiteSpace is collapse and cannot be changed by a schema author;
for string the value of whiteSpace is preserve; for any type derived by
restriction from string the value of whiteSpace can be any of the three
legal values.

I use Xerces-C nightly build 20011122 (1.6 'pre-alpha-candidate') DOM
Parser.

Any help on this will be greatly appreciated.

Norbert Kintzler
easy-soft GmbH Dresden

[EMAIL PROTECTED]
http://www.easy-soft-dresden.de





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to