loext namespace in ODF strict

Regina Henschel rb.henschel at t-online.de
Thu Nov 7 14:38:14 UTC 2024


Hi Mike,

Mike Kaganski schrieb am 06.11.2024 um 18:44:
> Hi Regina,
> 
> On 06.11.2024 19:57, Regina Henschel wrote:
>> Hi all,
>>
>> with ODF 1.4 we get an attribute draw:extrusion-metal-type. Its value 
>> is a QName. The default value is 'draw:MetalODF' and the value we use 
>> for MS compatibility is 'loext:MetalMSCompatible'. Using 
>> 'draw:MetalMSCompatible' is not allowed.
>>
>> Currently validation fails, because loext is not registered as 
>> namespace prefix in ODF strict and thus 'loext:MetalMSCompatible' is 
>> no valid QName.
>>
>> It will be detected as valid QName, when I move
>>         mpNamespaceMap->Add(
>>                 GetXMLToken(XML_NP_LO_EXT), GetXMLToken(XML_N_LO_EXT),
>>                 XML_NAMESPACE_LO_EXT);
>> up from the "extended" section to the "strict" section in 
>> SvXMLExport::InitCtor_() in xmloff/source/core/xmlexp.cxx.
>>
>> But I'm not sure, whether that is the correct place to solve the problem.
>>
>> Is there a way to add a namespace when it is actually needed? I mean 
>> to add it when a shape uses this attribute?
> 
> 
> Any element may have its own xmlns attributes, that take effect 
> immediately, including in its other attributes. So you may add the 
> attribute not to the top-level element, but right to the element using 
> that draw:extrusion-metal-type with a loext value, when it's not writing 
> an extended format maybe?
> 

Thank you, that works. And this way has the advantage, that the prefix 
has fixed value "loext".

Kind regards,
Regina



More information about the LibreOffice mailing list