Loading ...
Sorry, an error occurred while loading the content.

RE: [soapbuilders] xml:space="preserve"?

Expand Messages
  • Simon Fell
    this is something that s been worrying me for the last couple of weeks, xsd:string seems a poor choice for transporting arbitary/formatted text. (on reflection
    Message 1 of 13 , Jun 28, 2001
    • 0 Attachment
      this is something that's been worrying me for the last couple of weeks,
      xsd:string seems a poor choice for transporting arbitary/formatted text. (on
      reflection this seems to be a similar case to the transporting XML
      discussions we've already had).

      will xml:space="preserve" do the right thing ?

      Cheers
      Simon

      -----Original Message-----
      From: NAKAMURA, Hiroshi [mailto:nahi@...]
      Sent: Thursday, June 28, 2001 7:22 PM
      To: soapbuilders@yahoogroups.com
      Subject: [soapbuilders] xml:space="preserve"?


      Hi all,

      I have a question about whiteSpace should be preserved or not.

      > From: NAKAMURA, Hiroshi [mailto:nahi@...]
      > Sent: Friday, June 29, 2001 10:58 AM

      > == Request from SOAP4R.

      > <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:n1="http://soapinterop.org/"><SOAP-ENV:Body
      >
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><n1:echoS
      tring><inputString xsi:type="xsd:string">^M
      > ^M
      > </inputString></n1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>

      > == Response from server.

      > <?xml version="1.0"?><SOAP-ENV:Envelope
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      >
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><m
      :echoStringResponse
      > xmlns:m="http://soapinterop.org/"><Result
      >
      xsi:type="xsd:string"></Result></m:echoStringResponse></SOAP-ENV:Body></SOAP
      -ENV:Envelope>
      >
      > Result: Expected = "\r\n\t\r\n\t" // Actual = nil

      XML instance I sent does not have 'xml:space="preserve"'.
      So I think I should NOT require "\r\n\t\r\n\t" will be
      returned. Is this right?

      In XML Schema spec., whiteSpace in xsd:string is defined
      to be preserved by default, so XML Schema processor must
      preserve whiteSpaces. But XML processor will not know
      this without xml:space="preserve" notation.

      I'm now thinking I should add 'xml:space="preserve"' to
      all SOAP messages which contains xsd:string...

      Am I wrong?

      To unsubscribe from this group, send an email to:
      soapbuilders-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    • Paul Kulchenko
      Hi, Simon! [NAKAMURA, Hiroshi] ... [Simon Fell] ... I don t think we need it. XML spec says [1]: An XML processor must always pass all characters in a document
      Message 2 of 13 , Jun 28, 2001
      • 0 Attachment
        Hi, Simon!

        [NAKAMURA, Hiroshi]
        > XML instance I sent does not have 'xml:space="preserve"'.
        > So I think I should NOT require "\r\n\t\r\n\t" will be
        > returned. Is this right?
        >
        > In XML Schema spec., whiteSpace in xsd:string is defined
        > to be preserved by default, so XML Schema processor must
        > preserve whiteSpaces. But XML processor will not know
        > this without xml:space="preserve" notation.

        [Simon Fell]
        > will xml:space="preserve" do the right thing ?

        I don't think we need it. XML spec says [1]:

        An XML processor must always pass all characters in a document that
        are not markup through to the application. A validating XML processor
        must also inform the application which of these characters constitute
        white space appearing in element content.

        A special attribute named xml:space may be attached to an element to
        signal an intention that in that element, white space should be
        preserved ==by applications==.

        So, xml:space says that APPLICATION should preserve those, and XML
        processor has nothing to do with it. Application may also decide to
        preserve them without looking into xml:space attribute (at least
        that's what I do :)), so I don't see any problem here.

        we may have a problem in this case however because of 2.11
        End-of-Line Handling [2]:

        To simplify the tasks of applications, the characters passed to an
        application by the XML processor must be as if the XML processor
        normalized all line breaks in external parsed entities (including the
        document entity) on input, before parsing, by translating both the
        two-character sequence #xD #xA and any #xD that is not followed by
        #xA to a single #xA character.

        It seems like it's quite possible to get "\n\t\n\t" from
        "\r\n\t\r\n\t", and even worse, it's possible to get "1\n2" from
        "1\r\n2" which could make a difference. Moreover, seems like
        xml:space attribute doesn't apply there. Comments?

        Best wishes, Paul.

        [1] http://www.w3.org/TR/REC-xml#sec-white-space
        [2] http://www.w3.org/TR/REC-xml#sec-line-ends

        --- Simon Fell <sfell@...> wrote:
        > this is something that's been worrying me for the last couple of
        > weeks,
        > xsd:string seems a poor choice for transporting arbitary/formatted
        > text. (on
        > reflection this seems to be a similar case to the transporting XML
        > discussions we've already had).
        >
        > will xml:space="preserve" do the right thing ?
        >
        > Cheers
        > Simon
        >
        > -----Original Message-----
        > From: NAKAMURA, Hiroshi [mailto:nahi@...]
        > Sent: Thursday, June 28, 2001 7:22 PM
        > To: soapbuilders@yahoogroups.com
        > Subject: [soapbuilders] xml:space="preserve"?
        >
        >
        > Hi all,
        >
        > I have a question about whiteSpace should be preserved or not.
        >
        > > From: NAKAMURA, Hiroshi [mailto:nahi@...]
        > > Sent: Friday, June 29, 2001 10:58 AM
        >
        > > == Request from SOAP4R.
        >
        > > <SOAP-ENV:Envelope
        > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        > xmlns:n1="http://soapinterop.org/"><SOAP-ENV:Body
        > >
        >
        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><n1:echoS
        > tring><inputString xsi:type="xsd:string">^M
        > > ^M
        > >
        > </inputString></n1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
        >
        > > == Response from server.
        >
        > > <?xml version="1.0"?><SOAP-ENV:Envelope
        > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > >
        >
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><m
        > :echoStringResponse
        > > xmlns:m="http://soapinterop.org/"><Result
        > >
        >
        xsi:type="xsd:string"></Result></m:echoStringResponse></SOAP-ENV:Body></SOAP
        > -ENV:Envelope>
        > >
        > > Result: Expected = "\r\n\t\r\n\t" // Actual = nil
        >
        > XML instance I sent does not have 'xml:space="preserve"'.
        > So I think I should NOT require "\r\n\t\r\n\t" will be
        > returned. Is this right?
        >
        > In XML Schema spec., whiteSpace in xsd:string is defined
        > to be preserved by default, so XML Schema processor must
        > preserve whiteSpaces. But XML processor will not know
        > this without xml:space="preserve" notation.
        >
        > I'm now thinking I should add 'xml:space="preserve"' to
        > all SOAP messages which contains xsd:string...
        >
        > Am I wrong?
        >
        > To unsubscribe from this group, send an email to:
        > soapbuilders-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >
        > To unsubscribe from this group, send an email to:
        > soapbuilders-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Get personalized email addresses from Yahoo! Mail
        http://personal.mail.yahoo.com/
      • Simon Fell
        looks pretty good Here s the pocketSOAP results Serialization Order (With Root) passed EchoVoid passed EchoInteger passed EchoIntegerArray passed
        Message 3 of 13 , Jun 28, 2001
        • 0 Attachment
          looks pretty good

          Here's the pocketSOAP results

          Serialization Order (With Root) passed
          EchoVoid passed
          EchoInteger passed
          EchoIntegerArray passed
          EchoIntegerArray (No Items) failed SOAP-ENV:Server : UndefinedObject
          does not understand #collect:
          EchoString passed
          EchoString-NonAscii failed got 'Some ASCII string and some non ASCII
          characters ???? and some more ASCII here' expecting 'Some ASCII string
          and some non ASCII characters ???? and some more ASCII here'
          EchoStringArray passed
          EchoFloat passed
          EchoFloatArray passed
          EchoStruct passed
          EchoStructArray passed
          EchoDate passed
          EchoBase64 passed
          NoSuchMethod passed
          MustUnderStand=True passed
          MustUnderStand=False passed

          Cheers
          Simon

          On Fri, 29 Jun 2001 09:58:56 +1000, in soap you wrote:

          >Hi,
          >
          >I have a new Soap Toolkit to add to the interop tests.
          >
          >The Interop Test homepage;
          >http://www.dolphinharbor.org/qad/spray/about/index.html
          >
          >There are two endpoints;
          >
          >1999 schema
          >WSDL: http://www.dolphinharbor.org/services/interop/service.wsdl
          >Endpoint: http://www.dolphinharbor.org/services/interop
          >SOAPAction: "urn:soapinterop" (not checked)
          >Namespace: http://soapinterop.org/
          >
          >2001 schema
          >WSDL: http://www.dolphinharbor.org/services/interop2001/service.wsdl
          >Endpoint: http://www.dolphinharbor.org/services/interop2001
          >SOAPAction: "urn:soapinterop" (not checked)
          >Namespace: http://soapinterop.org/
          >
          >Both the server and soap implementation are written in Dolphin Smalltalk.
          >Both are Alpha versions.
          >
          >Thank-you to all for making this interop testing resource available, it has
          >been a great help in the development of this toolkit.
          >
          >All bug and problem reports appreciated. I only have round 1 endpoints at
          >the moment. Once I work my way through my round 1 bugs, I will start work on
          >round2.
          >
          >Steve Waring
          >swaring@...
          >
          >
          >To unsubscribe from this group, send an email to:
          >soapbuilders-unsubscribe@yahoogroups.com
          >
          >
          >
          >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          >
        • NAKAMURA, Hiroshi
          Hi Paul, Thank you for great explanation. I found I misunderstood xml:space in XML spec. xml:space is for XML application not for XML processor, isn t it?.
          Message 4 of 13 , Jun 29, 2001
          • 0 Attachment
            Hi Paul,

            Thank you for great explanation. I found I misunderstood
            xml:space in XML spec. xml:space is for XML application not
            for XML processor, isn't it?. It made sense to me about
            whiteSpace issue.

            # My development experience with MSXML.DLL led me wrong...

            Regards to EOL issue, I still cannot find how I should do.
            I almost thought as you but I was confused after reading
            definition of whiteSpace facet in XML Schema part2[1]:

            preserve
            No normalization is done, the value is not changed
            (this is the behavior required by [XML 1.0 (Second
            Edition)] for element content)

            replace
            All occurrences of #x9 (tab), #xA (line feed) and #xD
            (carriage return) are replaced with #x20 (space)

            collapse
            After the processing implied by replace, contiguous
            sequences of #x20's are collapsed to a single #x20, and
            leading and trailing #x20's are removed.

            "replace" seems to suggest #xD could be passed to XML
            Schema processor (for us, #xD could be passed to SOAP
            processor.) Is this #xD not a XML processor level but a
            XML application level issue? If so, how can I describe #xD
            in XML instance? CDATA cannot be a xsd:string...

            [1] http://www.w3.org/TR/xmlschema-2/#dt-whiteSpace

            PS. I'm sorry for my poor English. English language is
            harder than Ruby, C++, Java and Perl for me...

            // NaHi

            > From: Paul Kulchenko [mailto:paulclinger@...]
            > Sent: Friday, June 29, 2001 1:25 PM

            > Hi, Simon!
            >
            > [NAKAMURA, Hiroshi]
            > > XML instance I sent does not have 'xml:space="preserve"'.
            > > So I think I should NOT require "\r\n\t\r\n\t" will be
            > > returned. Is this right?
            > >
            > > In XML Schema spec., whiteSpace in xsd:string is defined
            > > to be preserved by default, so XML Schema processor must
            > > preserve whiteSpaces. But XML processor will not know
            > > this without xml:space="preserve" notation.
            >
            > [Simon Fell]
            > > will xml:space="preserve" do the right thing ?
            >
            > I don't think we need it. XML spec says [1]:
            >
            > An XML processor must always pass all characters in a document that
            > are not markup through to the application. A validating XML processor
            > must also inform the application which of these characters constitute
            > white space appearing in element content.
            >
            > A special attribute named xml:space may be attached to an element to
            > signal an intention that in that element, white space should be
            > preserved ==by applications==.
            >
            > So, xml:space says that APPLICATION should preserve those, and XML
            > processor has nothing to do with it. Application may also decide to
            > preserve them without looking into xml:space attribute (at least
            > that's what I do :)), so I don't see any problem here.
            >
            > we may have a problem in this case however because of 2.11
            > End-of-Line Handling [2]:
            >
            > To simplify the tasks of applications, the characters passed to an
            > application by the XML processor must be as if the XML processor
            > normalized all line breaks in external parsed entities (including the
            > document entity) on input, before parsing, by translating both the
            > two-character sequence #xD #xA and any #xD that is not followed by
            > #xA to a single #xA character.
            >
            > It seems like it's quite possible to get "\n\t\n\t" from
            > "\r\n\t\r\n\t", and even worse, it's possible to get "1\n2" from
            > "1\r\n2" which could make a difference. Moreover, seems like
            > xml:space attribute doesn't apply there. Comments?
            >
            > Best wishes, Paul.
            >
            > [1] http://www.w3.org/TR/REC-xml#sec-white-space
            > [2] http://www.w3.org/TR/REC-xml#sec-line-ends
          • Steve Waring
            Hi Paul, Simon and Hiroshi, Thanks for the bug reports, I have been able to fix a few, but some of them will take more time before I can upload fixes. I think
            Message 5 of 13 , Jun 29, 2001
            • 0 Attachment
              Hi Paul, Simon and Hiroshi,

              Thanks for the bug reports, I have been able to fix a few, but some of them
              will take more time before I can upload fixes. I think whitespace handling
              will keep me very busy tomorrow!

              Thanks
              Steve
            • Rich Salz
              ... Oh yeah, it s horrible and you shouldn t do it. You have to be aware of whitespace issues for xml:space, you have to be concerned about the document being
              Message 6 of 13 , Jun 29, 2001
              • 0 Attachment
                > xsd:string seems a poor choice for transporting arbitary/formatted text.

                Oh yeah, it's horrible and you shouldn't do it. You have to be aware of
                whitespace issues for xml:space, you have to be concerned about the
                document being transcoded into a different encoding, etc.

                The only safe thing to do is to transmit it via base64.

                The SOAP spec itself is silent about xml:space. Since SOAP can be either
                a processor or an application, I believe the spec should explicitly say
                MUST NOT appear in sec5 encodings.
                /r$

                --
                Zolera Systems, Securing web services (XML, SOAP, Signatures,
                Encryption)
                http://www.zolera.com
              • Bob Cunnings
                Hello, I have always felt that there is no escape from Section 2.11 End-of- Line handling... the implementation here normalizes line breaks as specified there
                Message 7 of 13 , Jun 29, 2001
                • 0 Attachment
                  Hello,

                  I have always felt that there is no escape from Section 2.11 End-of-
                  Line handling... the implementation here normalizes line breaks as
                  specified there prior to parsing.

                  It's an interesting discussion!

                  RC

                  > Hi, Simon!
                  >
                  > [NAKAMURA, Hiroshi]
                  > > XML instance I sent does not have 'xml:space="preserve"'.
                  > > So I think I should NOT require "\r\n\t\r\n\t" will be
                  > > returned. Is this right?
                  > >
                  > > In XML Schema spec., whiteSpace in xsd:string is defined
                  > > to be preserved by default, so XML Schema processor must
                  > > preserve whiteSpaces. But XML processor will not know
                  > > this without xml:space="preserve" notation.
                  >
                  > [Simon Fell]
                  > > will xml:space="preserve" do the right thing ?
                  >
                  > I don't think we need it. XML spec says [1]:
                  >
                  > An XML processor must always pass all characters in a document that
                  > are not markup through to the application. A validating XML processor
                  > must also inform the application which of these characters constitute
                  > white space appearing in element content.
                  >
                  > A special attribute named xml:space may be attached to an element to
                  > signal an intention that in that element, white space should be
                  > preserved ==by applications==.
                  >
                  > So, xml:space says that APPLICATION should preserve those, and XML
                  > processor has nothing to do with it. Application may also decide to
                  > preserve them without looking into xml:space attribute (at least
                  > that's what I do :)), so I don't see any problem here.
                  >
                  > we may have a problem in this case however because of 2.11
                  > End-of-Line Handling [2]:
                  >
                  > To simplify the tasks of applications, the characters passed to an
                  > application by the XML processor must be as if the XML processor
                  > normalized all line breaks in external parsed entities (including the
                  > document entity) on input, before parsing, by translating both the
                  > two-character sequence #xD #xA and any #xD that is not followed by
                  > #xA to a single #xA character.
                  >
                  > It seems like it's quite possible to get "\n\t\n\t" from
                  > "\r\n\t\r\n\t", and even worse, it's possible to get "1\n2" from
                  > "1\r\n2" which could make a difference. Moreover, seems like
                  > xml:space attribute doesn't apply there. Comments?
                  >
                  > Best wishes, Paul.
                  >
                  > [1] http://www.w3.org/TR/REC-xml#sec-white-space
                  > [2] http://www.w3.org/TR/REC-xml#sec-line-ends
                  >
                  > --- Simon Fell <sfell@...> wrote:
                  > > this is something that's been worrying me for the last couple of
                  > > weeks,
                  > > xsd:string seems a poor choice for transporting arbitary/formatted
                  > > text. (on
                  > > reflection this seems to be a similar case to the transporting XML
                  > > discussions we've already had).
                  > >
                  > > will xml:space="preserve" do the right thing ?
                  > >
                  > > Cheers
                  > > Simon
                  > >
                  > > -----Original Message-----
                  > > From: NAKAMURA, Hiroshi [mailto:nahi@...]
                  > > Sent: Thursday, June 28, 2001 7:22 PM
                  > > To: soapbuilders@yahoogroups.com
                  > > Subject: [soapbuilders] xml:space="preserve"?
                  > >
                  > >
                  > > Hi all,
                  > >
                  > > I have a question about whiteSpace should be preserved or not.
                  > >
                  > > > From: NAKAMURA, Hiroshi [mailto:nahi@...]
                  > > > Sent: Friday, June 29, 2001 10:58 AM
                  > >
                  > > > == Request from SOAP4R.
                  > >
                  > > > <SOAP-ENV:Envelope
                  > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                  > > xmlns:n1="http://soapinterop.org/"><SOAP-ENV:Body
                  > > >
                  > >
                  > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><n1:echoS
                  > > tring><inputString xsi:type="xsd:string">^M
                  > > > ^M
                  > > >
                  > > </inputString></n1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
                  > >
                  > > > == Response from server.
                  > >
                  > > > <?xml version="1.0"?><SOAP-ENV:Envelope
                  > > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                  > > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                  > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  > > >
                  > >
                  > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><m
                  > > :echoStringResponse
                  > > > xmlns:m="http://soapinterop.org/"><Result
                  > > >
                  > >
                  > xsi:type="xsd:string"></Result></m:echoStringResponse></SOAP-ENV:Body></SOAP
                  > > -ENV:Envelope>
                  > > >
                  > > > Result: Expected = "\r\n\t\r\n\t" // Actual = nil
                  > >
                  > > XML instance I sent does not have 'xml:space="preserve"'.
                  > > So I think I should NOT require "\r\n\t\r\n\t" will be
                  > > returned. Is this right?
                  > >
                  > > In XML Schema spec., whiteSpace in xsd:string is defined
                  > > to be preserved by default, so XML Schema processor must
                  > > preserve whiteSpaces. But XML processor will not know
                  > > this without xml:space="preserve" notation.
                  > >
                  > > I'm now thinking I should add 'xml:space="preserve"' to
                  > > all SOAP messages which contains xsd:string...
                  > >
                  > > Am I wrong?
                  > >
                  > > To unsubscribe from this group, send an email to:
                  > > soapbuilders-unsubscribe@yahoogroups.com
                  > >
                  > >
                  > >
                  > > Your use of Yahoo! Groups is subject to
                  > > http://docs.yahoo.com/info/terms/
                  > >
                  > >
                  > > To unsubscribe from this group, send an email to:
                  > > soapbuilders-unsubscribe@yahoogroups.com
                  > >
                  > >
                  > >
                  > > Your use of Yahoo! Groups is subject to
                  > > http://docs.yahoo.com/info/terms/
                  > >
                  > >
                  >
                  >
                  > __________________________________________________
                  > Do You Yahoo!?
                  > Get personalized email addresses from Yahoo! Mail
                  > http://personal.mail.yahoo.com/
                  >
                  > To unsubscribe from this group, send an email to:
                  > soapbuilders-unsubscribe@yahoogroups.com
                  >
                  >
                  >
                  > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                  >
                • Paul Kulchenko
                  Hi, Bob! ... True, but the tricky part is that it applies ONLY toward REAL end-of-lines, and not to character or entity references (whereas collapse attribute
                  Message 8 of 13 , Jun 29, 2001
                  • 0 Attachment
                    Hi, Bob!

                    > I have always felt that there is no escape from Section 2.11
                    > End-of-
                    > Line handling... the implementation here normalizes line breaks as
                    > specified there prior to parsing.
                    True, but the tricky part is that it applies ONLY toward REAL
                    end-of-lines, and not to character or entity references (whereas
                    collapse attribute applies to all of them), so you may write:

                    <element> </element>

                    and your application will get EXACTLY two chars (0xd and 0xa).

                    but from:

                    <element><!-- two chars 0xd and 0xa are here -->
                    </element>

                    your application should get only one (0xa).

                    I agree that's weird (at least for me) and I would rather do not do
                    any manipulation on element content (except describe for collapse
                    that makes sense), but that's the spec. Does anybody do it right now
                    (I mean 0xd0xa? -> 0xa conversion)? Hopefully parser does this for
                    you.

                    Best wishes, Paul.

                    --- Bob Cunnings <cunnings@...> wrote:
                    > Hello,
                    >
                    > I have always felt that there is no escape from Section 2.11
                    > End-of-
                    > Line handling... the implementation here normalizes line breaks as
                    > specified there prior to parsing.
                    >
                    > It's an interesting discussion!
                    >
                    > RC
                    >
                    > > Hi, Simon!
                    > >
                    > > [NAKAMURA, Hiroshi]
                    > > > XML instance I sent does not have 'xml:space="preserve"'.
                    > > > So I think I should NOT require "\r\n\t\r\n\t" will be
                    > > > returned. Is this right?
                    > > >
                    > > > In XML Schema spec., whiteSpace in xsd:string is defined
                    > > > to be preserved by default, so XML Schema processor must
                    > > > preserve whiteSpaces. But XML processor will not know
                    > > > this without xml:space="preserve" notation.
                    > >
                    > > [Simon Fell]
                    > > > will xml:space="preserve" do the right thing ?
                    > >
                    > > I don't think we need it. XML spec says [1]:
                    > >
                    > > An XML processor must always pass all characters in a document
                    > that
                    > > are not markup through to the application. A validating XML
                    > processor
                    > > must also inform the application which of these characters
                    > constitute
                    > > white space appearing in element content.
                    > >
                    > > A special attribute named xml:space may be attached to an element
                    > to
                    > > signal an intention that in that element, white space should be
                    > > preserved ==by applications==.
                    > >
                    > > So, xml:space says that APPLICATION should preserve those, and
                    > XML
                    > > processor has nothing to do with it. Application may also decide
                    > to
                    > > preserve them without looking into xml:space attribute (at least
                    > > that's what I do :)), so I don't see any problem here.
                    > >
                    > > we may have a problem in this case however because of 2.11
                    > > End-of-Line Handling [2]:
                    > >
                    > > To simplify the tasks of applications, the characters passed to
                    > an
                    > > application by the XML processor must be as if the XML processor
                    > > normalized all line breaks in external parsed entities (including
                    > the
                    > > document entity) on input, before parsing, by translating both
                    > the
                    > > two-character sequence #xD #xA and any #xD that is not followed
                    > by
                    > > #xA to a single #xA character.
                    > >
                    > > It seems like it's quite possible to get "\n\t\n\t" from
                    > > "\r\n\t\r\n\t", and even worse, it's possible to get "1\n2" from
                    > > "1\r\n2" which could make a difference. Moreover, seems like
                    > > xml:space attribute doesn't apply there. Comments?
                    > >
                    > > Best wishes, Paul.
                    > >
                    > > [1] http://www.w3.org/TR/REC-xml#sec-white-space
                    > > [2] http://www.w3.org/TR/REC-xml#sec-line-ends
                    > >
                    > > --- Simon Fell <sfell@...> wrote:
                    > > > this is something that's been worrying me for the last couple
                    > of
                    > > > weeks,
                    > > > xsd:string seems a poor choice for transporting
                    > arbitary/formatted
                    > > > text. (on
                    > > > reflection this seems to be a similar case to the transporting
                    > XML
                    > > > discussions we've already had).
                    > > >
                    > > > will xml:space="preserve" do the right thing ?
                    > > >
                    > > > Cheers
                    > > > Simon
                    > > >
                    > > > -----Original Message-----
                    > > > From: NAKAMURA, Hiroshi [mailto:nahi@...]
                    > > > Sent: Thursday, June 28, 2001 7:22 PM
                    > > > To: soapbuilders@yahoogroups.com
                    > > > Subject: [soapbuilders] xml:space="preserve"?
                    > > >
                    > > >
                    > > > Hi all,
                    > > >
                    > > > I have a question about whiteSpace should be preserved or not.
                    > > >
                    > > > > From: NAKAMURA, Hiroshi [mailto:nahi@...]
                    > > > > Sent: Friday, June 29, 2001 10:58 AM
                    > > >
                    > > > > == Request from SOAP4R.
                    > > >
                    > > > > <SOAP-ENV:Envelope
                    > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    > > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                    > > > xmlns:n1="http://soapinterop.org/"><SOAP-ENV:Body
                    > > > >
                    > > >
                    > >
                    >
                    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><n1:echoS
                    > > > tring><inputString xsi:type="xsd:string">^M
                    > > > > ^M
                    > > > >
                    > > >
                    > </inputString></n1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
                    > > >
                    > > > > == Response from server.
                    > > >
                    > > > > <?xml version="1.0"?><SOAP-ENV:Envelope
                    > > >
                    > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                    > > > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                    > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    > > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    > > > >
                    > > >
                    > >
                    >
                    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><m
                    > > > :echoStringResponse
                    > > > > xmlns:m="http://soapinterop.org/"><Result
                    > > > >
                    > > >
                    > >
                    >
                    xsi:type="xsd:string"></Result></m:echoStringResponse></SOAP-ENV:Body></SOAP
                    > > > -ENV:Envelope>
                    > > > >
                    > > > > Result: Expected = "\r\n\t\r\n\t" // Actual = nil
                    > > >
                    > > > XML instance I sent does not have 'xml:space="preserve"'.
                    > > > So I think I should NOT require "\r\n\t\r\n\t" will be
                    > > > returned. Is this right?
                    > > >
                    > > > In XML Schema spec., whiteSpace in xsd:string is defined
                    > > > to be preserved by default, so XML Schema processor must
                    > > > preserve whiteSpaces. But XML processor will not know
                    > > > this without xml:space="preserve" notation.
                    > > >
                    > > > I'm now thinking I should add 'xml:space="preserve"' to
                    > > > all SOAP messages which contains xsd:string...
                    > > >
                    > > > Am I wrong?
                    > > >
                    > > > To unsubscribe from this group, send an email to:
                    > > > soapbuilders-unsubscribe@yahoogroups.com
                    > > >
                    > > >
                    > > >
                    > > > Your use of Yahoo! Groups is subject to
                    > > > http://docs.yahoo.com/info/terms/
                    > > >
                    > > >
                    > > > To unsubscribe from this group, send an email to:
                    > > > soapbuilders-unsubscribe@yahoogroups.com
                    > > >
                    > > >
                    > > >
                    > > > Your use of Yahoo! Groups is subject to
                    > > > http://docs.yahoo.com/info/terms/
                    > > >
                    > > >
                    > >
                    > >
                    > > __________________________________________________
                    > > Do You Yahoo!?
                    > > Get personalized email addresses from Yahoo! Mail
                    > > http://personal.mail.yahoo.com/
                    > >
                    > > To unsubscribe from this group, send an email to:
                    > > soapbuilders-unsubscribe@yahoogroups.com
                    > >
                    > >
                    > >
                    > > Your use of Yahoo! Groups is subject to
                    > http://docs.yahoo.com/info/terms/
                    > >
                    >
                    >
                    >
                    > To unsubscribe from this group, send an email to:
                    > soapbuilders-unsubscribe@yahoogroups.com
                    >
                    >
                    >
                    > Your use of Yahoo! Groups is subject to
                    > http://docs.yahoo.com/info/terms/
                    >
                    >


                    __________________________________________________
                    Do You Yahoo!?
                    Get personalized email addresses from Yahoo! Mail
                    http://personal.mail.yahoo.com/
                  • Bob Cunnings
                    Paul, Yes, it s the parser that takes care of normalizing line breaks. I do see your point. Maybe the way to look at it is that normalization of the character
                    Message 9 of 13 , Jun 29, 2001
                    • 0 Attachment
                      Paul,

                      Yes, it's the parser that takes care of normalizing line breaks.

                      I do see your point.

                      Maybe the way to look at it is that normalization of the character
                      stream prior to parsing is a different thing than manipulation of
                      element content per se...

                      Does this make sense?

                      RC





                      > Hi, Bob!
                      >
                      > > I have always felt that there is no escape from Section 2.11
                      > > End-of-
                      > > Line handling... the implementation here normalizes line breaks as
                      > > specified there prior to parsing.
                      > True, but the tricky part is that it applies ONLY toward REAL
                      > end-of-lines, and not to character or entity references (whereas
                      > collapse attribute applies to all of them), so you may write:
                      >
                      > <element> </element>
                      >
                      > and your application will get EXACTLY two chars (0xd and 0xa).
                      >
                      > but from:
                      >
                      > <element><!-- two chars 0xd and 0xa are here -->
                      > </element>
                      >
                      > your application should get only one (0xa).
                      >
                      > I agree that's weird (at least for me) and I would rather do not do
                      > any manipulation on element content (except describe for collapse
                      > that makes sense), but that's the spec. Does anybody do it right now
                      > (I mean 0xd0xa? -> 0xa conversion)? Hopefully parser does this for
                      > you.
                      >
                      > Best wishes, Paul.
                      >
                      > --- Bob Cunnings <cunnings@...> wrote:
                      > > Hello,
                      > >
                      > > I have always felt that there is no escape from Section 2.11
                      > > End-of-
                      > > Line handling... the implementation here normalizes line breaks as
                      > > specified there prior to parsing.
                      > >
                      > > It's an interesting discussion!
                      > >
                      > > RC
                      > >
                      > > > Hi, Simon!
                      > > >
                      > > > [NAKAMURA, Hiroshi]
                      > > > > XML instance I sent does not have 'xml:space="preserve"'.
                      > > > > So I think I should NOT require "\r\n\t\r\n\t" will be
                      > > > > returned. Is this right?
                      > > > >
                      > > > > In XML Schema spec., whiteSpace in xsd:string is defined
                      > > > > to be preserved by default, so XML Schema processor must
                      > > > > preserve whiteSpaces. But XML processor will not know
                      > > > > this without xml:space="preserve" notation.
                      > > >
                      > > > [Simon Fell]
                      > > > > will xml:space="preserve" do the right thing ?
                      > > >
                      > > > I don't think we need it. XML spec says [1]:
                      > > >
                      > > > An XML processor must always pass all characters in a document
                      > > that
                      > > > are not markup through to the application. A validating XML
                      > > processor
                      > > > must also inform the application which of these characters
                      > > constitute
                      > > > white space appearing in element content.
                      > > >
                      > > > A special attribute named xml:space may be attached to an element
                      > > to
                      > > > signal an intention that in that element, white space should be
                      > > > preserved ==by applications==.
                      > > >
                      > > > So, xml:space says that APPLICATION should preserve those, and
                      > > XML
                      > > > processor has nothing to do with it. Application may also decide
                      > > to
                      > > > preserve them without looking into xml:space attribute (at least
                      > > > that's what I do :)), so I don't see any problem here.
                      > > >
                      > > > we may have a problem in this case however because of 2.11
                      > > > End-of-Line Handling [2]:
                      > > >
                      > > > To simplify the tasks of applications, the characters passed to
                      > > an
                      > > > application by the XML processor must be as if the XML processor
                      > > > normalized all line breaks in external parsed entities (including
                      > > the
                      > > > document entity) on input, before parsing, by translating both
                      > > the
                      > > > two-character sequence #xD #xA and any #xD that is not followed
                      > > by
                      > > > #xA to a single #xA character.
                      > > >
                      > > > It seems like it's quite possible to get "\n\t\n\t" from
                      > > > "\r\n\t\r\n\t", and even worse, it's possible to get "1\n2" from
                      > > > "1\r\n2" which could make a difference. Moreover, seems like
                      > > > xml:space attribute doesn't apply there. Comments?
                      > > >
                      > > > Best wishes, Paul.
                      > > >
                      > > > [1] http://www.w3.org/TR/REC-xml#sec-white-space
                      > > > [2] http://www.w3.org/TR/REC-xml#sec-line-ends
                      > > >
                      > > > --- Simon Fell <sfell@...> wrote:
                      > > > > this is something that's been worrying me for the last couple
                      > > of
                      > > > > weeks,
                      > > > > xsd:string seems a poor choice for transporting
                      > > arbitary/formatted
                      > > > > text. (on
                      > > > > reflection this seems to be a similar case to the transporting
                      > > XML
                      > > > > discussions we've already had).
                      > > > >
                      > > > > will xml:space="preserve" do the right thing ?
                      > > > >
                      > > > > Cheers
                      > > > > Simon
                      > > > >
                      > > > > -----Original Message-----
                      > > > > From: NAKAMURA, Hiroshi [mailto:nahi@...]
                      > > > > Sent: Thursday, June 28, 2001 7:22 PM
                      > > > > To: soapbuilders@yahoogroups.com
                      > > > > Subject: [soapbuilders] xml:space="preserve"?
                      > > > >
                      > > > >
                      > > > > Hi all,
                      > > > >
                      > > > > I have a question about whiteSpace should be preserved or not.
                      > > > >
                      > > > > > From: NAKAMURA, Hiroshi [mailto:nahi@...]
                      > > > > > Sent: Friday, June 29, 2001 10:58 AM
                      > > > >
                      > > > > > == Request from SOAP4R.
                      > > > >
                      > > > > > <SOAP-ENV:Envelope
                      > > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      > > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                      > > > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                      > > > > xmlns:n1="http://soapinterop.org/"><SOAP-ENV:Body
                      > > > > >
                      > > > >
                      > > >
                      > >
                      > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><n1:echoS
                      > > > > tring><inputString xsi:type="xsd:string">^M
                      > > > > > ^M
                      > > > > >
                      > > > >
                      > > </inputString></n1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
                      > > > >
                      > > > > > == Response from server.
                      > > > >
                      > > > > > <?xml version="1.0"?><SOAP-ENV:Envelope
                      > > > >
                      > > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                      > > > > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                      > > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                      > > > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      > > > > >
                      > > > >
                      > > >
                      > >
                      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><m
                      > > > > :echoStringResponse
                      > > > > > xmlns:m="http://soapinterop.org/"><Result
                      > > > > >
                      > > > >
                      > > >
                      > >
                      > xsi:type="xsd:string"></Result></m:echoStringResponse></SOAP-ENV:Body></SOAP
                      > > > > -ENV:Envelope>
                      > > > > >
                      > > > > > Result: Expected = "\r\n\t\r\n\t" // Actual = nil
                      > > > >
                      > > > > XML instance I sent does not have 'xml:space="preserve"'.
                      > > > > So I think I should NOT require "\r\n\t\r\n\t" will be
                      > > > > returned. Is this right?
                      > > > >
                      > > > > In XML Schema spec., whiteSpace in xsd:string is defined
                      > > > > to be preserved by default, so XML Schema processor must
                      > > > > preserve whiteSpaces. But XML processor will not know
                      > > > > this without xml:space="preserve" notation.
                      > > > >
                      > > > > I'm now thinking I should add 'xml:space="preserve"' to
                      > > > > all SOAP messages which contains xsd:string...
                      > > > >
                      > > > > Am I wrong?
                      > > > >
                      > > > > To unsubscribe from this group, send an email to:
                      > > > > soapbuilders-unsubscribe@yahoogroups.com
                      > > > >
                      > > > >
                      > > > >
                      > > > > Your use of Yahoo! Groups is subject to
                      > > > > http://docs.yahoo.com/info/terms/
                      > > > >
                      > > > >
                      > > > > To unsubscribe from this group, send an email to:
                      > > > > soapbuilders-unsubscribe@yahoogroups.com
                      > > > >
                      > > > >
                      > > > >
                      > > > > Your use of Yahoo! Groups is subject to
                      > > > > http://docs.yahoo.com/info/terms/
                      > > > >
                      > > > >
                      > > >
                      > > >
                      > > > __________________________________________________
                      > > > Do You Yahoo!?
                      > > > Get personalized email addresses from Yahoo! Mail
                      > > > http://personal.mail.yahoo.com/
                      > > >
                      > > > To unsubscribe from this group, send an email to:
                      > > > soapbuilders-unsubscribe@yahoogroups.com
                      > > >
                      > > >
                      > > >
                      > > > Your use of Yahoo! Groups is subject to
                      > > http://docs.yahoo.com/info/terms/
                      > > >
                      > >
                      > >
                      > >
                      > > To unsubscribe from this group, send an email to:
                      > > soapbuilders-unsubscribe@yahoogroups.com
                      > >
                      > >
                      > >
                      > > Your use of Yahoo! Groups is subject to
                      > > http://docs.yahoo.com/info/terms/
                      > >
                      > >
                      >
                      >
                      > __________________________________________________
                      > Do You Yahoo!?
                      > Get personalized email addresses from Yahoo! Mail
                      > http://personal.mail.yahoo.com/
                      >
                      > To unsubscribe from this group, send an email to:
                      > soapbuilders-unsubscribe@yahoogroups.com
                      >
                      >
                      >
                      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.