Jump to content

Losing space in XML rule


Recommended Posts

Trying to make an XML template that puts two fields together with a space in between. Here is the code below I get the two fields combined but I lose the space between. I have tried every thing I could find to get this to work. If I convert to JavaScript in the rule builder I see the space is gone. I can type it back in in the script and it works.

Can anyone point me in the right direction to fix this?






<?xml version="1.0" encoding="ISO-8859-1" ?>
<template_rule name="1_Combine Text with space Rule" version="1.0" taggedtext="false" type="text">
<rulename language="en-US">Combine Text with space</rulename>
<Comment language="en-US">Use this to combine two fields with a space between</Comment>
<Description language="en-US">Choose 2 fields to combine.</Description>

 <field type="FIELDLIST" required="true">
   <prompt language="en-US">Left field to combine</prompt>
  <field type="FIELDLIST">
   <prompt language="en-US">Right field to combine</prompt>

var fullName = Field(Var1) + " " + Field(Var2);
return fullName;

Link to comment
Share on other sites

The template as posted works fine for me with FusionPro 8 on Mac, and the space shows up in the converted JavaScript rule. However, in earlier versions, the XML may have been parsed differently. In any case, changing the code to this should make it work in any version:

var fullName = Field(Var1) + "&[size=2]#[/size]32;" + Field(Var2);
return fullName;

Link to comment
Share on other sites


Thanks for your fast reply. Per another post of yours I had tried that. Just tried again and still wont work. I even tried it with taggedtext=true and false.

I tried to find the same senario in one of the included templates but did not find any. I guess I will just have to teach the operators to convert to JS and fix it there.

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.

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...