Jump to content

error in xml file: Expected an attribute value...


macfan55

Recommended Posts

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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! :)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...