Thomas Beale wrote:
> Adam Flinton wrote:
>   
>> To quote from the oxygen xml page above:
>>
>> "Although writing documents with no indentation is a perfectly 
>> acceptable practice, it makes editing difficult and is error prone. It 
>> also makes the identification of exact error positions difficult. 
>> Formatting and Indenting, also called "Pretty Print", enables the XML 
>> documents to be neatly arranged in a manner that is consistent and 
>> promotes easier reading."
>>   
>>     
> but no-one is advocating creating documents with no whitespace, 
> particularly, although many tools do, since the XML is intended for 
> consumption by computers, not people. But whitespace between Elements is 
> not the same as white space in an Element value.
>   

http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-whiteSpace

*"whiteSpace* is applicable to all ?atomic? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-atomic> and 
?list? <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-list> 
datatypes. For all ?atomic? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-atomic> 
datatypes other than string 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#string> (and types 
?derived? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-derived> by 
?restriction? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-restriction> 
from it) the value of *whiteSpace* is |collapse| and cannot be changed 
by a schema author; for string 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#string> the value 
of *whiteSpace* is |preserve|; for any type ?derived? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-derived> by 
?restriction? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-restriction> 
from string <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#string> 
the value of *whiteSpace* can be any of the three legal values. For all 
datatypes ?derived? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-derived> by 
?list? <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-list> the 
value of *whiteSpace* is |collapse| and cannot be changed by a schema 
author. For all datatypes ?derived? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-derived> by 
?union? <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-union> 
 *whiteSpace* does not apply directly; however, the normalization 
behavior of ?union? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-union> types is 
controlled by the value of *whiteSpace* on that one of the ?memberTypes? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-memberTypes> 
against which the ?union? 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dt-union> is 
successfully validated."

So for string it's fine to format the text for readability by 
introducing tabs, linefeeds etc.

>>   
>>     
>>> Sure, but the tool should never add whitespace to a value, that is not the
>>> norm, it is simply wrong.
>>>  
>>>   
>>>     
>>>       
>> Not true.
>>
>> See above wrt Oxygen XML's view. I can quote you the relevant sections 
>> from the XML docs e.g.
>>
>> http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/
>>
>> http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace
>>   
>>     
> well what this tells me is that if the whitespace facet of the type in a 
> schema is set to 'preserve' then the whitespace is not changed. What 
> happens to whitespace _between_ Elements doesn't matter too much (i.e. 
> between tag end and new tag start), since this is just a question of 
> indented formatting. What the debate here is about, as far as I 
> understand, is about whitespace within textual Element values - which 
> should of course be preserved, else XML can't be used to send normal 
> documentary text around.
>   
Or it has to be normalized at every point it is read in.

That means (for example) that you can never have text starting with or 
ending with a space & possibly you can never include tabs, linefeeds etc 
in your text.

>> If however you are looking to create a bullet proof serialization in XML 
>> where the values matter then it is a poor design.
>>   
>>     
> well - let's have some evidence of that. If it is true, then change 
> needs to be considered. But let's have the hard evidence first.
>
>   
Look at every other major standard for XML.

e.g. XMI:

  <eAnnotations xmi:id="_2IHQUQ3aEdy0fvloa5NWrg" source="uml2.diagrams"/>
  <ownedComment xmi:id="_ABfwQA3bEdy0fvloa5NWrg" body="Advanced Trace 
allows an external system to identify a Patient based on an NHS Number 
or a variety of search criteria including name, address and a date range 
for either birth or death. Historic data may optionally also be 
searched, and/or returned. Current and future dated data is always 
returned. Multiple matching records may be returned, along with a 
MatchingLevel  (this will only be populated for an algorithmic search) 
for each match, indicating the confidence of the match.&#xD;&#xA;See the 
PDS [SSRS] for details of the responses returned by Advanced 
Trace.&#xD;&#xA;" annotatedElement="_2IHQUA3aEdy0fvloa5NWrg">
    <eAnnotations xmi:id="_ABfwQQ3bEdy0fvloa5NWrg" 
