Hi David,

Thanks for that information.. more comments inline:


>===== Original Message From [EMAIL PROTECTED] =====
>> However, I still am facing the issue about getting all the values in an
>> attribute, as below:
>
>An attribute only has one value, so I don't understand what you mean by
>"getting all the values."

I meant that I want to collect the values stored in each of the attributes; 
for example, get a list of all the first names would entail collecting the 
values stored in the 'first' attribute of the 'name' element/node.

>> INSTEAD, I get:
>> bash-2.03$ mySerializeNodeSet SerializeNodeSet/foo.xml / /doc/name/@first
>>
>> Warning: An attribute or namespace node was selected. Attribute and
>namespace
>> nodes cannot be serialized.
>
>The sample shows how you can serialize XML.  When serializing XML, you
>cannot serialize an attribute, because it appears on the element to which
>it belongs.  If you want to get values out of a document using XPath
>expressions, XML serialization is not the answer.
>
>You should write your own code that selects a node-set, the prints out the
>values:
>
>for (NodeRefList::size_type i = 0; i < theLength; ++i)
>{
>    const XalanNode* const theNode = theResult.item(i);
>    assert(theNode != 0);
>
>    cout << DOMServices::getNodeValue(*theNode) << endl;
>}

-- This is exactly what I need; However, I can't seem to call the 
DOMServices::getNodeData(*theNode) method (after checkign the Xalan API, I 
presume that's the method you mean when you said 'getNodeValue'). I get the 
following compilation errors:

/workplace/pkgs/xalan/xml-xalan/c/samples/SerializeNodeSet/mySerializeNodeSet.
cpp: In function `int main(int, const char **)':
/workplace/pkgs/xalan/xml-xalan/c/samples/SerializeNodeSet/mySerializeNodeSet.
cpp:203: `DOMServices' undeclared (first use this function)
/workplace/pkgs/xalan/xml-xalan/c/samples/SerializeNodeSet/mySerializeNodeSet.
cpp:203: (Each undeclared identifier is reported only once
/workplace/pkgs/xalan/xml-xalan/c/samples/SerializeNodeSet/mySerializeNodeSet.
cpp:203: for each function it appears in.)
/workplace/pkgs/xalan/xml-xalan/c/samples/SerializeNodeSet/mySerializeNodeSet.
cpp:203: parse error before `::'

-- I have the following at the top of the file:
#include <DOMSupport/DOMServices.hpp>
So, it seems like it should be able to find the DOMServices class at the very 
least, but it still cannot! Am I missing something here?


>
>Dave

Thanks,
Kaushal

Reply via email to