![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: importing a node and resolving namespace prefixes importing a node and resolving namespace prefixesTo: NULL Date: 9/1/2006 10:07:00 AM I am using IXMLDOMDocument3's importNode() and appendchild() to copy a node from one XML document to another. However, the node being copied (deep copy) still uses the namespace prefixes of the source doc. How do I make the node copied to the dest doc use the dest doc's namespace prefixes? Example: Source XML: <?xml version="1.0" encoding="UTF-8"?> <psf:PrintTicket xmlns:psf="http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1" xmlns:ns0000="http://schemas.something.com" xmlns:psk="http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"> <psf:Feature name="psk:JobOutputBin"> <psf:Option name="ns0000:DestPrinterDefault"/> </psf:Feature> </psf:PrintTicket> Destination: <?xml version="1.0" encoding="UTF-8"?> <psf:PrintTicket xmlns:psf="http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1" xmlns:ns0000="http://schemas.something.com" xmlns:kxd000="http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"> </psf:PrintTicket> Note that the namespace prefix psk in Source XML is now kxd000 in the Dest XML Result I am getting: <?xml version="1.0" encoding="UTF-8"?> <psf:PrintTicket xmlns:psf="http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1" xmlns:ns0000="http://schemas.something.com" xmlns:kxd000="http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"> <psf:Feature name="psk:JobOutputBin"> <psf:Option name="ns0000:DestPrinterDefault"/> </psf:Feature> </psf:PrintTicket> The namespace prefixes are not resolved. What can I do to fix this? | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
