» davids list
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

davids list

acl(admin devvvv vvvvgroup)

Patch-Format (XML)

There are several weird structures which are pretty bad to interpret with common XML Parsers. Since XML is a very flexible format for storing data it makes sense to use it, especially when we are planning to provide different interfaces for vvvv patches. These intefaces could/should be able to process the XML Tree easily. This is't provided right now. Here are my hints:

  • Actual data should be stored in elements, not in attributes. There is no rule about it. But i think it is smart to differ between enumerated information (e.g.slicecount and visible) and flexible information (e.g. value of slices).
  • therefore the element PIN should have childelemts SLICE for every sclice. Right now we have an attribute value, which contains all values of all slices as a comma separated string. Especially for storing strings containing a comma again this is no good. you can never teach a common xml parser to split that string into the right slices.
  • element BOUNDS is a self closing element so it should close itself
  • element LINK is the same.

here is what i think:

{CODE(ln=>1)} <PATCH nodename="something.v4p">

    <NODE id="2" nodename="IoBox (String)">
      <BOUNDS height="" left="" top="" type="" width="" />
      <LINK dstnodeid="" dstpinname="" hiddenwhenlocked="" srcnodeid="" srcpinname="" />
      <PIN pinname="" slicecount="">
        <SLICE>content of slice 0</SLICE>
        <SLICE>content of slice 1</SLICE>
        <SLICE>content of slice 2</SLICE>
      </PIN>
   </NODE>
 </PATCH>^

for conversion with old releases there would be a need of a converter. which should not be a problem because that would be just the processing of the xml as it is right now into the new format.

Saving binary data within a patch

Saving a patch wich includes a binary byte string (e.g in a IOBox) causes vvvv to reject the patch when trying to reopen it. This is no good. The problem: XML is not made for storing binary data. There is a common workaround though: encode the strings as a base64 byte stream. when open a patch recover that stream to its original byte stream.

See:http://www.flipcode.com/cgi-bin/fcarticles.cgi?show=64114http://www.xml.com/pub/a/98/07/binary/binary.html


i´d suggest different encodings -- as base64 might be cool for embedding jpgs, for normal text strings it would be great if they are somehow readable in the xml source file
but aren´t cdata sections for storing 8bit data?

  • oschatz

That was my thought too. But how to differ between different string types? Example: We have two IOBoxes: one with the string "hello world" the other with a binary data (e.g. a jpeg file). how should vvvv know which encoding it has to use? same problem with loading a patch!

either just check it or encode just the characters which are not valid within xml (should be 98% of all 8bit chars anyway) -oschatz

anonymous user login

Shoutbox

~3mth ago

joreg: END OF SHOUTBOX! As this page has is now legacy, it will no longer feature new content. For latest news, see: http://vvvv.org

~4mth ago

joreg: vvvvTv S0204 is out: Custom Widgets with Dear ImGui: https://youtube.com/live/nrXfpn5V9h0

~4mth ago

joreg: New user registration is currently disabled as we're moving to a new login provider: https://visualprogramming.net/blog/2024/reclaiming-vvvv.org/

~4mth ago

joreg: vvvvTv S02E03 is out: Logging: https://youtube.com/live/OpUrJjTXBxM

~4mth ago

~4mth ago

joreg: Follow TobyK on his Advent of Code: https://www.twitch.tv/tobyklight

~4mth ago

joreg: vvvvTv S02E02 is out: Saving & Loading UI State: https://www.youtube.com/live/GJQGVxA1pIQ

~4mth ago

joreg: We now have a presence on LinkedIn: https://www.linkedin.com/company/vvvv-group

~5mth ago

joreg: vvvvTv S02E01 is out: Buttons & Sliders with Dear ImGui: https://www.youtube.com/live/PuuTilbqd9w

~5mth ago

joreg: vvvvTv S02E00 is out: Sensors & Servos with Arduino: https://visualprogramming.net/blog/2024/vvvvtv-is-back-with-season-2/