Namespace Handling

Higsheews

New Member
I have one xsl file and 2 input xml files from which output is to be generated. In One XML file their are some namespaces which are imported to xsl file. But in other XML file the namespace doesn't exist. I have to handle my XSL in such a way that it can handle both XML files because XSL is common for both input XML files.Please suggest.Namespace in 1st XML file ->\[code\]<TreeList xmlns="urn:sfti:documents:BasicTreeList:1:0" xmlns:cac="urn:sfti:CommonAggregateComponents:1:0" xmlns:cbc="urn:oasis:names:tc:ubl:CommonBasicComponents:1:0" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1:0" xmlns:cur="urn:oasis:names:tc:ubl:codelist:CurrencyCode:1:0" xmlns:sdt="urn:oasis:names:tc:ubl:SpecializedDatatypes:1:0" xmlns:udt="urn:oasis:names:tc:ubl:UnspecializedDatatypes:1:0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\[/code\]Namespace in 2nd XML file ->\[code\]<TreeList xmlns:cac="urn:sfti:CommonAggregateComponents:1:0" xmlns:cbc="urn:oasis:names:tc:ubl:CommonBasicComponents:1:0" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1:0" xmlns:cur="urn:oasis:names:tc:ubl:codelist:CurrencyCode:1:0" xmlns:sdt="urn:oasis:names:tc:ubl:SpecializedDatatypes:1:0" xmlns:udt="urn:oasis:names:tc:ubl:UnspecializedDatatypes:1:0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\[/code\]Namespace in XSL File -> \[code\] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:abc="urn:sfti:documents:BasicTreeList:1:0" xmlns:cac="urn:sfti:CommonAggregateComponents:1:0" xmlns:cbc="urn:oasis:names:tc:ubl:CommonBasicComponents:1:0">\[/code\]When I run my XSL file it runs fine with 1st XML. But it doesn't work well with 2nd XML File due to namespace problem.
 
Back
Top