I’ve got an xml that I was trying to read in VL attached, that is not valid in VL, but seems ok with vvvv, I’ve just been xpath-ing the data out. The xml is coming from a table node. Any ideas why it isn’t valid, or how to make it so in VL?
in your first screenshot you see that XPathGetValue is still grayed out. because it is generic. this is a feature! since you haven’t yet specified what type you’re expecting it to get, the node is still not running.
obviously all values in xml files are strings at first. but say the string represents an integer and you know that, you can directly connect an integer pin on its output and the node will do the conversion for you. or a float…or a string. see? saves you a conversion node!
what you don’t have to do, is set the template to “generic” because that will make it stop working in vvvv!
for proper validation against a DTD, the IsValid (DTD XML) node in vvvv also needs an external file or internal DTD. otherwise it only tells you if the xml can be parsed or not. the FileReader (XML) in vl already does the parsing, so if it returns something, you know that the file is at least valid in its syntax.
Ok, so had to hit the pad bang onto configure it, I did try yesterday but couldnt hit it right I guess (would it help if you could right click the grey box as well as the pad? I was under the impression the pads would display the content in raw format, seem thats wrong.
So how do you view the xml in vl, so you can look up what paths you need to use? You can’t attch a string pad to the filereader xml, so you have to have another reader?
Lastly, in vvvv I use *//preset to get all presets, how would I do that in VL? It gets the first value, but how do a return a sequence of all of them?
if non-generic, ioboxes would fall back to displaying data as string, if there is no proper iobox for a date available. since in this case it was generic still, it didn’t fallback to anything.
well, if you actually want to see the XML as string, then use ToString->IOBox after the Reader.
same (//preset) only that since you’re now expecting a spread you use XPathGetValues (plural). again the node will initially be grayed out, since generic. but as soon as you connect its output to a Spread input, it will work.
What flavour tostring, there are many, xml doesnt seem to display what I need.
I’m really missing ways of viewing a spread or sequence, an iobox with columns/rows/pages and slice offset, or an inspector One of the great things about vvvv is you can look inside arrays, it makes debugging much easier IMO, and is one of the things that frustes me with code, but at least you can print to a tty. Mostly you just need a quick sanity check, when your rockstar programmers, like you guys, of course you just jack into the port on the back of your neck, but us mere mortals struggle!
ToString [XML] has two outputs. the right one gives you the string!
totally with you on that and i can leak that work on this has already started.
note that just as an alternative you could also use: FileReader (String) -> Parse [XML] which would be more like the vvvv way: first get the string and then parse that into XElement. with FileReader [XML] you can just save one node if you don’t need the string.