Skip to content

<path>

path

defines any line passing through two or more points within a surface element.

Module transcrPHFAXPHZLAB

Attributes

@pointsidentifies a line within the container or bounding box specified by the parent element by means of a series of two or more pairs of numbers, each of which gives the x,y coordinates of a point on the line.
Status
Datatype
2–∞ occurrences of teidata.point separated by whitespace

Classes and content

Member of
May contain
empty
Contained by

Note

Although the simplest form of a path is a straight line between two points, a line with more than two points may bend at any point. The order of coordinates in @points is significant, because the line follows the coordinate sequence.

To specify a closed polygon, use the zone element rather than the path element.

Example

<surface ulx="0" uly="0" lrx="443" lry="272">
  <graphic url="facs-fig3.jpg"/>
  <path points="74,73 171,244"/>
  <path points="71,203 173,116"/>
</surface>

Schematron

<constraintSpec xmlns:sch="http://purl.oclc.org/dsdl/schematron" ident="pathmustnotbeclosed" scheme="schematron" xml:lang="en">
    <desc versionDate="2023-04-11" xml:lang="en">
      Since a <gi>path</gi> represents a line with distinct start and
      end points, the last coordinate should not be the same as the
      first coordinate.
    </desc>
    <constraint>
      <sch:rule context="tei:path[@points]">
        <sch:let name="firstPair" value="tokenize( normalize-space( @points ), ' ')[1]"/>
        <sch:let name="lastPair" value="tokenize( normalize-space( @points ), ' ')[last()]"/>
        <sch:let name="firstX" value="xs:float( substring-before( $firstPair, ',') )"/>
        <sch:let name="firstY" value="xs:float( substring-after( $firstPair, ',') )"/>
        <sch:let name="lastX" value="xs:float( substring-before( $lastPair, ',') )"/>
        <sch:let name="lastY" value="xs:float( substring-after( $lastPair, ',') )"/>
        <sch:report test="$firstX eq $lastX and $firstY eq $lastY">The first and
          last elements of this path are the same. To specify a closed polygon, use
          the &lt;zone&gt; element rather than the &lt;path&gt; element. </sch:report>
      </sch:rule>
    </constraint>
  </constraintSpec>

Content model

<content>
    <empty/>
  </content>