On 11/7/2011 10:32 AM, ajay bhadauria wrote:
Hi,
I need to copy all the child elements from the parent element to output
xml using xalan c++ transform method. However, one of the child element
is prefixed but does not have corresponding namespace.
What should I do in xslt so that all the children elements of parent
element are copied to output xml file without caring the namespace.
Altova XMLSpy does that but When I use xalan c++ 1.10 , it does not copy.
How I can achieve this using xalan c++ 1.10 ?
E.g.
Input XML file
============
<?xml version="1.0" encoding="UTF-8"?>
<SwInt:Request >
<SwInt:RequestHeader>
<SwInt1:Requestor>cn=requestor,o=pimxbebb,o=swift1</SwInt1:Requestor>
<SwInt:Responder>cn=responder,o=pimxus33,o=swift</SwInt:Responder>
<SwInt:RequestRef>xyz</SwInt:RequestRef>
</SwInt:RequestHeader>
</SwInt:Request>
This document does not conform to the namespaces recommendation, so you
cannot transform it using an XSLT processor.
I have no idea what behavior XML Spy implements, but the XSLT
recommendation is clear that the document must conform to the namespaces
recommendation:
http://www.w3.org/TR/xslt#section-Introduction
Is this really the exact document you're using, because I don't see how
Xerces-C would even parse it correctly, much less get any result from
Xalan-C.
Dave