XSLT and Java: Default Namespace XMLNS

idlewill

New Member
I'm new to XSLT and I'm trying to transform one XML file into another one. My problem is that there is one namespace 'xmlns' without any prefix in the original xml file and when I transform it to another one through xslt then nothing happens but if I remove that xmlns namespace then it works out but actually I cannot modify the original .xml file since I'm bound to use that file only, so I have to keep xmlns in the original file as it is. So can anyone please suggest some modifications in my .xsl or java code to overcome this problem.My Original XML namespace looks like-\[code\]<?xml version="1.0" encoding="UTF-8"?> <manifest identifier="eXeorm_sample4823c6301f29a89a4c1f" xmlns:ims="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" </manifest>\[/code\]My desired xml is:\[code\] <?xml version="1.0" encoding="UTF-8"?> <manifest identifier="eXescorm_quiz4823c6301f29a8419515" xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" </manifest>\[/code\]My Modified XSLT-\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2"xmlns:ims="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="ims:manifest"> </xsl:stylesheet> \[/code\]
 
Back
Top