Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > XML Dialog Boxes


Thread Tools Search this Thread Display Modes
Old March 29th, 2018, 03:58 AM
macfan55 macfan55 is offline
Junior Community Member
Join Date: Apr 2011
Location: Netherlands - Emmen
Posts: 37
Unhappy error in xml file: Expected an attribute value...

Hi everyone;
I am trying to build my first xml rule to be used in FusionPro as a rule for every new job to choose. But I got stuck on the following error code:
Fatal error: Expected an attribute value; line 2, column 21

I hereby past te xml-code in this thread:

<?xml version="1.0" encoding="UTF-16" ?>
<template_rule name=“Postcode spatie” version="1.0" type="text" taggedtext="false">
<Comment language="en-US">Deze rule plaatst een spate in de postcode waar die ontbreekt.</Comment>
<Description language="en-US">Please select the appropriate values.</Description>
<Description language="de">Wählen Sie die entsprechenden Werte.</Description>
<Description language="fr">Veuillez sélectionner les valeurs appropriées.</Description>
<Description language="es">Seleccione los valores que correspondan.</Description>
<Description language="it">Selezionare i valori appropriati.</Description>
<Description language="zh-CN">请选择相应的值。</Description>
<Description language="zh-TW">請選取適當的值。</Description>
<Description language="ja">該当する値を選択してください。</Description>
<field type="FIELDLIST" required="true">
<prompt language="en-US">Kies het Postcode veld.</prompt>
<prompt language="de">Wählen Sie ein Feld für die Konvertierung in die richtige Buchstabengröße aus.</prompt>
<prompt language="fr">Choisissez un champ pour la conversion dans la casse appropriée.</prompt>
<prompt language="es">Elija un campo para convertir al estilo de mayúsculas y minúsculas deseado.</prompt>
<prompt language="it">Scegliere un campo per la conversione di maiuscole/minuscole.</prompt>
<prompt language="zh-CN">选择用于转换为适当大小写的字段。</prompt>
<prompt language="zh-TW">選擇要轉換成適當大小寫的欄位。</prompt>
<prompt language="ja">該当する大文字/小文字に変換するフィールドを選択します。</prompt>


if (Len(Trim(Field(Var1))) == 6)
x = Left(Field(Var1), 4);
y = Right(Field(Var1), 2);
return x + " " + y;
else if (Len(Trim(Field(Var1))) == 2)
return FormatNumber("00000", Field(Var1));

return Field(Var1);

Reply With Quote
Old March 29th, 2018, 10:24 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,694
Default Re: error in xml file: Expected an attribute value...

The message is pointing directly to the problem. At line 21, column 2, you have what appears to be a "curly" quote. There are others on that second line as well. You need to use regular "straight" quotes instead. I recommend using a text editor that doesn't do those types of replacements. Or disable those replacements in your editor.

You also need an ending </fieldlist> tag before the <code> tag.
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
Old March 30th, 2018, 03:03 AM
macfan55 macfan55 is offline
Junior Community Member
Join Date: Apr 2011
Location: Netherlands - Emmen
Posts: 37
Default Re: error in xml file: Expected an attribute value...

Thanks for your answer; I never saw the curly braces but yes, it was probably inserted while typing in Texteditor from Apple... They think to much for their users... Now I use TextWrangler; After adding the </fieldlist> it worked without any problem. Thanks again! Greetings from the Netherlands!
Reply With Quote

xml template rule

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 03:58 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.