Chris Lilley wrote:
(waves generally)
On Friday, September 16, 2005, 8:02:36 PM, Thomas wrote:
TD> Jonathan Watt wrote:
How about you only set the namespace for documents that have an SVG 1.0
doctype and a root 'svg' tag?
TD> The namespace is already by the DTD if it references the SVG 1.0
TD> doctype.
Its a #FIXED declaration in the DTD. That means, if the attribute value
is supplied, it has to be the correct value. So that, if someone uses
the DTD for validation, and they mistype the URI of the SVG namespace,
they get a validation error.
Its not there as a default attribute.
The I must be misreading something:
http://www.w3.org/TR/REC-xml/#sec-attr-defaults
Says:
[Definition: If the declaration is neither #REQUIRED nor
#IMPLIED, then the AttValue value contains the declared default
value; the #FIXED keyword states that the attribute MUST always
have the default value. When an XML processor encounters an
element without a specification for an attribute for which it
has read a default value declaration, it MUST report the
attribute with the declared default value to the application.]
Put this all together and It looks to me like the SVG 1.1
DTD is defining the 'default value' for 'xmlns' on the 'svg' element
which must be reported to the application.
It *used* to be, in SVG 1.0 up to
Last Call or CR... checks ... We changed that due to CR feedback. We
previously allowed validating, or non-validating but external DTD subset
fetching, processors to infer it from the DTD. However, fetching the
external DTD subset is optional, and content should not make assumptions
about what the processor does there.
Sure content shouldn't make assumption about this, but I would
argue strongly with the contention that an SVG implementation that does
apply the SVG DTD to content is non-conforming!
In all cases, for compliance with the "Namespaces in XML"
Recommendation [XML-NS], an SVG namespace declaration must be provided
so that all SVG elements are identified as belonging to the SVG
namespace.
But the SVG DTD does provide just such a namespace declaration.
The following are possible ways to provide a namespace
declaration. An xmlns attribute without a namespace prefix could be
specified on an 'svg' element, which means that SVG is the default
namespace for all elements within the scope of the element with the
xmlns attribute:
This is exactly the route the SVG 1.0 & 1.1 DTDs takes.
[...] it looks like SVG 1.2 won't have a DTD produced for it I
suppose this would allow this "stricter" behaviour, either way.
I think setting the namespace for new 1.2 content would be bad.
It would be bad for 1.0, 1.1, or 1.2. I was surprised to see that Batik
was non-conformant in this area
This may be the case for SVG 1.2 but I would argue strongly with
the contention that this is non-conformant for 1.0 & 1.1.
- presumably because of the amount of
older content out there (the famous "0303-stylable" DTD that Illustrator
9 used, for example).
No it is because the SVG DTD specifies that the svg element should
have an xmlns attribute.
I think a 1.0 doctype should be required before doing this.
TD> Well most/all of this discussion is about behavior when there
TD> is no doctype, essentially a bare XML file:
TD> <svg ...>
TD> So in some sense we will
TD> treat this as an 'svg' element (by default in the 'svg' namespace)
Why by default? What happens when the Sonic Valve Gasket markup language
is styled with sXBL to create SVG?
Then hopefully they won't try and parse it with the
SAXSVGDocumentFactory which is intended to parse Scalable Vector
Graphics Documents. How they decide to use that class is really
outside of the scope of the SVG spec. I will grant you that in
the 'lack of DTD' case we are treading on soft ground, the only
defense for is that this only happens when someone has explicitly
requested the parsing of an SVG document (at which point leveraging
some knowledge of the SVG default attribute values seems reasonable).
TD> Why do you say Batik will "break with standards" if it treats
TD> an SVG document with no namespace decl referring to the SVG 1.1
TD> DTD?
Such content is non-conformant, as it fails to implement a conformance
clause, specified with a must, in section 5.1.1 of the SVG 1.0
Recommendation.
So it has one, it is provided by the SVG DTD, should SVG 1.0
implementations ignore the SVG DTD then?
TD> I'm fairly certain the DTD does provide the xmlns decl.
It does, but for validation (checking in case it is wrong)
This is wrong #FIXED still sets the attribute default value.
TD> Certainly, an implementation is free to read and follow the DTD
TD> (even if DTD's are ugly ;).
It is (and they are), but we moved default values for namespaces out of
the DTD.
Doesn't look like it to me, from svg11-flat.dtd:
<!ENTITY % SVG.xmlns "http://www.w3.org/2000/svg" >
<!ENTITY % SVG.xmlns.attrib
"xmlns %URI.datatype; #FIXED '%SVG.xmlns;'
%XLINK.xmlns.attrib;"
>
<!ATTLIST %SVG.svg.qname;
%SVG.xmlns.attrib;
%SVG.Core.attrib;
%SVG.Conditional.attrib;
[...]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]