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

Is this a bug? (I'm pretty sure it's a bug.)

Expand Messages
  • Martin
    Hi all, I have an xref in one of my topics that points to an external URL (something on out intranet). The URL in the href includes &accessible=true. Both the
    Message 1 of 10 , Jun 1, 2008
    • 0 Attachment
      Hi all,

      I have an xref in one of my topics that points to an external URL (something on out intranet). The URL in the href includes &accessible=true.

      Both the OT and my XML editor complain that The reference to entity "accessible" must end with the ';' delimiter.

      This is a perfectly valid URL. Why is the DTD insisting on correct entity syntax within an href attribute? I can understand it in actual content, but in attributes? Doesn't make sense.

      So, is this a bug? (I'm using OT 1.4.1.)

      Cheers,
      --
      Martin Polley
      Technical writer, etc.
      +972 52 3864280
      Calendar—<http://capcloud.com/calendar>
      Site—<http://capcloud.com/>
    • Eric Sirois
      Hi Martin, try & in the href. In attributes, if you want to use the literal value ampresand, but not part of an entity, then it must be escaped. Eric
      Message 2 of 10 , Jun 1, 2008
      • 0 Attachment
        Hi Martin,

        try & in the href. In attributes, if you want to use the literal
        value ampresand, but not part of an entity, then it must be escaped.

        Eric

        Martin wrote:
        >
        > Hi all,
        >
        > I have an xref in one of my topics that points to an external URL
        > (something on out intranet). The URL in the href includes
        > &accessible=true.
        >
        > Both the OT and my XML editor complain that The reference to entity
        > "accessible" must end with the ';' delimiter.
        >
        > This is a perfectly valid URL. Why is the DTD insisting on correct
        > entity syntax within an href attribute? I can understand it in actual
        > content, but in attributes? Doesn't make sense.
        >
        > So, is this a bug? (I'm using OT 1.4.1. <http://1.4.1.>)
        >
        > Cheers,
        > --
        > Martin Polley
        > Technical writer, etc.
        > +972 52 3864280
        > Calendar—<http://capcloud.com/calendar <http://capcloud.com/calendar>>
        > Site—<http://capcloud.com/ <http://capcloud.com/>>
        >
        >
      • Martin
        Hi Eric, Thanks, I ll try using the & entity. The odd thing is, I ve had hrefs with this in before now, and never noticed that they caused any problems. I ve
        Message 3 of 10 , Jun 1, 2008
        • 0 Attachment
          Hi Eric,

          Thanks, I'll try using the &amp; entity.

          The odd thing is, I've had hrefs with this in before now, and never noticed that they caused any problems. I've only seen this with the latest version of the toolkit...

          Thanks,

          Martin


          On Sun, Jun 1, 2008 at 5:48 PM, Eric Sirois <easirois@...> wrote:

          Hi Martin,

          try &amp; in the href. In attributes, if you want to use the literal
          value ampresand, but not part of an entity, then it must be escaped.

          Eric



          Martin wrote:
          >
          > Hi all,
          >
          > I have an xref in one of my topics that points to an external URL
          > (something on out intranet). The URL in the href includes
          > &accessible=true.
          >
          > Both the OT and my XML editor complain that The reference to entity
          > "accessible" must end with the ';' delimiter.
          >
          > This is a perfectly valid URL. Why is the DTD insisting on correct
          > entity syntax within an href attribute? I can understand it in actual
          > content, but in attributes? Doesn't make sense.
          >
          > So, is this a bug? (I'm using OT 1.4.1. <http://1.4.1.>)

          >
          > Cheers,
          > --
          > Martin Polley
          > Technical writer, etc.
          > +972 52 3864280
          > Calendar—<http://capcloud.com/calendar <http://capcloud.com/calendar>>
          > Site—<http://capcloud.com/ <http://capcloud.com/>>
          >
          >


        • Deborah Pickett
          ... noticed ... version ... That could be because the XML parser used in that pipeline stage (gen-list, at a guess) may have been updated or changed, and it is
          Message 4 of 10 , Jun 1, 2008
          • 0 Attachment
            --- In dita-users@yahoogroups.com, Martin <martin.polley@...> wrote:
            > The odd thing is, I've had hrefs with this in before now, and never
            noticed
            > that they caused any problems. I've only seen this with the latest
            version
            > of the toolkit...

            That could be because the XML parser used in that pipeline stage
            (gen-list, at a guess) may have been updated or changed, and it is
            suddenly no longer forgiving of this very common XML-encoding error.

            I believe that from about DITA-OT 1.4, some code did change in that
            early part of the preprocessing, and DITA-OT (or Java on its behalf)
            began to do extra validation of the input documents. For me it
            coincided with a jump to Saxon 9, which may or may not be coincidental.

            A similar thing is going to happen if you switch to using an XSLT
            parser that doesn't tolerate backslashes in URLs.

            Martin, if the bad URL was produced by an authoring tool, you should
            raise it as a bug with them. The XML spec is pretty clear about
            needing to escape ampersands inside attribute values.
          • Martin
            Hi Deborah, The URL *was *generated by an authoring tool (albeit a legacy one). But I don t see anything wrong with the URL (lots of URLs contain query strings
            Message 5 of 10 , Jun 1, 2008
            • 0 Attachment
              Hi Deborah,

              The URL was generated by an authoring tool (albeit a legacy one). But I don't see anything wrong with the URL (lots of URLs contain query strings that include ampersands). Good to know that I can escape it.

              In any case, with experimentation, I have found that lopping the &accessible=true query off the end of the URL makes absolutely no difference.

              Thanks,

              Martin


              On Mon, Jun 2, 2008 at 4:25 AM, Deborah Pickett <deborah_pickett@...> wrote:

              --- In dita-users@yahoogroups.com, Martin <martin.polley@...> wrote:
              > The odd thing is, I've had hrefs with this in before now, and never
              noticed
              > that they caused any problems. I've only seen this with the latest
              version
              > of the toolkit...

              That could be because the XML parser used in that pipeline stage
              (gen-list, at a guess) may have been updated or changed, and it is
              suddenly no longer forgiving of this very common XML-encoding error.

              I believe that from about DITA-OT 1.4, some code did change in that
              early part of the preprocessing, and DITA-OT (or Java on its behalf)
              began to do extra validation of the input documents. For me it
              coincided with a jump to Saxon 9, which may or may not be coincidental.

              A similar thing is going to happen if you switch to using an XSLT
              parser that doesn't tolerate backslashes in URLs.

              Martin, if the bad URL was produced by an authoring tool, you should
              raise it as a bug with them. The XML spec is pretty clear about
              needing to escape ampersands inside attribute values.


            • Deborah Pickett
              ... Yes, and while the URL contains naked ampersands quite happily, it s when you have to write it as an attribute in an XML document that you have to escape
              Message 6 of 10 , Jun 1, 2008
              • 0 Attachment
                --- In dita-users@yahoogroups.com, Martin <martin.polley@...> wrote:
                > (lots of URLs contain query strings that include ampersands)

                Yes, and while the URL contains naked ampersands quite happily, it's
                when you have to write it as an attribute in an XML document that you
                have to escape the string.

                So a URL
                http://www.google.com/search?q=%26&ie=utf-8
                becomes
                <link href="http://www.google.com/search?q=%26&ie=utf-8"/>
                but that doesn't mean that the URL is
                "http://www.google.com/search?q=%26&ie=utf-8". That's just the
                XML serialization of the string.*

                Authoring tools that happily stick text into an attribute without
                escaping it are going to barf horribly on attribute values like
                x" foo="y
                which of course should be encoded into an attribute as
                <element attr="x" foo="y"/>
                not
                <element attr="x" foo="y"/>
                I am sorry to say that such mistakes are still being made in XML
                authoring tools today. (And that said software companies have a thing
                or two to learn about SQL injection, too.)

                * To make matters worse, I recall that there used to be a prohibition
                *against* HTML-escaping ampersands in an older version of HTML. I
                can't find the reference now, but perhaps your old authoring tool is
                from that era.
              • doiheartwentyone
                Hello all, I d like to know what the best practice is for including small examples in DITA topics (and, possibly, to express my surprise that specialization
                Message 7 of 10 , Jun 2, 2008
                • 0 Attachment
                  Hello all,

                  I'd like to know what the best practice is for including small
                  examples in DITA topics (and, possibly, to express my surprise that
                  specialization seems to be required)

                  Basically, I've got a list of usage definitions, each of which has an
                  explanation and a mini-example flagged with an icon. I'd like to
                  present them as a definition-list, with the example in the right
                  column as the last paragraph of the description, but unfortunately
                  <example> is a kind of <section> and therefore can't go there. I've
                  had three ideas so far

                  1)
                  specialize <note> with an othertype of "example" and put this in <dd>
                  2)
                  specialize <topic> in the manner of <glossentry> but allow something
                  like <glossdetail> after the <glossdef> which can in turn contain
                  <example>
                  3)
                  use the standard <glossentry> and the specialization of <note>
                  described in 1)

                  More generally, what's the consensus on using <glossentry> versus
                  <dlentry> ?

                  grds
                  dave
                  .
                • doiheartwentyone
                  (Please excuse this being marked as a reply to the other thread. I foolishly clicked reply as web post on the digest)
                  Message 8 of 10 , Jun 2, 2008
                  • 0 Attachment
                    (Please excuse this being marked as a reply to the other thread.
                    I foolishly clicked "reply as web post" on the digest)
                  • Eliot Kimber
                    ... I just use , e.g.: pre Use the pre element like so: <pre>Example stuff goes here</pre>
                    Message 9 of 10 , Jun 2, 2008
                    • 0 Attachment
                      On 6/2/08 5:09 AM, "doiheartwentyone" <yahoo@...> wrote:

                      > Hello all,
                      >
                      > I'd like to know what the best practice is for including small
                      > examples in DITA topics (and, possibly, to express my surprise that
                      > specialization seems to be required)

                      I just use <pre>, e.g.:

                      <dl>
                      <dlentry>
                      <dt>pre</dt>
                      <dd>Use the pre element like so:
                      <pre>
                      <pre>Example stuff goes here</pre>
                      </pre>
                      </dd>
                      </dlentry>
                      </dl>

                      The example element is really designed for use within reference entries as
                      one of a number of pre-defined section types. It's not really intended to be
                      a general purpose example container.

                      If you want your example content to have a more specific semantic then you
                      need to specialize, which is what specialization is for.

                      Cheers,

                      Eliot

                      --
                      Eliot Kimber
                      Senior Solutions Architect
                      "Bringing Strategy, Content, and Technology Together"
                      Main: 610.631.6770
                      www.reallysi.com
                      www.rsuitecms.com
                    • Deborah Pickett
                      ... [...] ... They re all plausible. A variation of (1) is to specialize directly: remember that a can contain more than one . Of course,
                      Message 10 of 10 , Jun 2, 2008
                      • 0 Attachment
                        --- In dita-users@yahoogroups.com, "doiheartwentyone" <yahoo@...> wrote:
                        > Basically, I've got a list of usage definitions, each of which has an
                        > explanation and a mini-example flagged with an icon. I'd like to
                        > present them as a definition-list, with the example in the right
                        > column as the last paragraph of the description

                        [...]

                        > 1)
                        > specialize <note> with an othertype of "example" and put this in <dd>
                        > 2)
                        > specialize <topic> in the manner of <glossentry> but allow something
                        > like <glossdetail> after the <glossdef> which can in turn contain
                        > <example>
                        > 3)
                        > use the standard <glossentry> and the specialization of <note>
                        > described in 1)

                        They're all plausible. A variation of (1) is to specialize <dd>
                        directly: remember that a <dlentry> can contain more than one <dd>.
                        Of course, that means you can only use this construct inside (your
                        specialization of a) <dl>, which might be too restrictive. That
                        depends on how you want to constrain your authors' use of this element.

                        As for whether you should specialize a block element like <dd> or
                        <note>, or a topic element like <glossentry>: ask yourself if the
                        example can stand alone, or whether it doesn't have enough context to
                        be its own topic. My gut feeling based on your description is that
                        they need the context, so I'd specialize off <dd> or something of
                        similar size.
                      Your message has been successfully submitted and would be delivered to recipients shortly.