[oXygen-user] Trouble validating SVG document

Radu Coravu
Thu Oct 14 09:56:17 CDT 2010


Hi Tim,

I will assume that the entities like "&ns_ai;" used in the attribute 
values are defined in the DTD declaration used to validate the SVG file.

The problem is that SVG files are validated against DTD grammars. DTD is 
not namespace aware, it sees namespace binding attributes like "xmlns:x" 
like simple attribute names which need to be declared in the DTD in 
order to be recognized.

For example in the DTD used by default by Oxygen to validate DTDs the 
<svg> root element is defined as having the following attributes:

<!ATTLIST svg
   xmlns CDATA #FIXED "http://www.w3.org/2000/svg"
   xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
   %stdAttrs;
   %testAttrs;
   %langSpaceAttrs;
   externalResourcesRequired %Boolean; #IMPLIED
   class %ClassList; #IMPLIED
   style %StyleSheet; #IMPLIED
   %PresentationAttributes-All;
   viewBox %ViewBoxSpec; #IMPLIED
   preserveAspectRatio %PreserveAspectRatioSpec; 'xMidYMid meet'
   zoomAndPan (disable | magnify) 'magnify'
   %graphicsElementEvents;
   %documentEvents;
   version %Number; #FIXED "1.0"
   x %Coordinate; #IMPLIED
   y %Coordinate; #IMPLIED
   width %Length; #IMPLIED
   height %Length; #IMPLIED
   contentScriptType %ContentType; "text/ecmascript"
   contentStyleType %ContentType; "text/css" >

So if you do not add an attribute definition for "xmlns:x" in the 
attributes list, the DTD will think the attribute is undefined.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/14/2010 4:50 PM, Reaves, Timothy wrote:
> I have an SVG document where the openeing SVG element is:
> <svg  version="1.0" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;"
> xmlns:graph="&ns_graphs;" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;"
>       width="497.611" height="591.554" viewBox="0 0 497.611 591.554"
>       style="overflow:visible;enable-background:new 0 0 497.611 591.554;"
> xml:space="preserve">
>
>
> Validation fails on each of the xmlns attributes.  This should be valid.
> The errors look like:
> SystemID: /home/bv6679/Development/images/HSVG/99571_97YA_17.svg
> Engine name: Xerces
> Severity: error
> Description: Attribute "xmlns:x" must be declared for element type "svg".
> Start location: 29:21
> End location: 29:42
>
> Any ideas?
> _______________________________________________
> oXygen-user mailing list
> 
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user





More information about the oXygen-user mailing list