Xalan version: 2.6.2 When I transform a document, I want to be able to make the transformation reversible. I am having issues with the namespaces that are in the original document.
Since this transformation is specifically targeted at XML generated by Excel workbooks, the XML namespaces are constant. The source document looks like this: <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> The result of the first transformation looks like his: <?xml version="1.0" encoding="UTF-8"?> <packages> <package xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:Name= "Sheet1" ss:ExpandedColumnCount="5" ss:ExpandedRowCount="8" xmlns:x= "urn:schemas-microsoft-com:office:excel" x:FullColumns="1" x:FullRows="1"> Ideally, the result of the first transformation should look like this: <?xml version="1.0" encoding="UTF-8"?> <packages xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <package ss:Name="Sheet1" ss:ExpandedColumnCount="5" ss:ExpandedRowCount= "8" x:FullColumns="1" x:FullRows="1"> with every element redeclaring the namespaces. I appear to be missing something obvious that would copy all of the XML namespace elements at the root element. Does anyone have any suggestions? Hardcoding would be acceptable in this case, if I understood how namespace elements were addressed. Thanks, David Johnson Programmer Specialist J. B. Hunt Transport Information Services / GAR New Dev
