473,503 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get text from a template variable

Hi,

Here is my task:

- need to get text from a template variable.

For example we have a text with templates "Cars" and "Producers":

"{{Cars|Toyota=blablabla |Moskvitch=blablabla |BMW=blabla ...}}
{{Producers|TableLTD=blablabla |PhoneINC=Developed in 1998 in Kiev,
Ukraine. Phone and INC are partsof altered name PhoneINC etc...}}
{{Producers|TableLTD=babababa |PhoneINC=Since 1997 Kiev was
recotstructed... PhoneINC company established a new lines system
etc...}}"

I have 2 parameters: template name = "Producers" and variable name
"PhoneINC" that means i need to get text between "PhoneINC=" and "}}"
of template "Producers".
Here is some of my thoughts:

foreach ($col_params as $param) //param[0] - variable and param[1]
template name we need to search for
foreach ($content as $templates){//templates is a text where we need
to do search
$template = explode ("}}" , $templates);
foreach( $template as $redo){
$matches2 = Array();
$matches = Array();
$s = eregi("\{\{$param[1].*", $redo, $matches);
//matches[0] = parts of text that contains template with variables
$s = eregi("$param[0] .*", $matches[0], $matches2);
//matches2[0] = parts of text that contains variables with text and
also variables
// that are next after one we searched for, so here is a problem
occurs ???
$cont = explode ("=", $matches2[0]);
}
Please, if anyone can help, give me some advise.
Thank you in advance.

Jul 5 '07 #1
0 1275

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1649
by: Cali | last post by:
Please bear with me, I have been reading about XSL for a couple hours. I have an XML document that contains multiple <page> tags interspersed throughout the tree. <text> .... <page>1</page>...
8
2623
by: Mikey | last post by:
I have an XML document as follows: <Menu> <Group> <Item Text="About Us" AccessRoles="All"> <Group> <Item Text="Option 1" AccessRoles="All" /> <Item Text="Option 2" AccessRoles="All" /> <Item...
4
1900
by: eric.goforth | last post by:
Hello, I'm getting: msxml3.dll (0x80004005) Error while parsing "file:///c:/WWWROOT/includes/Inc.xsl". A name was started with an invalid character. When I put in the "{$sDisabledString}"
2
5435
by: Tjerk Wolterink | last post by:
I have a variable $value as a parameter in the following template: <xsl:template name="myTemplate"> <xsl:param name="value"/> <xsl:if test="$value"> <xsl:value-of select="$value"/> </xsl:if>...
0
7091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7464
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.