[dsdl-discuss] Re: DSRL - DSDL Part 8

From: Rick Jelliffe <rjelliffe@allette.com.au>
Date: Fri Apr 13 2007 - 03:40:42 UTC

Martin Bryan said:
> Rick
>
> I presume your reference to ISO Catalogs was a Fruedian slip and you meant
> to say OASIS Catalogs. Or were you suggesting that we should introduce a
> definition of catalogs into Part 8?

I was a slip. But I think catalogs meet all the criteria for
standardization: useful, accepted, implemented, mature. I see two reason
for adding it to Part 10: first because it fits in with DSDL and it could
be used as an output generated by part 8, and second because of W3C's
disinterest. But they might not be enough.

I guess it comes down to scope. What is the scope of Part 10 actually?
Does Validation Management mean organizing the processes and parameters so
that the various parts of DSDL can be used together? Or is part 10 about
versioning and modularization?

On the related issue of the XSLT2 character map and your string-matching
idea: I think it comes down to whether we see entities as text inclusions
or as just strings for special characters in particular the ISO sets. I
don't mind the idea of a general string->entity renaming, though it seems
quite far from validation so I'd put it in the category of "could have"
for part 8, rather than "should have" or "must have". Here is a sketch for
XSLT1 code for such a feature. Give a schema:

<remap-string-to-entity-reference>
   <string>blah</string>
   <entity-name>blah</entity-name>
</remap-string-to-entity-reference>

generating XSLT something like

<xsl:variable name="schema" value="document(schema.dsrl)"/>

<xsl:template match="*/text()">
  <xsl:call-template name="remap-string-to-reference">
    <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
    <xsl:with-param name="i" select="1"/>
  </xsl:call-template>
</xsl:template>

<!-- Recursive function to replace multiple substrings multiple times-->
<xsl:template name="remap-string-to-entity-reference">

   <xsl:let name="item" value="$schema//remap=string-to-entity-reference[
$i ]" />

  <xsl:choose>
     <!-- If no more items, just print out the string -->
     <!-- This is the terminating condition -->
     <xsl:when test=" not( $item )" >
            <xsl:value-of select="$string" />
     </xsl:when>

     <!-- else if the item isn't found, progress to do the next one -->
     <xsl:when test=" not( string-contains ($string, $item/string)">
       <xsl:call-template name="remap-string-to-entity-reference">
         <xsl:with-param name="string" select="$string" />
         <xsl:with-param name="i" select="number($i) + 1" />
        </xsl:call-template>
     </xsl:when>

     <!-- else process the string before the first occurrence with
         the subsequence items, replae the string with a reference,
         and process the rest of the string using the current item
         in case there are more than one occurrences -->
      <xsl:otherwise>

         <xsl:let name="pre" value="string-before( $string, $item/string)">
         <xsl:let name="post" value="string-after( $string, $item/string)">

       <xsl:call-template name="remap-string-to-entity-reference">
         <xsl:with-param name="string" select="$pre" />
         <xsl:with-param name="i" select="number($i) + 1" />
        </xsl:call-template>
     </xsl:when>

       <xsl:text disable-output-escaping="true">&</xsl:text>
       <xsl:value-of select="$item/entity-name"/>
       <xsl:text>;</xsl:text>

       <xsl:call-template name="remap-string-to-entity-reference">
         <xsl:with-param name="string" select="$post" />
         <xsl:with-param name="i" select=" number($i) " />
        </xsl:call-template>
     </xsl:when>

      </xsl:otherwise>
</xsl:template>

Cheers
Rick

--
DSDL members discussion list
To unsubscribe, please send a message with the
command  "unsubscribe" to dsdl-discuss-request@dsdl.org
(mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)
Received on Fri Apr 13 05:45:56 2007

This archive was generated by hypermail 2.1.8 : Fri Apr 13 2007 - 18:03:02 UTC