» 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

~8d ago

joreg: Postponed: Next vvvv beginner course starting April 29: https://thenodeinstitute.org/courses/vvvv-beginner-class-summer-2024/

~1mth ago

~1mth ago

joreg: The Winter Season of vvvv workshops is now over but all recordings are still available for purchase: https://thenodeinstitute.org/ws23-vvvv-intermediates/

~2mth ago

schlonzo: Love the new drag and drop functionality for links in latest previews!

~2mth ago

joreg: Workshop on 29 02: Create Sequencers and Precise Clock Based Tools. Signup here: https://thenodeinstitute.org/courses/ws23-vvvv-08-create-sequencers-and-precise-clock-based-tools-in-vvvv-gamma/