This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XPath about pi and comment
- To: shinichiro dot hamada at toshiba dot co dot jp
- Subject: Re: [xsl] XPath about pi and comment
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Date: Wed, 10 Jan 2001 23:35:45 -0800 (PST)
- Cc: xsl-list at lists dot mulberrytech dot com
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Shinichiro,
> <xsl:value-of select="*[processing-instruction()]"/>
> <xsl:value-of select="*[comment()]"/>
In case you want to retrieve all processing instructions and comments
the above will not work -- what you've specified is actually all
elements children of the current node that have at least one
processing-instruction child or, respectively, that have at least one
comment child.
Use:
//processing-instruction()
and
//comment()
Dimitre Novatchev.
P.S. You can play with these and any other XPath expressions using the
XPath Visualiser (http://www.vbxml.com/xpathvisualizer)
The most recent version is 1.3 -- recent new features include providing
the ability for the user to dynamically define xsl:variable s and
xsl:key s and to use them in XPath expressions.
Shinichiro HAMADA wrote:
Hello, all.
In the following source, Is there any way to get "pivalue" and
"comment"
by XSLT? I tryed it with node-test function, processing-instruction()
and
comment() like this;
<xsl:value-of select="*[processing-instruction()]"/>
<xsl:value-of select="*[comment()]"/>
But it didn't work well. Please give me any comments. Thank you.
-- source --
<?xml version="1.0"?>
<doc>
<?pi pivalue?>
<!-- comment -->
<el>text</el>
</doc>
--
Shinichiro Hamada
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list