View Single Post

  #2 (permalink)  
Old 03-09-2004, 09:29 PM
Jon - svg
Guest
 
Posts: n/a
Default Re: Case Sensitive Element names in SVG

Hi Arthur,

Quote:
Originally Posted by arthur
I have the task of creating an XML Schema for our SVG images.
I ran into a problem with the Department Of the Navy (DON) imposing the standard on all XML Schemas that they have the first leter of each word in every element name uppercase. My Adobe SVG Viewer will not allow the image to display unless I return the letters to lowercase. I have provided a sample below.
Does anybody have any suggestions or remedy for this dilema?
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<SVG width="800" height="600">
<Text id="XMLID_2_" transform="matrix(1 0 0 1 114.88 159.947)">
<Tspan x="0" y="0" style="font-family:'ArialMT';font-size:13.9019">Main Object</Tspan>
...
</SVG>
Wow, it is indeed a dilemma and that will be an interesting task. XML is case-sensitive. Well, I see only a couple of options depending on project constraints:

-=EXTERNAL CLIENTS APP=-
-- Consider using a schema that supports both upper- and lower-case tags - if allowed.
-- Build a converter such that your schema validates your SVG documents, then convert your documents into ASV compatible (lower-case) docs for production use.

-=IN-HOUSE APP=-
-- Consider using Batik or Mozilla instead of the ASV viewer. Batik and Mozilla are open source and so you could compile a version that allows for capitalization.
-- Build your own viewer... though I certainly would not recommend this.

I worked with schemas and DTDs a few years ago... I really enjoyed it as it provides some insights into all languages.
Have fun,

Learn SVG - http://learnsvg.com
Reply With Quote