On Sat, Oct 2, 2010 at 12:48 AM, Vincent Hennebert <[email protected]>wrote:
> > He was using XSLT attribute-sets that could be applied to FO elements as > well as extension elements, and found things like the following among > the result: > <fo:block fo:font-family="Helvetica"> > Blah... > </fo:block> > > Which makes me wonder: is there anything wrong with that? According to > the XML Namespaces Recommendation [1]: “The namespace name for an > unprefixed attribute name always has no value”. So in case 1 above, the > “font-family” attribute has no namespace. But if I want to re-use it on > some extension element, I obviously have to specify that it comes from > XSL-FO, so will prefix it with ‘fo’. In which case it will be in the > XSL-FO namespace. > the attribute fo:font-family and the attribute font-family are different attributes; the former is not defined by XSL-FO, while the latter is defined; if one wants to use XSL-FO attributes on non-XSL-FO element types, then simply use them (without a namespace prefix), however, in that case they effectively reside in the per-element namespace of the element that uses them; i.e., <ext:foo xmlns:ext="..." font-family="..."/> is fine, though here font-family lives in the per-element namespace of ext:foo; why do you say "if I want to re-use it on some extension element, I obviously have to specify that it comes from XSL-FO, so will prefix it with ‘fo’"? <ext:foo xmlns:ext="..." fo:font-family="..."/> is not fine (FO doesn't define font-family in a global namespace); this quirkiness in XMLNS comes from historical artifacts to accommodate backwards compatibility with pre-namespace validators; regards, glenn
