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

Re: XML-data in SVG files.

Expand Messages
  • Jim Ley
    ... Yes, but it s better not to, why not put it in a metadata element in the page, it s a lot more efficient to not have to call parseXML ? ... Well you won t
    Message 1 of 35 , Nov 1, 2002
    • 0 Attachment
      >Thanks for the help. So what you are saying is that I can use XML-
      >string as follows:

      >var item_xml_data = "<item> <product>Pen</product>
      ><price>19.99</price> <quantity>12</quantity> <discount>20</discount>
      ><make> Parker </make> <code> 123456</code> </item>";

      Yes, but it's better not to, why not put it in a metadata element in the
      page, it's a lot more efficient to not have to call parseXML ?

      >But you said that, I would soon run into problems. Could you please
      >elaborate? What kind of problems?

      Well you won't be able to include CDATA in there and stuff, but basically
      it's not a good idea to put XML in a string, inside javascript in an xml
      document - just keep the xml document in the xml...

      >I may need to exchange large chunks of data between various sub-
      >systems/components. So, I wanted to use XML-strings as data-
      >structures and use them as parameter, while calling functions in
      >other components.

      So pass XML documents around, I don't see the problem, I think you'd need
      to explain why this was a problem.

      >These are just few examples. The main objective is to emulate data-
      >structures. When I am creating SVG file using Servlet/JSP file, I
      >could include many pieces of data along with each component (ex:
      >items that can be selected for shopping).

      if they're trees (and they clearly are) then including the XML in the SVG
      makes completely sense, saves lots of serialising...

      >Is moomin a variable? Can I use parseXML(moomin, null)? It looks
      >like, it has been already parsed. I could also use already parsed-
      >data, if I can pass such variables as parameters in a function.

      It's already parsed, no need to parse it again, much more efficient, and
      of course you can pass the variables around. in javascript everything's
      an object, a string every bit as much as node.

      >How can I implement this?
      >> function buy_me() {
      >> var e = How Can I initialize this variable? < -----------

      you don't need to just get SVGDoc in the init, as a global variable, then
      you just need the getElementById and add_to_cart functions.

      Jim.
    • Tobias Reif
      ... If you don t deploy some other means of validation, you ll have no automatic/programmatic way of knowing if the documents is indeed SVG. Tobi --
      Message 35 of 35 , Nov 7, 2002
      • 0 Attachment
        bharat1_singh wrote:


        > What kind of problems, I will face, If I don't have associated DTD.


        If you don't deploy some other means of validation, you'll have no
        automatic/programmatic way of knowing if the documents is indeed SVG.


        Tobi

        --
        http://www.pinkjuice.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.