assigning a value including ' and " and ,

  • Hi,

    How can we assign a value including ' and " and , to variables ?

    For example,

    Code
    set(text1,'width=107", and');trace('text1=[', get(text1), ']');


    This works properly.
    I get text1=[width=107", and] in display area.


    But,

    Code
    set(text2, 'width=107", and it's');trace('text2=[', get(text2), ']');

    This doesn't work. Nothing is shown in display.

    Is there any way to do this?


    Best regards,
    tsuyoshi

  • Umalo, thank you for comments.

    I validated my Xml. There is no error.

    In this case, " or " doesn't matter.
    The problem is second '(apostrophe).
    First and last '(apostrophe) are just for bracketing comma(,) and quotation(").
    (Without bracketing, I fount out that it does't work with comma.)

    If we have even number of apostrophes, it's no problem.
    But, if we have odd number of apostrophes, it doesn't work.
    Even it is escaped as ' .

    Best regards,
    tsuyoshi

  • this is not correct. It is syntax that is not valid and that's why nothing happened when started.
    XML manager I use, shows clear parsing error with your code. I gave you working example how to avoid it using codes for special characters that might make your code not valid.

  • Umalo, thanks again.


    With your code, it worked with no errors.
    I found that ’(of It’s) is two byte character, not one byte character.
    When I replaced ’(2byte) with '(1byte) in your code, it didn't work.
    Do I need to replace '(1byte) with ’(2byte) ?


    PS.
    I checked my code in http://www.xmlvalidation.com.

    Input xml is below.

    XML
    <?xml version="1.0"?><action name="xmltest">set(text2, 'width=107", and it's');trace('text2=[', get(text2), ']');</action>

    When I submitted, I got "No errors were found ".
    I appreciate if you could tell me what XML manager you use?
    (I just want to confirm that my code's syntax is wrong...)

  • I use UltraEdit, integrated XML manager.
    It is not perfect in all cases but at least gives indications when basic syntax is not correct like in your case.
    If you need more info, screenshots send me PM with mail where I can send you details.
    regards
    Umalo

  • Umalo, I'll contact you regarding UltraEdit.

    Anyway, is my understanding below right ?

    >I found that ’(of It’s) is two byte character, not one byte character.
    >When I replaced ’(2byte) with '(1byte) in your code, it didn't work.
    >Do I need to replace '(1byte) with ’(2byte) ?

    best regards,
    tsuyoshi

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!