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]

xpath question


This is a sanity-check type question...

given two similar xml docs (specific difference is the documentElement):

<ns:one>
  <ns:metadata>
	<ns:ignore-me/>
  </ns:metadata>
  <ns:data>
	<ns:foo ns:attr='abc123'/>
	<ns:bar ns:attr='abc456'/>
	<ns:baz ns:attr='abc789'/>
  <ns:data>
</ns:one>

<ns:two>
  <ns:metadata>
	<ns:ignore-me/>
  </ns:metadata>
  <ns:data>
	<ns:foo ns:attr='abc123'/>
	<ns:bla>
		<ns:bar ns:attr='abc456'/>
	</ns:blah>
	<ns:baz ns:attr='abc789'/>
  <ns:data>
</ns:two>

I would like to use xpath to create nodelist of any decendant ns:* elements
under ns:data that have a non-null ns:attr.  Is this the syntax I'd want?
(Note that these examples above are fairly simplistic.)

Context Node:	<ns:one> or <ns:two>
XPath:		"ns:data//ns:*[@ns:attr != '']"


Brian Dupras
Centera Information Systems, Inc.
phone 303.381.4420 (direct)
phone 303.939.0200 (operator)
fax	303.939.0111
web	http://www.centera.com
email	briand@centera.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]