sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    XML Attribute

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 3 Posters 457 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F Offline
      fpmalard
      last edited by

      Hello,

      I was wondering if it is possible to store a XML string inside an entity's attribute dictionary.
      I have tried to do that using Attribs sample but it did not let me add the string (I guess JSON or JScript are failing to validate the string once it has "invalid" symbols). Another possible problem is the string length. I was unable to find the attribute string length limit.

      Can I do that?
      Do I need to store/retrieve this XML string as a binary package? If so, do I need to use pack()?

      Regards,
      Fernando.

      1 Reply Last reply Reply Quote 0
      • T Offline
        todd burch
        last edited by

        @fpmalard said:

        Hello,

        I was wondering if it is possible to store a XML string inside an entity's attribute dictionary.

        Sure.

        @unknownuser said:

        I have tried to do that using Attribs sample but it did not let me add the string (I guess JSON or JScript are failing to validate the string once it has "invalid" symbols). Another possible problem is the string length. I was unable to find the attribute string length limit.

        What error did you get? As far as I am aware, there is no arbitrary limit to the key length or the value length.

        @unknownuser said:

        Can I do that?
        Do I need to store/retrieve this XML string as a binary package? If so, do I need to use pack()?

        Regards,
        Fernando.

        I don't think you will need to do that. What specific errors are you getting?
        Todd

        1 Reply Last reply Reply Quote 0
        • F Offline
          fpmalard
          last edited by

          Hi Todd, thank you for your reply.

          I'm doing the following steps:

          • Insert a simple entity like a circle;
          • Right click, Attributes -> Show;
          • Add a "Sample" category;
          • Add a new Attribute, name as "XML" and value as a XML string;
          • Click OK (the XML string appears at the second column of Attribute dialog;
          • Click Accept;
          • Right click again, Attributes -> Show;
          • Error: "Internet Explorer Script Error: Unterminated string constant...Do you want to continue running script on this page?". No matter Yes or No, the dialog stay blank.

          I suspect that the attribute data is still there but as Attributes sample uses a Web dialog to display the information the XML string format is causing the error due its special symbols like <,>,",/, etc.

          Fernando.

          1 Reply Last reply Reply Quote 0
          • T Offline
            todd burch
            last edited by

            Ah, most likely an issue with the attribute script you are using. Where did you get it?

            1 Reply Last reply Reply Quote 0
            • F Offline
              fpmalard
              last edited by

              Todd, I'm using this one:

              404 Not Found

              favicon

              (www.crai.archi.fr)

              1 Reply Last reply Reply Quote 0
              • T Offline
                todd burch
                last edited by

                Do you have a small failing test case?

                1 Reply Last reply Reply Quote 0
                • F Offline
                  fpmalard
                  last edited by

                  Sure,

                  Try this XML string:

                  
                  
                  <?xml version="1.0" encoding="utf-8"?>
                  <soap;Envelope xmlns;xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns;xsd="http://www.w3.org/2001/XMLSchema" xmlns;soap="http://schemas.xmlsoap.org/soap/envelope/">
                    <soap;Body>
                      <CreateTaskInstance xmlns="http://webservices.ofcdesk.com/">
                        <sServiceKey>string</sServiceKey>
                        <sSessionKey>string</sSessionKey>
                      </CreateTaskInstance>
                    </soap;Body>
                  </soap;Envelope>
                  
                  
                  

                  xml1.jpg


                  xml2.jpg

                  1 Reply Last reply Reply Quote 0
                  • Didier BurD Offline
                    Didier Bur
                    last edited by

                    Hi,
                    Why not use Marshall to store/restore very long strings ?
                    This works well to store all kinds of data, even organized as struct objects, in attributes.
                    Look here:http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_m_marshal.html
                    My 2 cts,

                    DB

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement