token limitations

Nov 15, 2012 at 4:03 PM

hello,

i have the following token definition 

<item id="IP_ERR_MANDATORY_FIELD">Field {0} is required.</item>

when i'm trying to buld sandcastle project, i see in the build log an error:

BUILDASSEMBLER : error : SharedContentComponent: The shared content item 'ip_err_mandatory_field' could not be formatted with 0 parameters. [%MY_SECRET_PATH_HERE%\Main\Doc\Services\Help\Working\BuildReferenceTopics.proj]

looks like an issue? or should i encode somehow curly brackets? any help is appreciated. if i remove curly brackets then no any error occurred.

 

thanks,

max

Editor
Nov 15, 2012 at 4:09 PM
Edited Nov 15, 2012 at 4:12 PM

Items can have parameters and they are formatted using the standard .NET formatting conventions.  As such, if your intent is to show a literal "{0}", encode the braces as you would in code ("{{0}}").  If you want to format parameters into the message, you need to have the XSL transformation pass them to the item.  There are several examples in the existing tranformations.  If you need an example, I can post one.

Please note that this project has been discontinued and may not be monitored as frequently. For future questions concerning Sandcastle, post them over on the Sandcastle Help File Builder project's discussion page. Thanks.

Eric

 

Nov 15, 2012 at 4:11 PM

ok, thanks, sounds good.