473,386 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

String function to end at a specific point

Hello,

I have this portion of code:
<xsl:value-of select="substring(Body,1,400)" disable-output-escaping="yes"
/>

Is it possible to code it to stop when it reads the first &lt;/p&gt; instead
of 400.
TIA

Aaron
Jan 26 '06 #1
8 1319

"Aaron" <fr********@aaronminoo.com> wrote in message
news:uH*************@tk2msftngp13.phx.gbl...
Hello,

I have this portion of code:
<xsl:value-of select="substring(Body,1,400)" disable-output-escaping="yes"
/>

Is it possible to code it to stop when it reads the first &lt;/p&gt;
instead
of 400.


Use:

concat(substring-before(substring(Body,1,400) , '&lt;/p&gt;'),
'&lt;/p&gt;')
Cheers,
Dimitre Novatchev

P.S. Certainly, using DOE means 99.99% sure there's something wrong going on
Jan 26 '06 #2
Try:-

<xsl:value-of select="substring-before(Body,'</p>')"
disable-output-escaping="yes" />
"Aaron" wrote:
Hello,

I have this portion of code:
<xsl:value-of select="substring(Body,1,400)" disable-output-escaping="yes"
/>

Is it possible to code it to stop when it reads the first </p> instead
of 400.
TIA

Aaron

Jan 26 '06 #3
Anthony,

It throws an error about having a < in the qoutes. So what I did was added
the end of the of the 1st paragraph was   and then did
<xsl:value-of select="substring-before(Body,' ')"
disable-output-escaping="yes" />

Thanks

Aaron
"AnthonyWJones" <An***********@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Try:-

<xsl:value-of select="substring-before(Body,'</p>')"
disable-output-escaping="yes" />
"Aaron" wrote:
Hello,

I have this portion of code:
<xsl:value-of select="substring(Body,1,400)" disable-output-escaping="yes" />

Is it possible to code it to stop when it reads the first </p> instead
of 400.
TIA

Aaron

Jan 26 '06 #4
Dimitre,

It throws an error about having a &lt; and &gt; in the qoutes. So what I
did was added the end of the of the 1st paragraph was   and then did
<xsl:value-of select="substring-before(Body,' ')"
disable-output-escaping="yes" />

Thanks

Aaron
"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...

"Aaron" <fr********@aaronminoo.com> wrote in message
news:uH*************@tk2msftngp13.phx.gbl...
Hello,

I have this portion of code:
<xsl:value-of select="substring(Body,1,400)" disable-output-escaping="yes" />

Is it possible to code it to stop when it reads the first &lt;/p&gt;
instead
of 400.
Use:

concat(substring-before(substring(Body,1,400) , '&lt;/p&gt;'),
'&lt;/p&gt;')
Cheers,
Dimitre Novatchev

P.S. Certainly, using DOE means 99.99% sure there's something wrong going

on

Jan 26 '06 #5
Aaron,

Sorry about that. I'm using the MS Communities Web interface to reply to
newgroups. It stil has quite a few problems one is that it typed <p> with
appropriate escape codes but between this input and arrival in the group it
had been de-escaped. You should escape the < > as you had in your original
code.

And I'm gonna ditch this daft UI that doesn't yet work. :(

Anthony.

"Aaron" wrote:
Anthony,

It throws an error about having a < in the qoutes. So what I did was added
the end of the of the 1st paragraph was and then did
<xsl:value-of select="substring-before(Body,' ')"
disable-output-escaping="yes" />

Thanks

Aaron
"AnthonyWJones" <An***********@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Try:-

<xsl:value-of select="substring-before(Body,'</p>')"
disable-output-escaping="yes" />
"Aaron" wrote:
Hello,

I have this portion of code:
<xsl:value-of select="substring(Body,1,400)" disable-output-escaping="yes" />

Is it possible to code it to stop when it reads the first </p> instead
of 400.
TIA

Aaron


Jan 26 '06 #6
Thanks anyway.

Aaron

"AnthonyWJones" <An***********@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
Aaron,

Sorry about that. I'm using the MS Communities Web interface to reply to
newgroups. It stil has quite a few problems one is that it typed <p> with appropriate escape codes but between this input and arrival in the group it had been de-escaped. You should escape the < > as you had in your original code.

And I'm gonna ditch this daft UI that doesn't yet work. :(

Anthony.

"Aaron" wrote:
Anthony,

It throws an error about having a < in the qoutes. So what I did was added the end of the of the 1st paragraph was and then did
<xsl:value-of select="substring-before(Body,' ')"
disable-output-escaping="yes" />

Thanks

Aaron
"AnthonyWJones" <An***********@discussions.microsoft.com> wrote in message news:E5**********************************@microsof t.com...
Try:-

<xsl:value-of select="substring-before(Body,'</p>')"
disable-output-escaping="yes" />
"Aaron" wrote:

> Hello,
>
> I have this portion of code:
> <xsl:value-of select="substring(Body,1,400)"

disable-output-escaping="yes"
> />
>
> Is it possible to code it to stop when it reads the first </p> instead > of 400.
>
>
> TIA
>
> Aaron
>
>
>


Jan 26 '06 #7
The "<" character must be escaped.
"Aaron" <fr********@aaronminoo.com> wrote in message
news:uW**************@TK2MSFTNGP11.phx.gbl...
Dimitre,

It throws an error about having a &lt; and &gt; in the qoutes. So what I
did was added the end of the of the 1st paragraph was   and then did
<xsl:value-of select="substring-before(Body,' ')"
disable-output-escaping="yes" />

Thanks

Aaron
"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...

"Aaron" <fr********@aaronminoo.com> wrote in message
news:uH*************@tk2msftngp13.phx.gbl...
> Hello,
>
> I have this portion of code:
> <xsl:value-of select="substring(Body,1,400)" disable-output-escaping="yes" > />
>
> Is it possible to code it to stop when it reads the first &lt;/p&gt;
> instead
> of 400.


Use:

concat(substring-before(substring(Body,1,400) , '&lt;/p&gt;'),
'&lt;/p&gt;')
Cheers,
Dimitre Novatchev

P.S. Certainly, using DOE means 99.99% sure there's something wrong going

on


Jan 26 '06 #8
Dimitre,

I figured out a different solution:

<xsl:value-of select="substring-before(Body,'&lt;/')"
disable-output-escaping="yes" />

Without the / it would not parse.

Thanks again.

Aaron

"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...
The "<" character must be escaped.
"Aaron" <fr********@aaronminoo.com> wrote in message
news:uW**************@TK2MSFTNGP11.phx.gbl...
Dimitre,

It throws an error about having a &lt; and &gt; in the qoutes. So what I did was added the end of the of the 1st paragraph was   and then did <xsl:value-of select="substring-before(Body,' ')"
disable-output-escaping="yes" />

Thanks

Aaron
"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...

"Aaron" <fr********@aaronminoo.com> wrote in message
news:uH*************@tk2msftngp13.phx.gbl...
> Hello,
>
> I have this portion of code:
> <xsl:value-of select="substring(Body,1,400)"

disable-output-escaping="yes"
> />
>
> Is it possible to code it to stop when it reads the first &lt;/p&gt;
> instead
> of 400.

Use:

concat(substring-before(substring(Body,1,400) , '&lt;/p&gt;'),
'&lt;/p&gt;')
Cheers,
Dimitre Novatchev

P.S. Certainly, using DOE means 99.99% sure there's something wrong
going on



Jan 26 '06 #9

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

Similar topics

5
by: ruroma | last post by:
Hello, I have one problem, and can think of two possible solutions but I can't manage to make them work. I'm open to other suggestions if you thik is better. The main function calls...
19
by: Paul | last post by:
hi, there, for example, char *mystr="##this is##a examp#le"; I want to replace all the "##" in mystr with "****". How can I do this? I checked all the string functions in C, but did not...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
5
by: Mart | last post by:
Hi everybody, I plan to have a LOT of SQL string in my app. So I need your advice for this. Is it a good idea to store all my SQL string in the app.config file? For a maintenance point of...
6
by: karthi | last post by:
hi, I need user defined function that converts string to float in c. since the library function atof and strtod occupies large space in my processor memory I can't use it in my code. regards,...
87
by: Robert Seacord | last post by:
The SEI has published CMU/SEI-2006-TR-006 "Specifications for Managed Strings" and released a "proof-of-concept" implementation of the managed string library. The specification, source code for...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
34
by: Larry Hastings | last post by:
This is such a long posting that I've broken it out into sections. Note that while developing this patch I discovered a Subtle Bug in CPython, which I have discussed in its own section below. ...
21
by: Aman JIANG | last post by:
hi I need to do this (convert double to string) fast, safe and portable. Is there any way to do this ? Except the ways following: 1. C++ I/O stream, stringstream (and boost::lexical_cast) 2....
0
by: TG | last post by:
Hi! Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...

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.