source="appliedStereotypes">
      <contents xmi:type="Default_0:Default__Documentation" 
xmi:id="_ABfwQg3bEdy0fvloa5NWrg"/>
    </eAnnotations>
  </ownedComment>
  <packageImport xmi:type="uml:ProfileApplication" 
xmi:id="_2IHQVA3aEdy0fvloa5NWrg">
    <eAnnotations xmi:id="_2IHQVQ3aEdy0fvloa5NWrg" source="attributes">
      <details xmi:id="_2IHQVg3aEdy0fvloa5NWrg" key="version" value="0"/>
    </eAnnotations>
    <importedPackage xmi:type="uml:Profile" 
href="pathmap://UML2_PROFILES/Basic.profile.uml2#_6mFRgK86Edih9-GG5afQ0g"/>
    <importedProfile 
href="pathmap://UML2_PROFILES/Basic.profile.uml2#_6mFRgK86Edih9-GG5afQ0g"/>
  </packageImport>

Note how the documentation includes the formatting entities but that 
they are intended to be there.

SVG:

<g fill="rgb(232,232,255)" stroke-miterlimit="0" font-family="'Arial'" 
stroke-linejoin="round" stroke="rgb(232,232,255)">
<rect x="10" y="10" clip-path="url(#clipPath1)" width="1500" 
height="202" stroke="none"/>
<rect x="10" y="10" clip-path="url(#clipPath1)" fill="none" width="1500" 
height="202" stroke="black"/>
<image stroke="black" transform="matrix(1,0,0,1,21,97)" width="15" 
xlink:show="embed" xlink:type="simple" fill="black" 
clip-path="url(#clipPath2)" preserveAspectRatio="none" height="23" x="0" 
y="0" 
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAXCAYAAADUUxW8AAAAgUlEQVR42s1UwQnA&#13;&#10;MAiMwSGy/3TZIq0PQcRqVQoV8hBz5jw1sPc5o2hzNKwFRumsBSHgLtMGU4ASyAsp&#13;&#10;2pygXHP55ZbaRJmPFXPVlpTZZ5AuByNqnvoz09efjqelqPbd8fyEttV7jAAeK4wA&#13;&#10;Xp/x7UCEYL2OUSLwPsB0zU+ts5bjArh6RxD5kW1tAAAAAElFTkSuQmCC"
 
xlink:actuate="onLoad"/>
<rect x="130" y="89" clip-path="url(#clipPath3)" fill="white" 
width="111" rx="4.5" ry="4.5" height="61" stroke="none"/>
<rect x="130" y="89" clip-path="url(#clipPath3)" fill="none" width="110" 
rx="4" ry="4" height="60" stroke="black"/>
<text x="153" y="124" clip-path="url(#clipPath4)" fill="black" 
stroke="none" xml:space="preserve">AR1_Task1</text>
<circle clip-path="url(#clipPath5)" fill="white" r="14.5" cx="70.5" 
cy="119.5" stroke="none"/>
<circle clip-path="url(#clipPath5)" fill="none" r="14.5" cx="70.5" 
cy="119.5" stroke="black"/>
<text x="58" y="147" clip-path="url(#clipPath6)" fill="black" 
stroke="none" xml:space="preserve">Start</text>
<line clip-path="url(#clipPath7)" fill="none" x1="36" x2="36" y1="11" 
y2="210" stroke="rgb(169,169,169)"/>
<rect x="10" y="10" clip-path="url(#clipPath1)" fill="none" width="1500" 
height="202" stroke="rgb(169,169,169)"/>
<rect x="10" y="265" clip-path="url(#clipPath8)" width="1500" 
height="200" stroke="none"/>
<rect x="10" y="265" clip-path="url(#clipPath8)" fill="none" 
width="1500" height="200" stroke="black"/>
<image stroke="black" transform="matrix(1,0,0,1,21,351)" width="15" 
xlink:show="embed" xlink:type="simple" fill="black" 
clip-path="url(#clipPath2)" preserveAspectRatio="none" height="23" x="0" 
y="0" 
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAXCAYAAADUUxW8AAAAhElEQVR42s1TQQ7A&#13;&#10;IAgbpo/w/6/zF25eFsKQyuZhJBwEiy2ItNb78dKKDdQqt3s5bbDJi8njso6FL2sb&#13;&#10;oOEeCwrWRbwCZeXSjLps7fZ/RqX7YHWDUbMFU5pnwP0NyxhYR+1Zy8Cqvk+0vdmD&#13;&#10;ASJWYIBozlj9EBRsV5IVClcyrXk2Om85TlGWUZ+e/kVBAAAAAElFTkSuQmCC"
 
