Regular Expression question

G

Guest

I have a form containing an HTML editor to permit users to create templates
similar to Word's templates. I'm having to do it this way as we need to save
the template layout in SQL Server. Anyway ...

Based on the user's work area and the process they've selected to create the
template for, a dropdown list containing allowable data fields is populated.
The user then has the ability to select a data field and place it wherever
they wish within the template. A typical example of the HTML code generated
for such a data field is as follows:
<span contenteditable="false" style="color: #000000; background-color:
#ffff00">{{Date}}</span>

My problem is I need to convert the HTML into XSL to feed a Windows Service
that will take the XSL and a dataset and merge them together. In order to do
so, I need to strip out <span contenteditable="false" style="color: #000000;
background-color: #ffff00">{{ as well as }}</span>.

In place of the first phrase, I need to replace it with something like
<xsl:value-of select=", followed (in this example) by Date, and followed by
"/>. In other words, the output for this example should be as follows:
<xsl:value-of select="Date" />

How must I code my Regular Expression to accomplish this?
 
A

Armin Zingler

AlBruAn said:
I have a form containing an HTML editor to permit users to create
templates similar to Word's templates. I'm having to do it this way
as we need to save the template layout in SQL Server. Anyway ...

Based on the user's work area and the process they've selected to
create the template for, a dropdown list containing allowable data
fields is populated. The user then has the ability to select a data
field and place it wherever they wish within the template. A
typical example of the HTML code generated for such a data field is
as follows:
<span contenteditable="false" style="color: #000000;
background-color: #ffff00">{{Date}}</span>

My problem is I need to convert the HTML into XSL to feed a Windows
Service that will take the XSL and a dataset and merge them
together. In order to do so, I need to strip out <span
contenteditable="false" style="color: #000000; background-color:
#ffff00">{{ as well as }}</span>.

In place of the first phrase, I need to replace it with something
like <xsl:value-of select=", followed (in this example) by Date, and
followed by "/>. In other words, the output for this example should
be as follows: <xsl:value-of select="Date" />

How must I code my Regular Expression to accomplish this?


RegEx is not specific to the VB.Net language, so the better group to ask is
a .Net Framework group (m.p.dotnet.framework.*)


Armin
 
G

Guest

Thanks. I think I'll just use the Replace function in StringBuilder to
accomplish the same.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top