5 Replies Latest reply on May 20, 2010 11:12 AM by GordonSmith

    Asdoc constants problem containing "<" or ">".

    er_dadi3

      Hello,

      I have ben working with Asdoc trying to document my library and I found this problem. Several of my classes have constants with "<something>" as value, which is not represented in the final html page as it is recognized as an html tag. I can't find how to fix this issue and it looks pretty bad when you are looking at the documentation and you see the constant has not value (looking at the page source you can see the value but, as I said, "<" is not converted to html which is causing it to be recognized as a tag). Does anyone know how to fix this problem?

       

      Thanks in advance.

        • 1. Re: Asdoc constants problem containing "<" or ">".
          BhaskerChari Level 4

          Try to use the html entities for such type of special characters...

           

           

          Say if you have special character < its html entity equivalent is &lt; and for > is &gt;

           

          So for your constants you can use this way...."<something>" --->  "&lt;something&gt;"

           

          You can find the html entity equivalents for all such type of special chars at http://www.utexas.edu/learn/html/spchar.html

           

          If this post answers your question or helps, please kindly mark it as such.

           

          Thanks,

          Bhasker Chari

          • 2. Re: Asdoc constants problem containing "<" or ">".
            er_dadi3 Level 1

            It only works while documenting, but it doesn't work in the application, so I think this is not the way to fix it. Any other idea?

             

            :S

            • 3. Re: Asdoc constants problem containing "<" or ">".
              GordonSmith Level 4

              You may have found a bug in the ASDoc generator. Can you please give an explicit example of a declaration-with-ASDoc-comment that causes this problem?

               

              Gordon Smith

              Adobe Flex SDK Team

              • 4. Re: Asdoc constants problem containing "<" or ">".
                er_dadi3 Level 1

                Sure, here is what I am seeing:

                 

                Several AS3 classes of my code have public constants like these:

                 

                        /** RCI protocol end tag*/
                        public static const RCI_TAIL:String = "</rci_request>";
                        /** do_command end tag*/
                        public static const RCI_DO_COMMAND_TAIL:String = "</do_command>";
                        /** data opening tag*/
                        public static const RCI_DATA_HEADER:String = "<data>";
                        /** data end tag*/
                        public static const RCI_DATA_TAIL:String = "</data>";

                 

                With those constants I build XML strings and objects that are sent to a web service. If I try to generate documentation for those classes, this is what is displayed in the html page:

                 

                RCI_DATA_TAIL : String =

                [static]  data end tag

                 

                RCI_DO_COMMAND_TAIL : String =

                [static]  do_command end tag

                 

                RCI_DATA_HEADER : String =

                [static]  data opening tag

                 

                RCI_DATA_TAIL : String =

                [static]  data end tag

                 

                As you can see no value is displayed, however other constants have their value correctly displayed like this one:

                 

                HTTP_HEADER : String = http://

                [static]  HTTP protocol prefix

                 

                I am pretty sure it is because of the "<" and ">" characters of the variable. I cannot replace them by &lt; and &gt; because if I do so, my XML strings and objects won't work in my program. However, if I replace them, the documentation is correctly generated.

                 

                Hope that helps.

                 

                Kind regards.

                 

                PS: This is happening in variables and also in comments, I have just tried it.

                • 5. Re: Asdoc constants problem containing "<" or ">".
                  GordonSmith Level 4

                  This definitely sounds like a bug in the ASDoc generator. Could you please file a bug, with this code as an example?

                   

                  As a possible workaround, try writing the < and > inside the String literals as \u003C and \u003E. If that doesn't work, I think you're out of luck until the bug is fixed unless you want to try to fix it yourself. I'm pretty sure that the ASDoc generator is opensource.

                   

                  BTW, it seems strange to have public constants for the syntax of each XML start/end tag. Why not have strings like RCI_REQUEST, DO_COMMAND, and DATA for the tag names? Those wouldn't cause any problems.

                   

                  - Gordon