Sign Up
Search
Options
search
Chat
Help
News
Log in
Not Logged in
Home
»
Boards
»
Stylus Studio Developer Network
»
XSLT Help and Discussion
»
Query in Xpath
Conferences
Stylus Studio Feature Requests
(1192)
Stylus Studio Technical Forum
(14621)
Website Feedback
(249)
XSLT Help and Discussion
(7625)
Limitation to variable value i...
(3)
Using xsl to transfer XML data...
(2)
Moving data from one xml file ...
(3)
Key() returning empty node
(2)
Query in Xpath
(2)
Query in Xpath
Curly braces to substitute val...
(4)
Not grouping all nodes
(3)
Simplifying this long if state...
(6)
"Select" - help
(4)
xsl:result-document and Xalan
(3)
Native Java types and extensio...
(3)
Deleate element except one of ...
(1)
text() function and xalan - lo...
(3)
Testing an Elements child Tag ...
(2)
transfer xml into xslt
(3)
Help! Transform flat XML recor...
(5)
Dynamic Transformations
(4)
Converting XML to HTML
(2)
Need Help --- A Special Sum Qu...
(11)
XML to XML transformation
(3)
Previous
[1441-1460]
[1461-1480]
[1481-1500]
Next
XQuery Help and Discussion
(2017)
Stylus Studio FAQs
(159)
Stylus Studio Code Samples & Utilities
(364)
Stylus Studio Announcements
(113)
Topic
next
Subject:
Query in Xpath
Author:
manjini anandan
Date:
24 May 2006 02:43 AM
I have a doubt how to get the contents which are contains my required attribute value.
For example:
<body xx="aa">adsafdasfda</body>
<body xx="aa bb">sadasfasdf</body>
<body xx="bb">asdfasdf</body>
Here i want to get the contents of body who's attribute 'xx' contains value 'aa'. here i should both the first and second body element contents.
top
Subject:
Query in Xpath
Author:
Tony Lavinio
Date:
24 May 2006 09:17 AM
Assuming you wrapped the XML snippet you gave in <root> ... </root>,
you could use the contains() function, like this:
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="US-ASCII" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="root/body[contains(@xx, 'aa')]"/>
</xsl:template>
<xsl:template match="body">
<xsl:value-of select="text()"/>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
Powered by
Stylus Studio
, the world's leading
XML IDE
for
XML
,
XSLT
,
XQuery
,
XML Schema
,
DTD
,
XPath
,
WSDL
,
XHTML
,
SQL/XML
, and
XML Mapping
!
Go to Conference:
Select Conference
Stylus Studio Feature Requests
Stylus Studio Technical Forum
Website Feedback
XSLT Help and Discussion
XQuery Help and Discussion
Stylus Studio FAQs
Stylus Studio Code Samples & Utilities
Stylus Studio Announcements
go
Log In Options
Username:
Password:
Site Map
|
Privacy Policy
|
Terms of Use
|
Trademarks
Stylus Scoop XML Newsletter:
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.