[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: fetch value from processing instruction

Subject: RE: fetch value from processing instruction
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Mon, 21 Apr 2003 15:07:20 -0400
substring after p
[rondeelvantrigt]

> Please help me to get rid of quotes!
> 
> In my XSLFO file I need a value from a processing instruction 
> for retrieval
> by a marker.
> The processing instruction contains several values within quotes like:
> <?p="1" a="2" b="3"?>

Your document is not well-formed, so I hope that the above has a typo in
it.  I will assume that it should have read something like

 <?my-pi p="1" a="2" b="3"?>

> I created variables to fetch the values but can't get rid of 
> the quotes.
> What I need is just the numerical value without the quotes.
> 
> For example to fetch the value of p (I want the 1):
> <xsl:variable name="info1" select="substring-after(.,'p=')"/>
> <xsl:variable name="page.num" select="substring-before($info1,'"')"/>
> 
> However, in this second line I cannot use the " quote, so I tried:
> <xsl:variable name="quote">"</<xsl:variable>
> and then used:
> <xsl:variable name="page.num" 
> select="substring-before($info1,'$quote')"/>
> but I still do not get the single number 1.
> 
> Any better solutions?
> 

This will work -

select='substring-after(.,&apos;"&apos;)'

(Of course, it gets more than you want but it shows how to use your
quoteation mark)

Cheers,

Tom P
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.