xlink:actuate="onLoad"/>
<rect x="293" y="294" clip-path="url(#clipPath9)" fill="white" 
width="153" rx="4.5" ry="4.5" height="94" stroke="none"/>
<rect x="293" y="294" clip-path="url(#clipPath9)" fill="none" 
width="152" rx="4" ry="4" height="93" stroke="black"/>

XSLT:

    <xsl:strip-space elements="*" />
    <xsl:param name="p_FileListDoc" />
    <xsl:param name="p_ProcFileListDoc" />
    <xsl:param name="p_ReportDoc" />


    <xsl:template match="/">
        <!--  <xsl:message>
            p_configDoc = <xsl:value-of select="$p_configDoc" />
            </xsl:message> -->
        <xsl:element name="root" namespace="">

            <xsl:element name="errors" namespace="">
                <xsl:call-template name="ValidateADL">
                    <xsl:with-param name="p_FileListDoc"
                        select="$p_FileListDoc" />
                </xsl:call-template>
                <xsl:call-template
                    name="Process_Contains-draft-archetype">
                    <xsl:with-param name="p_rootNode" select="." />
                </xsl:call-template>
            </xsl:element>
            <xsl:element name="files" namespace="">
                <xsl:call-template name="ProcessFileNames">
                    <xsl:with-param name="p_rootNode" select="." />
                </xsl:call-template>
            </xsl:element>
        </xsl:element>
    </xsl:template>


XSD:

<xs:complexType name="ApplicationRolesType">
        <xs:annotation>
            <xs:documentation>Collects the application roles defined in 
this file</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="ApplicationRole" type="RimArtefactType" 
minOccurs="2" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>A definition of an application 
role.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>


ebXML:

  <BinaryCollaboration name="Request Catalog">
    <AuthorizedRole name="requestor"/>
    <AuthorizedRole name="provider"/>
    <BusinessTransactionActivity name="Catalog Request"
                                 businessTransaction="Catalog Request"
                                 fromAuthorizedRole="requestor"
                                 toAuthorizedRole="provider"/>
  </BinaryCollaboration>



Take an easy example which is (X)HTML

<a class="docSubTitle" href="#Table_of_Contents:"
    name="Getting_ANT">(1) Getting ANT </a>

looks exactly the same to the viewer as:

<a class="docSubTitle" href="#Table_of_Contents:"
    name="Getting_ANT">

(1)

            Getting

                                                        ANT
</a>

Because the value contained as the text child has no used or interest in 
any textual formatting at that level i.e. a new line is a <br/> etc.

Adam

**********************************************************************
This message  may  contain  confidential  and  privileged information.
If you are not  the intended  recipient please  accept our  apologies.
Please do not disclose, copy or distribute  information in this e-mail
or take any  action in reliance on its  contents: to do so is strictly
prohibited and may be unlawful. Please inform us that this message has
gone  astray  before  deleting it.  Thank  you for  your co-operation.

NHSmail is used daily by over 100,000 staff in the NHS. Over a million
messages  are sent every day by the system.  To find  out why more and
more NHS personnel are  switching to  this NHS  Connecting  for Health
system please visit www.connectingforhealth.nhs.uk/nhsmail
**********************************************************************


Reply via email to