• Hi!

    When using simple Xpath get value by attribute name {attrs/a[@name="Rozmiar pier?cionków"]} it doesnt work because it contains non-standard character ? ó . I couldnt wrap my head around it.

    After long searching I found https://gist.github.com/trey8611/7b6e79e6610f9d2b06257fb570f05e03 “WP All Import – use XPath Query based on Cyrillic attribute value” from trey8611.

    So for example: Rozmiar pier?cionków

    Encoded with https://mothereff.in/html-entities
    (Enable option “only encode unsafe and non-ASCII characters”)

    Rozmiar pier?cionków => Rozmiar pier&#x15B ;cionk&#xF3 ;w"
    (I added spaces before ; because it would auto decode here even inside code block)

    !!! PASTING IT IN DESCRIPTION VISUAL TEXT EDITOR BREAKS IT
    !!! CHANGE FIRST TO TEXT EDITOR IN WP ALL IMPORT

    Different results:

    0 {attrs/a/@name} --- Rozmiar pier?cionków --- Correct test
    1 {attrs/a[@name="Rozmiar pier?cionków"]} --- Doesnt work
    2 {attrs/a[@name="Rozmiar pier&#x15B ;cionk&#xF3 ;w"]} --- US8 EU17 --- Correct working answer!
    3 {attrs/a[@name="Rozmiar pier&sacute ;cionk&oacute ;w"]} --- Doesnt work
    4 {attrs/a[@name="&#x52 ;&#x6F ;&#x7A ;&#x6D ;&#x69 ;&#x61 ;&#x72 ;&#x20 ;&#x70 ;&#x69 ;&#x65 ;&#x72 ;&#x15B ;&#x63 ;&#x69 ;&#x6F ;&#x6E ;&#x6B ;&#xF3 ;w"]} --- Doesnt work

    (I added spaces before ; because it would auto decode here even inside code block)

    Works for cyrillic characters too.

    Happy imports ??

    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK. Reason: I added spaces before ; because it would auto decode here even inside code block
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
    • This topic was modified 2 years, 4 months ago by LEAX.SK.
  • The topic ‘Xpath with non standard characters {a[@name=”Rozmiar pier?cionków”]} SOLVED!’ is closed to new replies.