Page 1 of 1

namespace mismatches

PostPosted: Wed Jul 13, 2011 11:02 pm
by docx4j_user
Thanks Jason,
I tried with the latest build @ 1619 and it worked nicely. But still my doubt is same. There are some mismatches in the namespaces are they okay to go or it may create some problem later on?

Original namespace:
Code: Select all
<w:document
xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
xmlns:w10="urn:schemas-microsoft-com:office:word"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 wp14">


generated namespace:
Code: Select all
<w:document
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:ns6="http://schemas.openxmlformats.org/schemaLibrary/2006/main"
xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
xmlns:ns8="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing"
xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram"
xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
xmlns:ns11="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
xmlns:dsp="http://schemas.microsoft.com/office/drawing/2008/diagram"
xmlns:ns13="urn:schemas-microsoft-com:office:excel"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w10="urn:schemas-microsoft-com:office:word"
xmlns:ns17="urn:schemas-microsoft-com:office:powerpoint"
xmlns:odx="http://opendope.org/xpaths"
xmlns:odc="http://opendope.org/conditions"
xmlns:odq="http://opendope.org/questions"
xmlns:odi="http://opendope.org/components"
xmlns:odgm="http://opendope.org/SmartArt/DataHierarchy"
xmlns:ns24="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
xmlns:ns25="http://schemas.openxmlformats.org/drawingml/2006/compatibility"
xmlns:ns26="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas">

Re: namespace mismatches

PostPosted: Wed Jul 13, 2011 11:54 pm
by jason
As long as the namespaces actually used in the document remain consistent, everything will be fine. I'm not aware of any problems in this area.

For example, element w:p could be referred to as ns99:p in the generated docx, assuming originally you have xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main", and then generated namespace xmlns:ns99="http://schemas.openxmlformats.org/wordprocessingml/2006/main"

Obviously it would be a problem if ns99 were instead defined as xmlns:ns99="http://schemas.openxmlformats.org/something/else"

Your example contains:

Code: Select all
xmlns:ns6="http://schemas.openxmlformats.org/schemaLibrary/2006/main"
xmlns:ns8="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing"
xmlns:ns11="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
xmlns:ns13="urn:schemas-microsoft-com:office:excel"
xmlns:ns17="urn:schemas-microsoft-com:office:powerpoint"
xmlns:ns24="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
xmlns:ns25="http://schemas.openxmlformats.org/drawingml/2006/compatibility"
xmlns:ns26="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"


To retain the original prefixes, these need to be mapped in org.docx4j.jaxb.NamespacePrefixMappings; I'd happily accept a patch which does that :-)