format string like xml attribute

Dec 4, 2013 at 3:56am

format string like xml attribute

Hi, does anybody know how to format a string in Max like this?
startSample=”1320200″

I tried with combine, sprint, text object… All the time, the quotes are cleared.

Thank you very much for hints!

#274674
Dec 4, 2013 at 11:19am

How about that?

<code>

– Pasted Max Patch, click to expand. –

</code>

#274727
Dec 4, 2013 at 1:56pm

Hi Emmanuel, thank you very much. Funny, that you are using different quotes than me. I didn’t know that these “other” quotes exist.
I tried to use sprintf like this: sprintf startSample”%d” – in this way the quotes are deleted in object creation. Your quotes ” are different (in this forum, the font seems to be the same for both types) – they stay there. I’m only not sure, if they’re accepted by XML parsers. I’m going to try it.
Thanks, Martin

#274743
Dec 5, 2013 at 4:08am

I used straight double quote which is standard ASCII which is what XML wants AFAIK.

#274814
Dec 5, 2013 at 6:47am

Normally I use shift+2 to get quotes on my (german) MB Pro keyboard. These quotes disappear after object creation. I have to use alt+2 to get your type of quotes, which stay in the object…Strange ;)

#274827
Dec 5, 2013 at 7:43am

Emmanuel, a hypertext research for “straight double” doesn’t show any result on the Wikipedia page. Are you refering to the “quotation mark” (the first glyph in the table, code U+0022) ? If i copy paste that glyphe from wikipedia into replacing your pasted patcher quotes, they disappear… those seem to be the standard Max quotes, which are difficult to output from a sprintf box (best i succeeded :
<code>

– Pasted Max Patch, click to expand. –

</code>
)

#274834
Dec 5, 2013 at 9:08am

well my bad… I must have fall asleep on the option key while doing that ;-) You have to escape the straight double quotes with a \.

<code>

– Pasted Max Patch, click to expand. –

</code>

#274856
Dec 5, 2013 at 3:24pm

Oh, so [text] gets the quotes right ! THough it doens’t output them right… but that’s another problem maybe

#274895

You must be logged in to reply to this topic.