Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » XML template behaviour
XML template behaviour [message #201779] Thu, 11 October 2007 03:57 Go to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Hello,

If I define a template in XML Files then the behaviour is that the shortcut
will not be replaced but the template is added:

Example:

I would like to define the following template:

<para>
<programlisting>

<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"

parse="text" href="../examples/${cursor}" />

</programlisting>

</para>



I can not define for example: <pl> as a template as then the result of this
template would be:

<pl> <para>
<programlisting>

<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"

parse="text" href="../examples/${cursor}" />

</programlisting>

</para>

Java templates replace the orginal string. Is there a way to do this also in
XML Files templates or shall I post a feature request for this?

Best regards, Lars
Re: XML template behaviour [message #201926 is a reply to message #201779] Thu, 11 October 2007 19:46 Go to previous message
David Carver is currently offline David CarverFriend
Messages: 174
Registered: July 2009
Senior Member
Lars Vogel wrote:
> Hello,
>
> If I define a template in XML Files then the behaviour is that the shortcut
> will not be replaced but the template is added:
>
> Example:
>
> I would like to define the following template:
>
> <para>
> <programlisting>
>
> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
>
> parse="text" href="../examples/${cursor}" />
>
> </programlisting>
>
> </para>
>
>
>
> I can not define for example: <pl> as a template as then the result of this
> template would be:
>
> <pl> <para>
> <programlisting>
>
> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
>
> parse="text" href="../examples/${cursor}" />
>
> </programlisting>
>
> </para>
>
> Java templates replace the orginal string. Is there a way to do this also in
> XML Files templates or shall I post a feature request for this?

Lars, the XML Templates will replace the existing tag, the problem is
that you are using what looks like to be xml tag as your template name.
If you just had pl with out the < and > surrounding it, and then used
CTRL+SPACE to bring up the proposed templates, it will replace the
template text.

Because what you typed could be the start of a valid tag, it doesn't
replace it but inserts your code.

You may want to report it as a feature or bug fix request. But I
believe it does work as it was designed too.

Dave
Previous Topic:duplicate jar entry error
Next Topic:Publishing in WTP 2.0.x vs WTP 1.5.x
Goto Forum:
  


Current Time: Tue Apr 16 20:47:43 GMT 2024

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

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

Back to the top