xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Dupras <bri...@centera.com>
Subject Simlpe XPointer / XPath / XLocator help
Date Thu, 13 Jan 2000 19:08:08 GMT
Back when I was using XML4J, I was able to do XPointer (the older spec)
fairly easily.  But with xerces, I can't get
com.ibm.xml.xpointer.XPointer.point() to work with anything more that
"root()"

Am I doing something wrong, or is it that the XPointer stuff is too old to
work proplerly with xerces?


Or, is there a xerces / xalan way of doing what I need?  My needs are
simple:
  "Get me the first <myns:page> node under the <myns:data> node under the
root node"
    XPointer (old): "root().child(1,myns:data).child(1,myns:page)"
  "Get me the value of the attribute named 'foo' under a specific node"
    XPointer (old): "attr(foo)"

(I've tried this with and without namespaces inthe xml document.)


My needs will grow, so I don't whan to have to walk the tree manually for
each bit of data that I need.  Is XPath what I want?  XLocator?  I guess I
don't fully understand the definition of each of these specs.


sample xml:

<?xml version="1.0" ?>
<pp:site_view rid='urn:uuid:abdcedfghi899'
    xmlns:pp='http://ourserver/namespaces/pp/1.0'
    xmlns:xlink='http://www.w3.org/XML/XLink/0.9'
    xmlns:html='http://www.w3.org/1999/xhtml'
    >
  <pp:metadata>
    <pp:editor>Brian Dupras</pp:editor>
    <pp:description>blah blah blah</pp:description>
  </pp:metadata>
  <pp:data>
    <!--Main Page-->
    <pp:page rid='urn:uuid:abdcedfghi234' />
  </pp:data>
</pp:site_view>


My first goal is to get the value of the "rid" attribute of the <pp:page>
labeled Main Page in the above example.

Thanks,

Brian Dupras
Centera Information Systems, Inc.
phone	303.939.0200 x294
fax	303.939.0111
web	http://www.centera.com
email	briand@centera.com

Mime
View raw message