Thanks Vitaly. It did work.

On Mon, May 23, 2011 at 12:43 AM, Vitaly Prapirny <m...@mebius.net> wrote:

> Hi!
>
> You can try something like this:
>
> DOMElement* rootElem = doc->getDocumentElement();
>
> DOMAttr* attr = doc->createAttribute(X("xmlns:xsi"));
> attr->setValue(X("http://www.w3.org/2001/XMLSchema-instance";));
> rootElem->setAttributeNode(attr);
>
> Good luck!
>        Vitaly
>
>
> Wei Zheng wrote:
>
>> For example I need something like below:
>>
>> <RootElem
>> xmlns="http://www.abc.com/XMLSchema/product";
>> xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
>> xs:schemaLocation="http://www.abc.com/XMLSchema/product.xsd";
>> xmlns:pr_attr="http://www.abc.com/XMLSchema/product"; pro_attr:ver="1.0">
>> <CommonElem>
>> ...
>> </CommonElem>
>> </RootElem>
>>
>> It seems that I can only add the "qualified Name" (xmlns part). How about
>> I
>> want to add xmlns:xs, xs:schemaLocation, and my customized attributes to
>> the
>> root element?
>>
>> Thanks in advance!
>> Wei
>>
>>
>

Reply via email to