MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   XML Dialog Boxes (http://forums.pti.com/forumdisplay.php?f=37)
-   -   error in xml file: Expected an attribute value... (http://forums.pti.com/showthread.php?t=5123)

macfan55 March 29th, 2018 03:58 AM

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>
<fieldlist>
<field type="FIELDLIST" required="true">
<fieldname>Var1</fieldname>
<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>
<value></value>
</field>

<code>


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));
}
else

return Field(Var1);


</code>
</template_rule>

Dan Korn March 29th, 2018 10:24 AM

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.

macfan55 March 30th, 2018 03:03 AM

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


All times are GMT -7. The time now is 10:12 PM.

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