Jump to content
Sign in to follow this  
WannaGetHigh

Issue concerning the xml parser (i guess)

Recommended Posts

I'm not used to deal with xml files but when i was developing one of my workflow (show google chrome tab) i couldn't see all of the suggestion it was supposed to be shown. 

 

And after a while i founded that putting the "&" character in the <title> or <subtitle> was making an error.

 

For example this doesn't shows up in Alfred.

 

<items>

 

    <item uid="suggest {query}" arg='plop'>
        <title> a tab </title>
        <subtitle> http://www.alfredforum.com/page/index.html?do=add&category= </subtitle>
        <valid> yes </valid>
        <icon> icon.png </icon>
    </item>
<items>

 

 

But this shows up:

 

 

<items>

 

    <item uid="suggest {query}" arg='plop'>
        <title> a tab </title>
        <subtitle> http://www.alfredforum.com/page/index.html?do=add"and"category= </subtitle>
        <valid> yes </valid>
        <icon> icon.png </icon>
    </item>
<items>

 

 

Maybe i am doing things wrong but this is what i founded. 

 

I am using:

- The latest beta build b105

- Mac osx 10.8.2

 

If you need more information just let me know i'll tell you more :)

 

Have a nice day

 

ps: sorry for the spelling or grammar mistakes :)

 

--

The Lord Of The Loutre

Share this post


Link to post

You need to return formed, escaped XML. In this situation, you would need & instead of &.

 

I'm moving this over to the Workflow questions forum as I'd like to keep the bugs forum as clean as possible :)

Share this post


Link to post

Andrew is correct (obviously) :). Depending on what language you are using, you need to properly escape the XML code for it to work. As I just mentioned in another thread, if you suspect something may be wrong with your XML.. check it alone (away from all other code) by creating a temporary workflow for testing. Inside of it, create a script filter input, set your keyword and such, then in the code area enter:

cat << CODE
<copy/paste your XML here>
CODE

 

Then run that workflow. If you get results, your XML is good. If not, then you have formatting errors somewhere in your XML.

Share this post


Link to post

Ok,

 

i knew i was doing it wrong but even though i made research i didn't find the solution for it.

 

I tested to put &amp instead of & and it work perfectly :)

 

Thanks a lot guys :)

 

Keep the good work you are doing great with this MUST HAVE application ;D

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  
×
×
  • Create New...