David Bertoni wrote:
> 
> Paul Lalonde wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 
>> So now I'm further confused - I tried calling XalanNode::getChildren(), 
>> but recieved an XalanDOMException with value 9 = NOT_SUPPORTED_ERR.
>> Clearly I'm asking for the wrong thing.  What's the right thing?
>> 
> 
> This is a deliberate limitation in Xalan-C's implementation, to save 
> memory.  Because the processor never needs to see a list of the children, 
> only the iterative member functions are implemented.  Try the following
> code:
> 
> XalanNode* child = node->getFirstChild();
> 
> while(child != 0)
> {
>      ...
> 
>      child = child->getNextSibling();
> }
> 
> 
> Dave
> 
> 

Hi,
Consider following XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="CHILDREN">
  <title lang="en">Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>
<book category="WEB">
  <title lang="en">Learning XML</title>
  <author>Erik T. Ray</author>
  <year>2003</year>
  <price>39.95</price>
</book>
</bookstore>

It has four text nodes/elment(?). So if i run "/bookstore/book[1]"
getNodeValue() on this,what should i get?
I did traversed through the node and print it,but in this case I get null
string. The same piece of code works for "/bookstore/book/year".
I mean if i have to print following output what would be the generic
approach?
1. For "/bookstore/book[1]"  i should get <book category="CHILDREN">
  <title lang="en">Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>

2. For "/bookstore/book/year" i should get
2005
2003

Thanks
Shalmi


-- 
View this message in context: 
http://www.nabble.com/Getting-at-the-value-in-an-XalanNode--tf2260533.html#a12628165
Sent from the Xalan - C - Users mailing list archive at Nabble.com.

Reply via email to