Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quotes in <value> auto-escaped #19

Closed
TK009 opened this issue Nov 22, 2018 · 3 comments
Closed

quotes in <value> auto-escaped #19

TK009 opened this issue Nov 22, 2018 · 3 comments

Comments

@TK009
Copy link
Contributor

TK009 commented Nov 22, 2018

Problems

  1. O-MI node accepts values containing quotes without escaping, but automatically escapes it in read results. (Which is correct escape or not to escape?)
  2. Read result is escaped twice

Testing write request

<omiEnvelope xmlns="http://www.opengroup.org/xsd/omi/1.0/" version="1.0" ttl="0">
  <write msgformat="odf">
    <msg>
      <Objects xmlns="http://www.opengroup.org/xsd/odf/1.0/">
        <Object>
          <id>MyObject</id>
          <InfoItem name="quotesInValue">
            <value type="xs:string">"test"</value>
          </InfoItem>
          <InfoItem name="ampInValue">
            <value>test&amp;test</value>
          </InfoItem>
        </Object>
      </Objects>
    </msg>
  </write>
</omiEnvelope>

Read result

<omiEnvelope ttl="10" version="1.0" xmlns="http://www.opengroup.org/xsd/omi/1.0/">
  <response>
    <result msgformat="odf">
      <return returnCode="200">
      </return>
      <msg>
        <Objects xmlns="http://www.opengroup.org/xsd/odf/1.0/">
          <Object>
            <id>MyObject</id>
            <InfoItem name="quotesInValue">
              <value unixTime="1541609326"
                dateTime="2018-11-07T18:48:46.359+02:00"
                >&quot;test&quot;</value>
            </InfoItem>
            <InfoItem name="ampInValue">
              <value unixTime="1541609715"
                dateTime="2018-11-07T18:55:15.222+02:00"
                >test&amp;test</value>
            </InfoItem>
          </Object>
        </Objects>
      </msg>
    </result>
  </response>
</omiEnvelope>

Expected read result (?)

<omiEnvelope ttl="10" version="1.0" xmlns="http://www.opengroup.org/xsd/omi/1.0/">
  <response>
    <result msgformat="odf">
      <return returnCode="200">
      </return>
      <msg>
        <Objects xmlns="http://www.opengroup.org/xsd/odf/1.0/">
          <Object>
            <id>MyObject</id>
            <InfoItem name="quotesInValue">
              <value unixTime="1541609326"
                dateTime="2018-11-07T18:48:46.359+02:00"
                >"test"</value>
            </InfoItem>
            <InfoItem name="ampInValue">
              <value unixTime="1541609715"
                dateTime="2018-11-07T18:55:15.222+02:00"
                >test&amp;test</value>
            </InfoItem>
          </Object>
        </Objects>
      </msg>
    </result>
  </response>
</omiEnvelope>
@TK009 TK009 added the bug label Nov 22, 2018
@TK009
Copy link
Contributor Author

TK009 commented Nov 22, 2018

Double escaping fixed for v1.0.8 release

@TK009 TK009 changed the title quotes in <value> auto-escaped, read result double escaped quotes in <value> auto-escaped Nov 22, 2018
@TK009
Copy link
Contributor Author

TK009 commented Nov 22, 2018

dependency issue: scala/scala-xml#57

@TK009 TK009 added enhancement and removed bug labels May 2, 2019
@TK009
Copy link
Contributor Author

TK009 commented May 20, 2019

Fixed in version 2.0.0

@TK009 TK009 closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant