Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Thu, 26 Jun 2008 15:43:08 -0700,    group: microsoft.public.xsl        back       


how to question   
Hello,

I have another question

i have text that is 354 characters, how do you only display the 1st 75 
characters?

Thanks

AMM
date: Thu, 26 Jun 2008 15:43:08 -0700   author:   starting out

Re: how to question   
"starting out"  wrote in message 
news:umDiE491IHA.2208@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I have another question
>
> i have text that is 354 characters, how do you only display the 1st 75 
> characters?
>
> Thanks
>
> AMM
>
If you use msxml then all this sort of stuff is in the sdk, XPath functions. 
If not there are references online. You probably need the substring 
function.

http://msdn.microsoft.com/en-us/library/ms256177(VS.85).aspx

In this case look under the XPath section.

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
date: Fri, 27 Jun 2008 08:19:54 +0100   author:   Joe Fawcett am

Re: how to question   
Well thanks for the information--but this might not be the right way of 
asking of the question.


This is the element
<ideas>
In an expected but no less earthshaking decision, the Supreme Court ruled 
today that the language of the second amendment guarantees US citizens an 
individual right to own guns.

Justice Antonin Scalia, writing for the majority in the landmark 5-to-4 
decision, said the Constitution does not allow "the absolute prohibition of 
handguns held and used for self-defense in the home." In so declaring, the 
majority found that a gun-control law in the nation's capital went too far 
in making it nearly impossible to own a handgun.

It was the first time in nearly seventy years that the court has addressed 
the second amendment, and the first time it has weighed in on whether the 
amendment guaranteed a collective or individual right.  The language of the 
amendment is ambiguous:

A well regulated militia, being necessary to the security of a free state, 
the right of the people to keep and bear arms, shall not be infringed.

In that case in 1939, the Court ruled that the Constitution did not protect 
a right to own specific guns (in that case a sawed-off shotgun), 
suggesting--but not clearly stating--that there is no individual right to 
own guns. The conservative members of the court (Roberts, Alito, Scalia, and 
Thomas) were joined by Justice Roberts in clarifying and refuting that 
suggestion:

Not surprisingly, Justice Scalia and Justice Stevens differed on the clarity 
(or lack thereof) of the Second Amendment. "The amendment's prefatory clause 
announces a purpose, but does not limit or expand the scope of the second 
clause," wrote Justice Scalia. "The operative clause's text and history 
demonstrate that it connotes an individual right to keep and bear arms."

Not at all, Justice Stevens countered, asserting that the majority "stakes 
its holding on a strained and unpersuasive reading of the amendment's text." 
Justice Stevens read his dissent from the bench, an unmistakable signal that 
he deeply disagreed with the majority.

The court concluded that the amendment protects an individual right to bear 
arms, but it also said that the right is not absolute, opening the door for 
more fights in the future. Lawmakers across the country may look to the 
decision as a blueprint for writing new legislation to satisfy the demands 
of constituents who say there is too much regulation of firearms now, or too 
little, depending on the sentiments in their regions. In March 2007, 
Washington city officials expressed disappointment and outrage when the 
United States Court of Appeals for the District of Columbia Circuit 
overturned the city ordinance. The Supreme Court ruling is sure to prompt 
work on a new ordinance that can withstand high court scrutiny.

It is the highest-profile case to be decided by the Roberts Court, and 
suggests that the Court will not blanch at the opportunity to decide in 
favor of conservative positions in politically-charged cases.

</ideas>



I want to parse only the

In an expected but no less earthshaking decision, the Supreme Court ruled 
today that the language of the second amendment guarantees US citizens an 
individual right to own guns.

Justice Antonin Scalia, writing for the majority in the landmark 5-to-4 
decision, said the Constitution does not allow "the absolute prohibition of 
handguns held and used for self-defense in the home." In so declaring, the 
majority found that a gun-control law in the nation's capital went too far 
in making it nearly impossible to own a handgun.



I hope this is a better way of explaining it..I looking at substring and it 
did not do anything like what I want. If the link you gave me is correct can 
you give me a link that has better examples to work with then. The MS site 
is very bare-boned, and for more advanced coders.



TIA





"Joe Fawcett" <joefawcett@newsgroup.nospam> wrote in message 
news:7A5E73F9-02A4-4852-AD88-8F103D815E55@microsoft.com...
>
>
> "starting out"  wrote in message 
> news:umDiE491IHA.2208@TK2MSFTNGP04.phx.gbl...
>> Hello,
>>
>> I have another question
>>
>> i have text that is 354 characters, how do you only display the 1st 75 
>> characters?
>>
>> Thanks
>>
>> AMM
>>
> If you use msxml then all this sort of stuff is in the sdk, XPath 
> functions. If not there are references online. You probably need the 
> substring function.
>
> http://msdn.microsoft.com/en-us/library/ms256177(VS.85).aspx
>
> In this case look under the XPath section.
>
> -- 
>
> Joe Fawcett (MVP - XML)
> http://joe.fawcett.name
>
>
date: Fri, 27 Jun 2008 11:27:11 -0700   author:   starting out

Re: how to question   
starting out wrote:
> Hello,
> 
> I have another question
> 
> i have text that is 354 characters, how do you only display the 1st 75 
> characters?

The MSDN substring reference:
http://msdn.microsoft.com/en-us/library/ms256054.aspx

Sample:
<test>
   <item id="1">Apple (and a bunch of text...)</item>
   <item id="2">Banana (and a bunch of text...)</item>
   <item id="3">Orange (and a bunch of text...)</item>
</test>


<xsl:value-of select='substring(/test/item[@id=2], 1, 75)'/>

::k::
date: Fri, 27 Jun 2008 21:12:30 -0500   author:   Kindler Chase support@DeLeTeMe-ncubed-dot-com

Re: how to question   
Please read my 11:27 post.

I am not critiquing you or Mr Fawcett, but by just cutting and pasting a 
link to msdn and say here ...is not helping people. MSDN code snipets are 
not beginner level...it does not show how to use the snippet at all.
Like where to you use it ???

TIA


"Kindler Chase" <support@DeLeTeMe-ncubed-dot-com> wrote in message 
news:eWdcwRM2IHA.3756@TK2MSFTNGP04.phx.gbl...
> starting out wrote:
>> Hello,
>>
>> I have another question
>>
>> i have text that is 354 characters, how do you only display the 1st 75 
>> characters?
>
> The MSDN substring reference:
> http://msdn.microsoft.com/en-us/library/ms256054.aspx
>
> Sample:
> <test>
>   <item id="1">Apple (and a bunch of text...)</item>
>   <item id="2">Banana (and a bunch of text...)</item>
>   <item id="3">Orange (and a bunch of text...)</item>
> </test>
>
>
> <xsl:value-of select='substring(/test/item[@id=2], 1, 75)'/>
>
> ::k::
date: Sat, 28 Jun 2008 01:00:14 -0700   author:   starting out

Re: how to question   
Forget all...im going to just put the 1st paragraph in its on node in the 
xml document and then the rest of the information in a second node. Yes it 
is sloppy but I don't need to waste your time with elementary questions 
since I get is cut and paste links to not so useful snippets.
"starting out"  wrote in message 
news:umDiE491IHA.2208@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I have another question
>
> i have text that is 354 characters, how do you only display the 1st 75 
> characters?
>
> Thanks
>
> AMM
>
date: Sat, 28 Jun 2008 01:34:32 -0700   author:   starting out

Re: how to question   
"starting out"  wrote in message 
news:uSBkNnP2IHA.416@TK2MSFTNGP04.phx.gbl...
> Forget all...im going to just put the 1st paragraph in its on node in the 
> xml document and then the rest of the information in a second node. Yes it 
> is sloppy but I don't need to waste your time with elementary questions 
> since I get is cut and paste links to not so useful snippets.
> "starting out"  wrote in message 
> news:umDiE491IHA.2208@TK2MSFTNGP04.phx.gbl...
>> Hello,
>>
>> I have another question
>>
>> i have text that is 354 characters, how do you only display the 1st 75 
>> characters?
>>
>> Thanks
>>
>> AMM
>>
>
>
Sorry you feel that way but forums are not supposed to be a way of getting 
your work done for free by others.
The example by Kindler Chase showed both the link and an inline example of 
exactly what you asked for.
If you are having difficulty translating that into your own situation then 
show the code you have so far.
You're basically seem to be saying "I don't have time to learn so write this 
for me".

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
date: Sat, 28 Jun 2008 09:53:20 +0100   author:   Joe Fawcett am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us