xml


XPath,XSL: Test if node exists which has multiple children with special attributes


I am trying to find a way to do operations based on whether there exists a node which has two children with special attributes. So given this data:
<A>
<B attribute1="X"/>
<B attribute2="Y"/>
</A>
<A>
<B/>
</A>
I only want to get true if there exists an element A which has one element B with attribute1="X" and one element B with attribute2="Y", like in the data example.
So my start was
<xsl:if test="(boolean(//A/B[#attribute1='X'] and B[#attribute2='Y'))">
This does not work, and the best I could do so far is to evaluate if there is one Node A1 with a child that has attribute1 = X and one Node A2 with a child that has attribute2 = Y, but A1 and A2 can be different Nodes.
'boolean(//A[B[#attribute1="X"] and B[#attribute2="Y"]])'

Related Links

Validate xml from visual basic
How is the versatile 2010 OpenDocument Text format (.odt) different from the easily damaged 2012 ODT one?
Wordpress feed generates broken xml
tree sorting in groovy
How to combine XML-like format with binary data?
Referencing xml file with dynamic file name
How to get child max element with xslt
Finding a Same-Level Predecessor in XML using XPath
xslt validation
what does the following line of code means in xslt
log4j xml to write logs from one package to their own log file
Magento Soap Api (v2), how to show XML response
Tomcat 6 to Tomcat 7 causes context path to stop cooperating
XSD with conditional attribute
Should we rewrite the XSL in CDuce?
Scriptella: copy table from access to postgresql

Categories

HOME
google-app-engine
eclipse
scikit-learn
amp-html
composite-primary-key
gradient
alsa
trac
32bit-64bit
mautic
dynatrace
qsqlquery
package.json
microsoft-dynamics-nav
jersey-1.0
solrcloud
dpdk
siri
interbase
jquery-multiselect
flooding
ms-access-2003
sinch
custom-controls
linkedhashmap
modalviewcontroller
cd
tex
xdocreport
comparison-operators
naming
glm-math
smoothstate.js
httr
plan-9
pom.xml
servermanager
xbmc
jquery-ui-draggable
dtsearch
tinymce-3
tf
remedy
quicktime
css-transforms
libjpeg
rackspace-cloud
cd-burning
jtree
angular2-testing
winusb
parfor
preprocessor
greatest-n-per-group
neon
mongodb-php
x-tag
mapinfo
expectations
aurora
lz77
libvlc
java-money
qt5.2
fiware-monitoring
computer-architecture
shopizer
code-documentation
public-html
filesplitting
cuba
personalization
alternate
clickbank
koala
qscrollarea
accesscontrolexception
rfc5322
isqlquery
gpars
pagedown
virtual-pc
bjyauthorize
idn
joomla3.1
patricia-trie
zope.interface
iboutlet
pyunit
predicatebuilder
kqueue
wiimote
luabind
htdocs
w3c-geolocation
timthumb
codebase
resharper-6.0
delimited-text
scrollbars
nstokenfield
murmurhash
wcf-instancing
dsl-tools
google-wave
interop-domino
escrow
linfu-dynamicproxy

Resources

Encrypt Message