W3C home > Mailing lists > Public > www-svg@w3.org > December 2003

SVG RNG snippet: metadata content

From: Tobias Reif <tobiasreif@pinkjuice.com>
Date: Mon, 8 Dec 2003 12:34:18 +0100
To: www-svg@w3.org
Cc: Chris Lilley <chris@w3.org>, mimasa@w3.org
Message-ID: <20031208113418.GA5312@linux>

Hi

This might be a possible way to express what the spec says about the
contents of the metadata element:


  <define name="non.svg.elements.mixed.with.text">
    <zeroOrMore>
      <choice>
        <element>
          <anyName>
            <except>
              <nsName/>
            </except>
          </anyName>
          <ref name="non.svg.attributes"/>
          <zeroOrMore>
            <ref name="non.svg.elements.mixed.with.text"/>
          </zeroOrMore>
        </element>
        <text/>
      </choice>
    </zeroOrMore>
  </define>
  
  <define name="non.svg.attributes">
    <zeroOrMore>
      <attribute>
        <anyName>
          <except>
            <nsName/>
          </except>
        </anyName>
        <text/>
      </attribute>
    </zeroOrMore>
  </define>
  
  <define name="SVG.metadata.content">
    <ref name="non.svg.elements.mixed.with.text"/>
  </define>


In svg-basic-structure.rng I replaced

  <define name="SVG.metadata.content">
    <text/>
  </define>

with the above, now my validator labels the following test
document as valid:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
:%w !xval
-->
<svg viewBox="-10 10 500 510"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <title>Test</title>
  <desc>An SVG containing RDF.</desc>
  <metadata>
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/metadata/dublin_core#">
  <rdf:Description rdf:about="">
    <dc:Publisher>tobiasreif pinkjuice com</dc:Publisher>
    <dc:Date>20031205</dc:Date>
    <dc:Format>image/svg+xml</dc:Format>
    <dc:Language>en</dc:Language>
  </rdf:Description>
</rdf:RDF>
</metadata>
  <rect id="BG" x="-1000%" y="-1000%" width="3000%" height="3000%"/>
</svg>

The RNG snippet is meant as temporary, specific, and local fix but
could also serve as basis for more general changes.

Tobi

-- 
http://www.pinkjuice.com/
Received on Monday, 8 December 2003 06:35:39 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:26 GMT