Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-15-2008, 08:22 AM
Senior Member
 
Posts: 69
Default [SOLVED] Custom zimlet XML parsing error

A former employee implemented a custom zimlet called part_zimlet.zip. It worked until we went to Zimbra 5.0.x.

The purpose of the zimlet is so that if I user highlights a part number such as xxxx-xxxx, a popup displays with details of the item. The details are obtained by querying our host server.

What happens now if is a user highlights a part such as 0001-0001, the following popup displays:
XML Parsing Error: XML or text declaration not at start of entity Location: http://webmail.xxxxx.com/service/pro...0.200%2....etc

To ensure the zimlet is installed, I typed: "zmzimletctl listZimlets all". The custom zimlet does show up - "Installed Zimlet files on this host: part_zimlet".

I extracted the contents of part_zimlet.zip and it contains: config.xml, part.xsl, and part_zimlet.xml.

config.xml contains:
<zimletConfig name="part_zimlet" version="1.0">
<global>
<property name="url">http://10.9.110.200/cgi-bin/db.sh/tools/zimlet.w</property>
<property name="allowedDomains">*</property>
</global>
</zimletConfig>

part.xsl contains:
<zimletConfig name="part_zimlet" version="1.0">
<global>
<property name="url">http://10.9.110.200/cgi-bin/db.sh/tools/zimlet.w</property>
<property name="allowedDomains">*</property>
</global>
</zimletConfig>

part_zimlet.xml contains:
<zimlet name="part_zimlet" version="1.0" description="Cust">
<resource>part.xsl</resource>
<contentObject>
<matchOn>
<regex attrs="ig">[0-9][0-9][0-9][0-9][-][0-9][0-9][0-9][0-9]</regex>
</matchOn>
<toolTip>
<actionUrl target="http://10.9.110.200/cgi-bin/db.sh/tools/zimlet.w" xslt="part.xsl">
<param name="module">part</param>
<param name="keydata">${src.objectContent}</param>
</actionUrl>
</toolTip>
</contentObject>
</zimlet>

Any help in determining what is causing this error will be GREATLY appreciated.

Thanks,
Shannon
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 06:27 AM
Senior Member
 
Posts: 69
Default Re: Custom zimlet XML parsing error

To hopefully increase my chances of receiving a response, I have attached a screen shot of the XML parsing error I am receiving. I would appreciate any help as I cannot figure out why this worked up until recently, although no changes have been made to the Zimlet package.



Thanks,
Shannon
Attached Images
File Type: jpg XMLerror.jpg (18.2 KB, 529 views)
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 08:23 AM
Moderator
 
Posts: 6,237
Default

For collective knowledge:

It looks like the web service being used (referenced in the zimlet's manifest file: http:// address/cgi-bin/db.sh/tools/zimlet.w) was returning an XML document with a newline before the XML declaration (i.e. <?xml ... ?>). This is actually not allowed by the XML specification and it causes an error in the browser; so it looks like an edit of the zimlet.w script is in order.

Possible solutions:

1) Modify the zimlet.w script to not insert a newline at the beginning of the output

2) Modify the zimlet.w script to remove the XML declaration at the top of the document. Because it's alright to have whitespace before the root element but it is not alright to have any whitespace at all before the XML declaration.

Shannon could you update us with the path you choose/if that worked for you?
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 05:38 PM
Senior Member
 
Posts: 69
Default

I used solution number two and it now works perfectly! That is a HUGE monkey off my back.

It is strange though. The zimlet.w had not been changed in two years. Something must have happened somewhere to make the XML declaration break. Oh well...water under the bridge.

Thanks again,
Shannon
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.