This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XPath about pi and comment


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]