Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to write % char within xml that is included for org.eclipse.ui.editors.templates
How to write % char within xml that is included for org.eclipse.ui.editors.templates [message #640849] Tue, 23 November 2010 10:52 Go to next message
Anshul  is currently offline Anshul Friend
Messages: 1
Registered: November 2010
Junior Member
I want to write % char within xml file. Whenever xml is parsed by eclipse it tries to search for localized string since % is used in xml to get localized string from .properties file. Is there a way by which you can exclude % from parsing.

This happens specially when you implement extension point org.eclipse.ui.editors.templates and add new include and specify xml file to read the templates.

For example your included xml file can have this.

<?xml version="1.0" encoding="UTF-8"?>

<templates>

<template name="test" id="xyz"
description="%test.Description" context="java" enabled="true"
> </template>
for(int i;i<10;i++){
${:link('100%')}
}

When i start eclipse and view these templates it comes as

for(int i;i<10;i++){
${:link('100!')}
}
</templates>

note ! mark. while debugging i found that its trying to find localized string which is empty. so ! is displayed.
Re: How to write % char within xml that is included for org.eclipse.ui.editors.templates [message #640887 is a reply to message #640849] Tue, 23 November 2010 12:53 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Anshul wrote:

> for(int i;i<10;i++){
> ${:link('100%')}
> }
>


What if you try %%

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Replace file icons but retain its error markers
Next Topic:List of all visible ( package explorer) resources in workspace
Goto Forum:
  


Current Time: Sun Nov 23 11:16:33 GMT 2014

Powered by FUDForum. Page generated in 0.04187 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software