Jump to content

Issue concerning the xml parser (i guess)


Recommended Posts

Posted

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

Posted

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 :)

Posted

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.

Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...