Hi,
 
I have this xml file:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<sptm:Template
    xmlns:sptm="http://www.test.com/schemas/uc/1.00/sptm";
    commandType="shell"
     filename="myfile.xml"
     id="1"
</sptm:Template>

and I'm trying to retreive the root attribute names/values, 
filename="myfile.xml" for example.

The following code works if the root element tag is not prefixed with a 
namespace:

DOMElement* root = pDoc->getDocumentElement();
const XMLCh* attrValue = 
root->getAttributes()->getNamedItem(X("filename"))->getNodeValue();

what do I need to change for it to work with the namespace? 

I tried getNamedItemNS(), didn't work (I guess it would work if the attribute 
was prefixed).
Then I tried setting root to:
root = 
dynamic_cast(pDoc->getElementsByTagNameNS(X("http://www.test.com/schemas/uc/1.00/sptm";),
 X("Template"))->item(0));
This didn't work also.

Any suggestions?

Thanks.




 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

Reply via email to