Hi, /b

Try this way:

    /* ... */
    XMLAttribute            xAttribute;
    ;
    xmlNode = xmlDoc.createElement("XMLTAG");
    xAttribute = xmlDoc.createAttribute("xmlns:xsi");
  
xAttribute.setNodeTypedValue("http://www.w3.org/2001/XMLSchema-instance");
    xmlNode.attributes().setNamedItem(xAttribute);
   
    xAttribute = xmlDoc.createAttribute("xsi:noNamespaceSchemaLocation");
    xAttribute.setNodeTypedValue("SomeSpecific.xsd");
    xmlNode.attributes().setNamedItem(xAttribute);

    xAttribute = xmlDoc.createAttribute("version");
    xAttribute.setNodeTypedValue("1");
    xmlNode.attributes().setNamedItem(xAttribute);

    xmlDoc.appendChild(xmlNode);

Regards,
min2sia

--- In [EMAIL PROTECTED], "byteway_so" <[EMAIL PROTECTED]>
wrote:
> Hi all,
> Has anyone of you have a clue on how to adjust the namespace tag when
> creating a XML File? Here is the code to create a XML Node, this node
> is then added to an xmlDocument instance.
>
> xmlNode = xmlDoc.createNode
> (XMLNodeType::ELEMENT,#XMLTagMacro,'xsi="http://www.w3.org/2001/XMLSch
> ema-instance" xsi:noNamespaceSchemaLocation="SomeSpecific.xsd"
> version="1"');
>
> xmlDocument.appendChild(xmlNode);
>
> When generating the XML-file it looks like:
> <XMLTAG xmlns="xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="SomeSpecific.xsd" version="1"">
>
> This is wrong!!!!
> It should look like this:
> <XMLTAG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="SomeSpecific.xsd" version="1">
>
> The difference is the ":" and the surrounding double quotes are
> removed. How can I make sure there is no difference anymore?
>
>
> Thanks in advance,
> /b



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to